@@ -0,0 +1,2184 @@
+package fgis.server.support.geojson;%0A%0Aimport java.util.HashMap;%0Aimport javax.json.JsonValue;%0Aimport org.geolatte.geom.Envelope;%0Aimport org.geolatte.geom.Geometry;%0Aimport org.geolatte.geom.crs.CrsId;%0Aimport org.geolatte.geom.crs.CrsRegistry;%0Aimport org.testng.annotations.Test;%0Aimport static org.testng.Assert.*;%0A%0Apublic final class GjElementTest%0A  extends AbstractGjElementTest%0A%7B%0A  @Test%0A  public void basicInteraction()%0A    throws Exception%0A  %7B%0A    final Geometry geometry = fromWkT( %22POINT (1 1)%22 );%0A    final CrsId crsId = CrsRegistry.getCrsIdForEPSG( 1234 );%0A    final Envelope bbox = new Envelope( 0, 0, 2, 2, crsId );%0A    final HashMap%3CString, JsonValue%3E additional = new HashMap%3C%3E();%0A    additional.put( %22foo%22, JsonValue.FALSE );%0A    final GjGeometry e = new GjGeometry( geometry, crsId, bbox, additional );%0A    assertEquals( e.getGeometry(), geometry );%0A    assertEquals( e.getBBox(), bbox );%0A    assertEquals( e.getCrsId(), crsId );%0A    assertEquals( e.getAdditionalProperties(), additional );%0A    assertPropertyAllowed( e, %22X%22 );%0A    assertPropertyNotAllowed( e, %22crs%22 );%0A    assertPropertyNotAllowed( e, %22bbox%22 );%0A    assertPropertyNotAllowed( e, %22type%22 );%0A  %7D%0A%0A  @Test%0A  public void nullMetadata()%0A    throws Exception%0A  %7B%0A    final Geometry geometry = fromWkT( %22POINT (1 1)%22 );%0A    final GjGeometry e = new GjGeometry( geometry, null, null, null );%0A    assertEquals( e.getGeometry(), geometry );%0A    assertNull( e.getBBox() );%0A    assertNull( e.getCrsId() );%0A    assertEquals( e.getAdditionalProperties().size(), 0 );%0A  %7D%0A%0A  @Test%0A  public void invalidAdditionalData()%0A    throws Exception%0A  %7B%0A    verifyAdditionalDataRestricted( %22type%22 );%0A    verifyAdditionalDataRestricted( %22crs%22 );%0A    verifyAdditionalDataRestricted( %22bbox%22 );%0A  %7D%0A%0A  private void verifyAdditionalDataRestricted( final String key )%0A  %7B%0A    final HashMap%3CString, JsonValue%3E additional = new HashMap%3C%3E();%0A    additional.put( key, JsonValue.FALSE );%0A    try%0A    %7B%0A      new GjGeometry( fromWkT( %22POINT (1 1)%22 ), null, null, additional );%0A    %7D%0A    catch ( final IllegalArgumentException e )%0A    %7B%0A      return;%0A    %7D%0A    fail( %22Expected to receive an exception for addition data: %22 + additional );%0A  %7D%0A%7D%0A

Add some simple tests around element functionality