コード例 #1
0
 protected void setUp() throws Exception {
   // we do need the resource manager for this test
   Fixture.setUpWithoutResourceManager();
   Fixture.createContext(false);
   // registration of real resource manager
   ResourceManager.register(new DefaultResourceManagerFactory());
   cache = new ImageDataCache();
 }
コード例 #2
0
 private static ImageData getImageData(final String resource) throws IOException {
   IResourceManager manager = ResourceManager.getInstance();
   InputStream inputStream = manager.getResourceAsStream(resource);
   if (inputStream == null) {
     throw new IllegalArgumentException("resource could not be found");
   }
   ImageLoader imageLoader = new ImageLoader();
   ImageData[] datas = imageLoader.load(inputStream);
   inputStream.close();
   return datas[0];
 }