Esempio n. 1
0
 @Test
 public void testCreateNCML() throws ThreddsUtilitiesException, IOException {
   File test = NcMLUtil.createNcML(destinationFile.getCanonicalPath());
   test.deleteOnExit();
   assertThat(test, is(notNullValue()));
   assertThat(test.length(), is(not(new Long(0))));
 }
Esempio n. 2
0
 /**
  * Test of globalAttributesToMeta method, of class NcMLUtilTest.
  *
  * @throws Exception
  */
 @Test
 public void testGlobalAttributesToMeta() throws Exception {
   Group metaGroup = NcMLUtil.globalAttributesToMeta(testFile, wrapper);
   Attribute attr = metaGroup.findAttribute("history");
   // TODO review the generated test code and remove the default call to fail.
   assertThat(attr, is(notNullValue()));
   assertThat(metaGroup.getAttributes().size(), is(equalTo(7)));
   assertThat(metaGroup.getShortName().contains("QPE.20110214.009.105"), is(true));
 }
Esempio n. 3
0
 @Test
 public void testTransformNCMLtoXML() throws ThreddsUtilitiesException, IOException {
   File ncmlFile = NcMLUtil.createNcML(destinationFile.getCanonicalPath());
   ncmlFile.deleteOnExit();
   String _xsltMetadataAssessmentToXML =
       NcMLUtilTest.class.getClassLoader().getResource("UnidataDDCount-xml.xsl").getPath();
   File xmlFile =
       ThreddsTranslatorUtil.transform(
           _xsltMetadataAssessmentToXML,
           ncmlFile.getCanonicalPath(),
           FileHelper.getTempDirectory() + File.separator + "output.xml");
   xmlFile.deleteOnExit();
   assertThat(xmlFile.exists(), is(true));
   assertThat(xmlFile.length(), is(not(new Long(0))));
 }