[fdo-commits] r116 - in branches/3.2.x/Providers/WMS/Src: Overrides
Provider UnitTest
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Tue Jan 30 18:04:06 EST 2007
Author: romicadascalescu
Date: 2007-01-30 18:04:06 -0500 (Tue, 30 Jan 2007)
New Revision: 116
Added:
branches/3.2.x/Providers/WMS/Src/UnitTest/WMSOverrideClass3.xml
Modified:
branches/3.2.x/Providers/WMS/Src/Overrides/FdoWmsOvRasterDefinition.cpp
branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsBoundingBox.cpp
branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsConnection.cpp
branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsLayer.cpp
branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.cpp
branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.h
branches/3.2.x/Providers/WMS/Src/UnitTest/UnitTest.vcproj
branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.cpp
branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.h
Log:
Fixed WMS externalizes invalid SRS (lowercase values)
Modified: branches/3.2.x/Providers/WMS/Src/Overrides/FdoWmsOvRasterDefinition.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/Overrides/FdoWmsOvRasterDefinition.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/Overrides/FdoWmsOvRasterDefinition.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -102,6 +102,7 @@
void FdoWmsOvRasterDefinition::SetSpatialContextName(FdoString* value)
{
m_spatialContext = value;
+ m_spatialContext = m_spatialContext.Upper();
}
FdoWmsOvLayerCollection* FdoWmsOvRasterDefinition::GetLayers(void) const
Modified: branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsBoundingBox.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsBoundingBox.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsBoundingBox.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -175,4 +175,5 @@
void FdoWmsBoundingBox::SetCRS(FdoString* value)
{
mCRS = value;
+ mCRS = mCRS.Upper();
}
Modified: branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsConnection.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsConnection.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsConnection.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -540,6 +540,7 @@
void FdoWmsConnection::SetActiveSpatialContext (FdoString* value)
{
mActiveSpatialContext = value;
+ mActiveSpatialContext = mActiveSpatialContext.Upper();
}
/// <summary>Get the active spatial context.</summary>
Modified: branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsLayer.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsLayer.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/Provider/FdoWmsLayer.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -231,7 +231,8 @@
FdoCommonOSUtil::wcsicmp(name, FdoWmsXmlGlobals::WmsCapabilitiesCRS) == 0)
{
FdoStringsP layerCoordSystems = GetCoordinateReferenceSystems();
- FdoStringsP coordSystems = FdoStringCollection::Create(mXmlContentHandler->GetString(), FdoWmsXmlGlobals::WmsCapabilitiesSRSDelimiter);
+ FdoStringP SRSList = mXmlContentHandler->GetString();
+ FdoStringsP coordSystems = FdoStringCollection::Create(SRSList.Upper(), FdoWmsXmlGlobals::WmsCapabilitiesSRSDelimiter);
layerCoordSystems += coordSystems;
}
}
Modified: branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -697,3 +697,96 @@
fail(ex);
}
}
+
+// configuration file contains an invalid SRS (lowercase name)
+// an exception will be thrown if we don't handle it
+void OverridesTest::TestSetConfiguration4()
+{
+ try
+ {
+ FdoPtr<FdoIConnection> connection = WmsTests::GetConnection();
+ if (connection == NULL) {
+ CPPUNIT_FAIL("FAILED - CreateConnection returned NULL\n");
+ }
+
+ connection->SetConnectionString(L"FeatureServer=http://wms.jpl.nasa.gov/wms.cgi");
+ FdoIoFileStreamP fileStream = FdoIoFileStream::Create(L"WMSOverrideClass3.xml", L"r");
+
+ connection->SetConfiguration(fileStream);
+ connection->Open();
+
+ FdoPtr<FdoIDescribeSchema> cmd =
+ static_cast<FdoIDescribeSchema *> (connection->CreateCommand (FdoCommandType_DescribeSchema));
+ FdoPtr<FdoFeatureSchemaCollection> schemas = cmd->Execute ();
+ FdoInt32 cntSchemas = schemas->GetCount ();
+
+ for (FdoInt32 i=0; i<cntSchemas; i++)
+ {
+ FdoPtr<FdoFeatureSchema> schema = schemas->GetItem (i);
+ FdoStringP schemaName = schema->GetName();
+#ifdef _DEBUG
+ wprintf (L" Schema: %ls\n", (FdoString *) schemaName);
+#endif
+
+ FdoPtr<FdoClassCollection> classes = schema->GetClasses ();
+ FdoInt32 cntClasses = classes->GetCount();
+
+ for (FdoInt32 j=0; j<cntSchemas; j++)
+ {
+ FdoPtr<FdoClassDefinition> clsDef = classes->GetItem(j);
+ FdoStringP className = clsDef->GetName();
+#ifdef _DEBUG
+ wprintf (L" Class: %ls\n", (FdoString *) className);
+#endif
+
+ FdoPtr<FdoPropertyDefinitionCollection> props = clsDef->GetProperties ();
+ FdoInt32 cntProps = props->GetCount();
+
+ for (FdoInt32 i=0; i<cntProps; i++)
+ {
+ FdoPtr<FdoPropertyDefinition> prop = props->GetItem (i);
+ FdoStringP propName = prop->GetName ();
+#ifdef _DEBUG
+ wprintf (L" Property: %ls\n", (FdoString *) propName);
+#endif
+ }
+
+ FdoPtr<FdoISelect> cmdSelect =
+ static_cast<FdoISelect *> (connection->CreateCommand (FdoCommandType_Select));
+ cmdSelect->SetFeatureClassName (clsDef->GetName ());
+ FdoPtr<FdoIFeatureReader> featReader = cmdSelect->Execute ();
+
+ while (featReader->ReadNext ())
+ {
+#ifdef _DEBUG
+ wprintf (L" Id: %ls\n", featReader->GetString (L"Id"));
+#endif
+ FdoPtr<FdoIRaster> raster = featReader->GetRaster (L"Image");
+ FdoInt32 xSize = raster->GetImageXSize ();
+ FdoInt32 ySize = raster->GetImageYSize ();
+ FdoPtr<FdoIStreamReader> streamReader = raster->GetStreamReader ();
+ CPPUNIT_ASSERT (streamReader != NULL);
+ FdoIStreamReaderTmpl<FdoByte> * byteStreamReader =
+ static_cast<FdoIStreamReaderTmpl<FdoByte>*> (streamReader.p);
+
+ FdoByte buff[4096];
+ FdoInt64 cntTotal = 0;
+ FdoInt32 cntRead = 0;
+ do
+ {
+ cntRead = byteStreamReader->ReadNext (buff, 0 , 4096);
+ cntTotal += cntRead;
+ }
+ while (cntRead);
+ }
+ }
+ }
+
+
+ connection->Close();
+ }
+ catch (FdoException* e)
+ {
+ fail (e);
+ }
+}
Modified: branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.h
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.h 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/OverridesTest.h 2007-01-30 23:04:06 UTC (rev 116)
@@ -35,6 +35,7 @@
CPPUNIT_TEST( TestSetConfiguration2);
#endif
CPPUNIT_TEST( TestSetConfiguration3);
+ CPPUNIT_TEST( TestSetConfiguration4);
CPPUNIT_TEST( TestNoDefaultDataModel );
CPPUNIT_TEST( TestQualifiedName );
CPPUNIT_TEST_SUITE_END();
@@ -49,6 +50,7 @@
void TestSetConfiguration();
void TestSetConfiguration2();
void TestSetConfiguration3();
+ void TestSetConfiguration4();
void TestNoDefaultDataModel();
void TestQualifiedName();
Modified: branches/3.2.x/Providers/WMS/Src/UnitTest/UnitTest.vcproj
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/UnitTest.vcproj 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/UnitTest.vcproj 2007-01-30 23:04:06 UTC (rev 116)
@@ -736,8 +736,8 @@
<Tool
Name="VCCustomBuildTool"
Description="Performing fake install"
- CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
- AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
+ CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy WMSOverrideClass3.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
+ AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;WMSOverrideClass3.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
Outputs="$(OutDir)\providers.xml"
/>
</FileConfiguration>
@@ -747,8 +747,8 @@
<Tool
Name="VCCustomBuildTool"
Description="Performing fake install"
- CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
- AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
+ CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy WMSOverrideClass3.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
+ AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;WMSOverrideClass3.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
Outputs="$(OutDir)\providers.xml"
/>
</FileConfiguration>
@@ -758,8 +758,8 @@
<Tool
Name="VCCustomBuildTool"
Description="Performing fake install"
- CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
- AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
+ CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy WMSOverrideClass3.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
+ AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;WMSOverrideClass3.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
Outputs="$(OutDir)\providers.xml"
/>
</FileConfiguration>
@@ -769,8 +769,8 @@
<Tool
Name="VCCustomBuildTool"
Description="Performing fake install"
- CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
- AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
+ CommandLine="copy providers.xml $(OutDir)
copy WmsOverridesConfig.xml $(OutDir)
copy WmsSchemaConfig.xml $(OutDir)
copy WmsSchemaConfig_Jake_MapServer.xml $(OutDir)
copy NASA_WMS_Config.xml $(OutDir)
copy WMSOverrideClass2.xml $(OutDir)
copy WMSOverrideClass3.xml $(OutDir)
copy CubeServer_WMS_Config.xml $(OutDir)
copy MultiLayers_Config.xml $(OutDir)
"
+ AdditionalDependencies="providers.xml;WmsOverridesConfig.xml;WmsSchemaConfig.xml;WmsSchemaConfig_Jake_MapServer.xml;NASA_WMS_Config.xml;WMSOverrideClass2.xml;WMSOverrideClass3.xml;CubeServer_WMS_Config.xml;MultiLayers_Config.xml"
Outputs="$(OutDir)\providers.xml"
/>
</FileConfiguration>
Added: branches/3.2.x/Providers/WMS/Src/UnitTest/WMSOverrideClass3.xml
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/WMSOverrideClass3.xml (rev 0)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/WMSOverrideClass3.xml 2007-01-30 23:04:06 UTC (rev 116)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?><fdo:DataStore xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:fds="http://fdo.osgeo.org/schemas/fds">
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/WMSLayers" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:WMSLayers="http://fdo.osgeo.org/schemas/feature/WMSLayers" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name="us_landsat_wgs84_1" type="WMSLayers:us_landsat_wgs84_1Type" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="us_landsat_wgs84_1Key">
+ <xs:selector xpath=".//us_landsat_wgs84_1"/>
+ <xs:field xpath="Id"/>
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="us_landsat_wgs84_1Type" abstract="false" fdo:hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="gml:AbstractFeatureType">
+ <xs:sequence>
+ <xs:element name="Id">
+ <xs:annotation>
+ <xs:documentation/>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="256"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Image" type="fdo:RasterPropertyType" fdo:defaultImageXSize="1024" fdo:defaultImageYSize="1024"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:schema>
+ <SchemaMapping provider="OSGeo.WMS.3.2" name="WMSLayers" xmlns="http://fdowms.osgeo.org/schemas">
+ <complexType name="us_landsat_wgs84_1Type">
+ <RasterDefinition name="Image">
+ <Format>PNG</Format>
+ <Transparent>false</Transparent>
+ <BackgroundColor></BackgroundColor>
+ <Time></Time>
+ <Elevation></Elevation>
+ <SpatialContext>epsg:4326</SpatialContext>
+ <Layer name="us_landsat_wgs84"/>
+ </RasterDefinition>
+ </complexType>
+ </SchemaMapping>
+</fdo:DataStore>
Modified: branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.cpp
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.cpp 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.cpp 2007-01-30 23:04:06 UTC (rev 116)
@@ -56,6 +56,18 @@
}
}
+void WmsTestSpatialContext::testServer3 ()
+{
+ try
+ {
+ testServer (L"http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/germany/germany.map&VERSION=1.1.1", 2);
+ }
+ catch (FdoException* e)
+ {
+ fail(e);
+ }
+}
+
void WmsTestSpatialContext::testServer (FdoString* featureServer, FdoInt32 cntSpatialContexts)
{
FdoPtr<FdoIConnection> conn = this->GetConnection ();
Modified: branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.h
===================================================================
--- branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.h 2007-01-26 00:30:48 UTC (rev 115)
+++ branches/3.2.x/Providers/WMS/Src/UnitTest/WmsTestSpatialContexts.h 2007-01-30 23:04:06 UTC (rev 116)
@@ -32,6 +32,7 @@
CPPUNIT_TEST (testServer1);
#endif
CPPUNIT_TEST (testServer2);
+ CPPUNIT_TEST (testServer3);
CPPUNIT_TEST_SUITE_END ();
public:
@@ -42,6 +43,7 @@
void _tearDown () {}
void testServer1 ();
void testServer2 ();
+ void testServer3 ();
private:
void testServer (FdoString* feaureServer, FdoInt32 cntSpatialContexts);
More information about the fdo-commits
mailing list