Revision 38083 branches/v2_0_0_prep/libraries/libFMap_dalfile/src-test/org/gvsig/fmap/dal/store/shp/Bug15642Test.java
Bug15642Test.java | ||
---|---|---|
41 | 41 |
import org.gvsig.fmap.geom.operation.GeometryOperation; |
42 | 42 |
import org.gvsig.fmap.geom.operation.GeometryOperationContext; |
43 | 43 |
import org.gvsig.fmap.geom.operation.fromjts.FromJTS; |
44 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
44 | 45 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
45 | 46 |
|
46 | 47 |
/** |
... | ... | |
55 | 56 |
public void testBug15642() throws Exception { |
56 | 57 |
new DefaultLibrariesInitializer().fullInitialize(); |
57 | 58 |
DataManager manager = DALLocator.getDataManager(); |
59 |
GeometryManager geometryManager = GeometryLocator.getGeometryManager(); |
|
58 | 60 |
|
59 | 61 |
EditableFeatureType type = new DefaultEditableFeatureType(); |
62 |
GeometryType geometryType = |
|
63 |
geometryManager.getGeometryType(Geometry.TYPES.POINT, |
|
64 |
Geometry.SUBTYPES.GEOM2D); |
|
60 | 65 |
type.add("geom", org.gvsig.fmap.geom.DataTypes.GEOMETRY) |
61 |
.setGeometryType(Geometry.TYPES.POINT) |
|
62 |
.setGeometrySubType(Geometry.SUBTYPES.GEOM2D); |
|
66 |
.setGeometryType(geometryType); |
|
63 | 67 |
type.setDefaultGeometryAttributeName("geom"); |
64 | 68 |
type.add("float", DataTypes.FLOAT).setSize(5); |
65 | 69 |
type.add("long", DataTypes.LONG).setSize(5); |
... | ... | |
82 | 86 |
com.vividsolutions.jts.geom.Geometry g = |
83 | 87 |
new GeometryFactory().createPoint(new Coordinate(0, 0)); |
84 | 88 |
|
85 |
GeometryManager geometryManager = GeometryLocator.getGeometryManager(); |
|
86 | 89 |
int opCode = geometryManager.getGeometryOperationCode(FromJTS.NAME); |
87 | 90 |
GeometryOperation converter = |
88 | 91 |
geometryManager.getGeometryOperation(opCode, Geometry.TYPES.POINT, |
... | ... | |
100 | 103 |
FeatureAttributeDescriptor defaultGeometryAttribute = |
101 | 104 |
store.getDefaultFeatureType().getDefaultGeometryAttribute(); |
102 | 105 |
|
103 |
assertEquals(Geometry.TYPES.POINT, |
|
104 |
defaultGeometryAttribute.getGeometryType()); |
|
105 |
assertEquals(Geometry.SUBTYPES.GEOM2D, |
|
106 |
defaultGeometryAttribute.getGeometrySubType()); |
|
106 |
geometryType = defaultGeometryAttribute.getGeomType(); |
|
107 |
assertEquals(Geometry.TYPES.POINT, geometryType.getType()); |
|
108 |
assertEquals(Geometry.SUBTYPES.GEOM2D, geometryType.getSubType()); |
|
107 | 109 |
|
108 | 110 |
store.dispose(); |
109 | 111 |
} |
Also available in: Unified diff