// Copyright (C) 2004-2006 Autodesk, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of version 2.1 of the GNU Lesser // General Public License as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.IO; using OSGeo.FDO.Connections; using OSGeo.FDO.Commands; using OSGeo.FDO.Commands.Schema; using OSGeo.FDO.Commands.Feature; using OSGeo.FDO.Schema; using OSGeo.FDO.Expression; using OSGeo.FDO.Xml; using OSGeo.Geometry; using OSGeo.Common.Io; using OSGeo.Common.Xml; // using ShpObjectFactory = OSGeo.FDO.Providers.SHP.Override.ObjectFactory; using ShpPhysicalSchemaMapping = OSGeo.FDO.Providers.SHP.Override.PhysicalSchemaMapping; using ShpClassDefinition = OSGeo.FDO.Providers.SHP.Override.ClassDefinition; using ShpClassCollection = OSGeo.FDO.Providers.SHP.Override.ClassCollection ; using ShpColumnDefinition = OSGeo.FDO.Providers.SHP.Override.ColumnDefinition ; using ShpPropertyDefinition = OSGeo.FDO.Providers.SHP.Override.PropertyDefinition ; using ShpPropertyDefinitionCollection = OSGeo.FDO.Providers.SHP.Override.PropertyDefinitionCollection ; using unit_test.Framework; namespace unit_test.ProviderTests { class OverridesTest : BaseTestWithConnection { public OverridesTest(ShpTestProvider connectionProvider) : base(connectionProvider) { schemaNames = new string[2] ; schemaNames[0] = "Water" ; schemaNames[1] = "Water2" ; classNames = new string[2] ; classNames[0] = "Lake"; classNames[1] = "River"; columnNames = new string[2] ; columnNames[0] = "SoundingDate"; columnNames[1] = "Surveyor"; propertyNames = new string [2] ; propertyNames[0] = "SNDG_DATE"; propertyNames[1] = "SRVYR"; fileNames = new string [2] ; fileNames[0] = "/Foo/Lake.shp"; fileNames[1] = "/Foo/River.shp"; } public override void SetUp() { base.SetUp() ; } public override void TearDown() { base.TearDown() ; } public enum GeometricType { GeometricType_Point = 0x01, GeometricType_Curve = 0x02, GeometricType_Surface = 0x04, GeometricType_Solid = 0x08 }; String[] schemaNames ; String[] classNames ; String[] propertyNames ; String[] columnNames ; String[] fileNames ; const string ROOT_LOCATION = @"..\..\..\..\TestData\" ; const string ONTARIO_LOCATION = ROOT_LOCATION + @"Ontario\" ; const string NANBOKU_LOCATION = ROOT_LOCATION + @"Nanboku\" ; // Schema constants: const string schemaName = "NewSchema"; // Ontario class constants: const string classNameOntario = "NewOntario"; const string shapefileOntario = ROOT_LOCATION + "OntarioGenerated.shp"; const string propOntarioId = "NewFeatId"; const string propOntarioGeom = "NewGeometry"; const string propOntarioPerimeter = "NewPerimeter"; const string propOntarioArea = "NewArea"; const string colOntarioPerimeter = "PERIMETER"; const string colOntarioArea = "AREA"; // Nanboku class constants: const string classNameNanboku = "NewNanboku"; const string shapefileNanboku = ROOT_LOCATION + "NanbokuGenerated.shp"; const string propNanbokuId = "NewFeatId"; const string propNanbokuGeom = "NewGeometry"; const string propNanbokuGL = "NewGL"; const string colNanbokuGL = "GL"; const string filterNanboku = "(NewGL < 25.0) and (NewFeatId < 100)"; public void Test_CreateSchemaOverrides() //pass { try { for (int i=0; i