コード例 #1
0
 @Test
 public void testGetProductComponentsOnFileInput() {
   File file =
       TestUtil.getTestFile(
           productsFolder
               + "SP04_HRI1_X__1O_20050605T090007_20050605T090016_DLR_70_PREU.BIL/metadata.xml");
   System.setProperty("snap.dataio.reader.tileWidth", "100");
   System.setProperty("snap.dataio.reader.tileHeight", "100");
   try {
     reader.readProductNodes(file, null);
     TreeNode<File> components = reader.getProductComponents();
     assertEquals(3, components.getChildren().length);
     String[] expectedIds = new String[] {"metadata.dim", "metadata.xml", "geolayer.bil"};
     int componentsAsExpected = 0;
     for (TreeNode<File> component : components.getChildren()) {
       for (String expectedValue : expectedIds) {
         if (component.getId().toLowerCase().equals(expectedValue.toLowerCase())) {
           componentsAsExpected++;
         }
       }
     }
     assertEquals(3, componentsAsExpected);
   } catch (IOException e) {
     e.printStackTrace();
     assertTrue(e.getMessage(), false);
   }
 }
コード例 #2
0
 @Test
 public void testGetProductComponentsOnArchiveInput() {
   File file =
       TestUtil.getTestFile(
           productsFolder + "SP04_HRI1_X__1O_20050605T090007_20050605T090016_DLR_70_PREU.BIL.ZIP");
   System.setProperty("snap.dataio.reader.tileWidth", "100");
   System.setProperty("snap.dataio.reader.tileHeight", "100");
   try {
     reader.readProductNodes(file, null);
     TreeNode<File> components = reader.getProductComponents();
     assertEquals(1, components.getChildren().length);
     assertEquals(
         "SP04_HRI1_X__1O_20050605T090007_20050605T090016_DLR_70_PREU.BIL.ZIP",
         components.getChildren()[0].getId());
   } catch (IOException e) {
     e.printStackTrace();
     assertTrue(e.getMessage(), false);
   }
 }