コード例 #1
0
 @Test(dependsOnMethods = {"testMetadataLevel"})
 public void testObjectiveSettingsIndexes() {
   Class<? extends IObject> klass = ObjectiveSettings.class;
   List<IObjectContainer> containers = store.getIObjectContainers(klass);
   for (IObjectContainer container : containers) {
     Map<String, Integer> indexes = container.indexes;
     Integer imageIndex = indexes.get(Index.IMAGE_INDEX.getValue());
     int imageCount = store.countCachedContainers(Image.class, null);
     String e = String.format("imageIndex %d >= imageCount %d", imageIndex, imageCount);
     assertFalse(e, imageIndex >= imageCount);
   }
 }
コード例 #2
0
 @Test(dependsOnMethods = {"testMetadataLevel"})
 public void testChannelCount() {
   List<IObjectContainer> containers = store.getIObjectContainers(Pixels.class);
   for (IObjectContainer container : containers) {
     Pixels pixels = (Pixels) container.sourceObject;
     assertNotNull(pixels.getSizeC());
     int sizeC = pixels.getSizeC().getValue();
     Integer imageIndex = container.indexes.get(Index.IMAGE_INDEX.getValue());
     int count = store.countCachedContainers(Channel.class, imageIndex);
     String e = String.format("Pixels sizeC %d != channel object count %d", sizeC, count);
     for (int c = 0; c < sizeC; c++) {
       count = store.countCachedContainers(Channel.class, imageIndex, c);
       e =
           String.format(
               "Missing channel object; imageIndex=%d " + "channelIndex=%d", imageIndex, c);
       assertEquals(e, 1, count);
     }
   }
 }