List<CucumberFeature> cucumberFeatures = new ArrayList<>(); FeatureBuilder featureBuilder = new FeatureBuilder(cucumberFeatures); featureBuilder.parse(new FileResource(featureFile.getParentFile(), featureFile), new ArrayList()); for (CucumberFeature feature: cucumberFeatures) { // Here we retrieve the Gherkin model Feature f = feature.getGherkinFeature(); // Here we get name and description of the feature. System.out.format("%s: %s%n", f.getName(), f.getDescription()); }
final String layerName = feature.getName().getLocalPart(); final String featureId = feature.getIdentifier().toString(); final String geometryName = geometryDescriptor.getName().getLocalPart();
@Test public void testHasRoot() throws Exception { insert(points1); Name typeName = points1.getName(); assertFalse(workTree.hasRoot(typeName)); }
@Test public void testDeleteCollection() throws Exception { List<Feature> featureList = new LinkedList<Feature>(); featureList.add(points1); featureList.add(points2); featureList.add(points3); workTree.insert(pointsName, featureList.iterator(), LISTENER, null, 3); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP3)).isPresent()); List<Feature> deleteFeatures = new LinkedList<Feature>(); deleteFeatures.add(points1); deleteFeatures.add(points3); Name typeName = points1.getName(); workTree.delete(typeName, null, deleteFeatures.iterator()); assertFalse(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent()); assertFalse(workTree.findUnstaged(appendChild(pointsName, idP3)).isPresent()); }
@Test public void testDeleteCollectionOfFeaturesNotPresent() throws Exception { List<Feature> featureList = new LinkedList<Feature>(); featureList.add(points1); featureList.add(points2); workTree.insert(pointsName, featureList.iterator(), LISTENER, null, 3); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent()); assertFalse(workTree.findUnstaged(appendChild(pointsName, idP3)).isPresent()); List<Feature> deleteFeatures = new LinkedList<Feature>(); deleteFeatures.add(points3); Name typeName = points1.getName(); workTree.delete(typeName, null, deleteFeatures.iterator()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP1)).isPresent()); assertTrue(workTree.findUnstaged(appendChild(pointsName, idP2)).isPresent()); assertFalse(workTree.findUnstaged(appendChild(pointsName, idP3)).isPresent()); }
@Test public void testHasRoot() throws Exception { insert(points1); Name typeName = points1.getName(); assertFalse(workTree.hasRoot(typeName.getLocalPart())); }
@Test public void testHasRoot() throws Exception { insert(points1); Name typeName = points1.getName(); assertFalse(workTree.hasRoot(typeName.getLocalPart())); }
final String layerName = feature.getName().getLocalPart(); final String featureId = feature.getIdentifier().toString(); final String geometryName = geometryDescriptor.getName().getLocalPart();
@Test public void testFeatureBuilder() { FeatureBuilder builder = new FeatureBuilder(pointsType); RevFeatureBuilder revBuilder = new RevFeatureBuilder(); RevFeature point1 = revBuilder.build(points1); Feature test = builder.build(idP1, point1); // assertEquals(points1.getValue(), test.getValue()); assertEquals(points1.getName(), test.getName()); assertEquals(points1.getIdentifier(), test.getIdentifier()); assertEquals(points1.getType(), test.getType()); assertEquals(points1.getUserData(), test.getUserData()); RevFeature feature = revBuilder.build(test); Feature test2 = builder.build(idP1, feature); assertEquals(((SimpleFeature) test).getAttributes(), ((SimpleFeature) test2).getAttributes()); } }
@Test public void testFeatureBuilder() { RevFeatureType revPointsType = RevFeatureTypeBuilder.build(pointsType); FeatureBuilder builder = new FeatureBuilder(revPointsType ); RevFeature point1 = RevFeatureBuilder.build(points1); Feature test = builder.build(idP1, point1); // assertEquals(points1.getValue(), test.getValue()); assertEquals(points1.getName(), test.getName()); assertEquals(points1.getIdentifier(), test.getIdentifier()); assertEquals(points1.getType(), test.getType()); assertEquals(points1.getUserData(), test.getUserData()); RevFeature feature = RevFeatureBuilder.build(test); Feature test2 = builder.build(idP1, feature); assertEquals(((SimpleFeature) test).getAttributes(), ((SimpleFeature) test2).getAttributes()); } }
@Test public void testFeatureBuilder() { RevFeatureType revPointsType = RevFeatureType.builder().type(pointsType).build(); FeatureBuilder builder = new FeatureBuilder(revPointsType); RevFeature point1 = RevFeature.builder().build(points1); Feature test = builder.build(idP1, point1); // assertEquals(points1.getValue(), test.getValue()); assertEquals(points1.getName(), test.getName()); assertEquals(points1.getIdentifier(), test.getIdentifier()); assertEquals(points1.getType(), test.getType()); assertEquals(points1.getUserData(), test.getUserData()); RevFeature feature = RevFeature.builder().build(test); Feature test2 = builder.build(idP1, feature); assertEquals(((SimpleFeature) test).getAttributes(), ((SimpleFeature) test2).getAttributes()); } }