Ejemplo n.º 1
0
  @Test
  public void testAlternateLookup() throws Exception {
    SimpleFeatureSource source = getFeatureSource(MockData.PRIMITIVEGEOFEATURE);
    SimpleFeatureCollection fc = source.getFeatures();
    SimpleFeatureIterator features = fc.features();
    try {
      SimpleFeature f = features.next();

      FeatureTemplate template = new FeatureTemplate();
      String result = template.template(f, "dummy.ftl", Dummy.class);

      assertEquals("dummy", result);
    } finally {
      features.close();
    }
  }
Ejemplo n.º 2
0
  @Test
  public void testRawValue() throws Exception {
    SimpleFeatureSource source = getFeatureSource(MockData.PRIMITIVEGEOFEATURE);
    SimpleFeatureCollection fc = source.getFeatures();
    SimpleFeatureIterator i = fc.features();
    try {
      SimpleFeature f = (SimpleFeature) i.next();

      FeatureTemplate template = new FeatureTemplate();
      try {
        template.template(f, "rawValues.ftl", FeatureTemplateTest.class);
      } catch (Exception e) {
        e.printStackTrace();
        throw (e);
      }
    } finally {
      i.close();
    }
  }