@Test(groups = {"all", "fast", "automated"}) public void testSeriesCount() { if (config == null) throw new SkipException("No config tree"); String testName = "SeriesCount"; if (!initFile()) result(testName, false, "initFile"); result(testName, reader.getSeriesCount() == config.getSeriesCount(), "got " + reader.getSeriesCount() + ", expected " + config.getSeriesCount()); }
@Test(groups = {"all", "fast", "automated"}) public void testTileWidth() { String testName = "testTileWidth"; if (!initFile()) result(testName, false, "initFile"); boolean success = true; String msg = null; try { for (int i=0; i<reader.getSeriesCount() && success; i++) { reader.setSeries(i); int width = reader.getOptimalTileWidth(); success = width > 0; msg = "series #" + i + ": tile width = " + width; } } catch (Throwable t) { LOGGER.info("", t); success = false; } result(testName, success, msg); }
@Test(groups = {"all", "fast", "automated"}) public void testImageNames() { if (config == null) throw new SkipException("No config tree"); String testName = "ImageNames"; if (!initFile()) result(testName, false, "initFile"); IMetadata retrieve = (IMetadata) reader.getMetadataStore(); for (int i=0; i<reader.getSeriesCount(); i++) { config.setSeries(i); String realName = retrieve.getImageName(i); String expectedName = config.getImageName(); if (!expectedName.equals(realName) && !(realName == null && expectedName.equals("null"))) { result(testName, false, "Series " + i + " (got '" + realName + "', expected '" + expectedName + "')"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testDimensionOrder() { if (config == null) throw new SkipException("No config tree"); String testName = "DimensionOrder"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); String realOrder = reader.getDimensionOrder(); String expectedOrder = config.getDimensionOrder(); if (!realOrder.equals(expectedOrder)) { result(testName, false, "Series " + i + " (got " + realOrder + ", expected " + expectedOrder + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testSizeX() { if (config == null) throw new SkipException("No config tree"); String testName = "SizeX"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getSizeX() != config.getSizeX()) { result(testName, false, "Series " + i + " (expected " + config.getSizeX() + ", actual " + reader.getSizeX() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testSizeY() { if (config == null) throw new SkipException("No config tree"); String testName = "SizeY"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getSizeY() != config.getSizeY()) { result(testName, false, "Series " + i + " (expected " + config.getSizeY() + ", actual " + reader.getSizeY() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testFalseColor() { if (config == null) throw new SkipException("No config tree"); String testName = "FalseColor"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.isFalseColor() != config.isFalseColor()) { result(testName, false, "Series " + i + " (expected " + config.isFalseColor() + ", actual " + reader.isFalseColor() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testSizeT() { if (config == null) throw new SkipException("No config tree"); String testName = "SizeT"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getSizeT() != config.getSizeT()) { result(testName, false, "Series " + i + " (expected " + config.getSizeT() + ", actual " + reader.getSizeT() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testIndexed() { if (config == null) throw new SkipException("No config tree"); String testName = "Indexed"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.isIndexed() != config.isIndexed()) { result(testName, false, "Series " + i + " (expected " + config.isIndexed() + ", actual " + reader.isIndexed() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testThumbSizeY() { if (config == null) throw new SkipException("No config tree"); String testName = "ThumbSizeY"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getThumbSizeY() != config.getThumbSizeY()) { result(testName, false, "Series " + i + " (expected " + config.getThumbSizeY() + ", actual " + reader.getThumbSizeY() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testSizeZ() { if (config == null) throw new SkipException("No config tree"); String testName = "SizeZ"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getSizeZ() != config.getSizeZ()) { result(testName, false, "Series " + i + " (expected " + config.getSizeZ() + ", actual " + reader.getSizeZ() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testIsInterleaved() { if (config == null) throw new SkipException("No config tree"); String testName = "Interleaved"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.isInterleaved() != config.isInterleaved()) { result(testName, false, "Series " + i + " (expected " + config.isInterleaved() + ", actual " + reader.isInterleaved() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testRGB() { if (config == null) throw new SkipException("No config tree"); String testName = "RGB"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.isRGB() != config.isRGB()) { result(testName, false, "Series " + i + " (expected " + config.isRGB() + ", actual " + reader.isRGB() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testPhysicalSizeZ() { if (config == null) throw new SkipException("No config tree"); String testName = "PhysicalSizeZ"; if (!initFile()) result(testName, false, "initFile"); IMetadata retrieve = (IMetadata) reader.getMetadataStore(); for (int i=0; i<reader.getSeriesCount(); i++) { config.setSeries(i); Length expectedSize = config.getPhysicalSizeZ(); Length realSize = retrieve.getPixelsPhysicalSizeZ(i); if (!isAlmostEqual(realSize,expectedSize)) { result(testName, false, "Series " + i + " (expected " + expectedSize + ", actual " + realSize + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testPhysicalSizeY() { if (config == null) throw new SkipException("No config tree"); String testName = "PhysicalSizeY"; if (!initFile()) result(testName, false, "initFile"); IMetadata retrieve = (IMetadata) reader.getMetadataStore(); for (int i=0; i<reader.getSeriesCount(); i++) { config.setSeries(i); Length expectedSize = config.getPhysicalSizeY(); Length realSize = retrieve.getPixelsPhysicalSizeY(i); if (!isAlmostEqual(realSize,expectedSize)) { result(testName, false, "Series " + i + " (expected " + expectedSize + ", actual " + realSize + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testSizeC() { if (config == null) throw new SkipException("No config tree"); String testName = "SizeC"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getSizeC() != config.getSizeC()) { result(testName, false, "Series " + i + " (expected " + config.getSizeC() + ", actual " + reader.getSizeC() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testThumbSizeX() { if (config == null) throw new SkipException("No config tree"); String testName = "ThumbSizeX"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.getThumbSizeX() != config.getThumbSizeX()) { result(testName, false, "Series " + i + " (expected " + config.getThumbSizeX() + ", actual " + reader.getThumbSizeX() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testLittleEndian() { if (config == null) throw new SkipException("No config tree"); String testName = "LittleEndian"; if (!initFile()) result(testName, false, "initFile"); for (int i=0; i<reader.getSeriesCount(); i++) { reader.setSeries(i); config.setSeries(i); if (reader.isLittleEndian() != config.isLittleEndian()) { result(testName, false, "Series " + i + " (expected " + config.isLittleEndian() + ", actual " + reader.isLittleEndian() + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testPhysicalSizeX() { if (config == null) throw new SkipException("No config tree"); String testName = "PhysicalSizeX"; if (!initFile()) result(testName, false, "initFile"); IMetadata retrieve = (IMetadata) reader.getMetadataStore(); for (int i=0; i<reader.getSeriesCount(); i++) { config.setSeries(i); Length expectedSize = config.getPhysicalSizeX(); Length realSize = retrieve.getPixelsPhysicalSizeX(i); if (!isAlmostEqual(realSize,expectedSize)) { result(testName, false, "Series " + i + " (expected " + expectedSize + ", actual " + realSize + ")"); } } result(testName, true); }
@Test(groups = {"all", "fast", "automated"}) public void testTimeIncrement() { if (config == null) throw new SkipException("No config tree"); String testName = "TimeIncrement"; if (!initFile()) result(testName, false, "initFile"); IMetadata retrieve = (IMetadata) reader.getMetadataStore(); for (int i=0; i<reader.getSeriesCount(); i++) { config.setSeries(i); Time expectedIncrement = config.getTimeIncrement(); Time realIncrement = retrieve.getPixelsTimeIncrement(i); if (!isAlmostEqual(expectedIncrement,realIncrement)) { result(testName, false, "Series " + i + " (expected " + expectedIncrement + ", actual " + realIncrement + ")"); } } result(testName, true); }