package fgis.server.support.geojson;

import org.geolatte.geom.Geometry;
import org.testng.annotations.Test;
import static org.testng.Assert.*;

public final class GjGeometryTest
  extends AbstractGjElementTest
{
  @Test
  public void geometry()
    throws Exception
  {
    final Geometry geometry = fromWkT( "POINT (1 1)" );
    final GjGeometry e = new GjGeometry( geometry, null, null, null );
    assertEquals( e.getGeometry(), geometry );
    assertPropertyAllowed( e, "X" );
    assertPropertyNotAllowed( e, "coordinates" );
  }

  @SuppressWarnings( "ConstantConditions" )
  @Test
  public void nullGeometryPassedToGeometry()
    throws Exception
  {
    try
    {
      new GjGeometry( null, null, null, null );
    }
    catch ( final IllegalArgumentException e )
    {
      return;
    }
    fail( "Expected to fail when passing null geometry" );
  }

  @SuppressWarnings( "ConstantConditions" )
  @Test
  public void geometryCollectionPassedToGeometryShouldFail()
    throws Exception
  {
    try
    {
      new GjGeometry( fromWkT( "GEOMETRYCOLLECTION(POINT (1 1))" ), null, null, null );
    }
    catch ( final IllegalArgumentException e )
    {
      return;
    }
    fail( "Expected to fail when passing null geometry" );
  }
}

@@ -228,24 +228,21 @@
 ic void 
-geometry
+basic
 ()%0A    t
@@ -605,32 +605,16 @@
 Geometry
-PassedToGeometry
 ()%0A    t
@@ -932,10 +932,10 @@
 ssed
-To
+As
 Geom

Rename tests with more sensible names