Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jul 30, 2024
1 parent 3347387 commit 8485742
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ public static Feature createPointFeature(String latitud, String longitud) {
return createPointFeature(lat, lon);
}

/**
*
* @param paths
* @return
*/
public static Feature createPolyLineFeature(String paths) {
try {
return new Feature(new PolyLine(paths));
} catch (Exception e) {
return null;
}
}

/**
* This method merges unexistent attributes from sourceFeature.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,14 @@ public void createInstanceFromJson2() {
}

}

/**
*
*/
@Test
public void getPolyFeatureTest() {
System.out.println("---------------- getNewPolyLineFeature");
Feature poly = FeatureTestFactory.getNewPolyLineFeature("Mi PolyLine", 33);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,41 @@ public static Feature getUpdatedOcupacionFeature(int objectId, String name) {
return feature;
}

/**
*
* @param description
* @param externalId
* @return
*/
public static Feature getNewPolyLineFeature(String description, Integer externalId) {
Map<String, Object> attributes = new LinkedHashMap<String, Object>();
attributes.put("IDEXTERNO", externalId);
attributes.put("DESCRIPCION", description);
attributes.put("RAZONSOCIAL", "Razon social");
attributes.put("NUMEROPOSTAL", null);
attributes.put("TIPOOCUPACION", 0);
attributes.put("FINI", new Date());
attributes.put("UNIDADMEDIDA", null);
attributes.put("EXCSABDOM", 0);
attributes.put("EXCFESTIVOS", 0);
attributes.put("PRESENCIAPOLICIAL", 0);
attributes.put("REVISADO", 0);
attributes.put("IDACTIVIDAD", 0);
attributes.put("ACTIVIDAD", "actividad");
attributes.put("IDCLASE", 0);
attributes.put("CLASE", "clase");
attributes.put("IDESTADO", 0);
attributes.put("ESTADO", "estado");
attributes.put("CALLE", "calle");
attributes.put("FFIN", new GregorianCalendar());
attributes.put("CANTIDADOCUPADA", null);
String jsonString = "{ \"paths\": [ [ [-97.06138, 32.837], [-97.06133, 33.836], [-98.2, 34.834], [-97, 40] ] ] }";

Feature feature = Feature.createPolyLineFeature(jsonString);
feature.setAttributes(attributes);
return feature;
}

/**
*
* @return
Expand Down

0 comments on commit 8485742

Please sign in to comment.