[fdo-commits] r658 - in trunk/Providers/GenericRdbms/Src/UnitTest:
. Common
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Mon Jan 22 12:45:43 EST 2007
Author: barbarazoladek
Date: 2007-01-22 12:45:43 -0500 (Mon, 22 Jan 2007)
New Revision: 658
Modified:
trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.cpp
trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.h
trunk/Providers/GenericRdbms/Src/UnitTest/apply_schema_err3S_master.txt
Log:
column not set to autoincrement in non-feature class
Modified: trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.cpp
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.cpp 2007-01-20 14:20:11 UTC (rev 657)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.cpp 2007-01-22 17:45:43 UTC (rev 658)
@@ -1529,4 +1529,63 @@
{
return (FdoDouble) 2.225073858507202e-308;
}
+void FdoInsertTest::insertAutoGen()
+{
+ FdoIConnection* connection = UnitTestUtil::GetConnection(mSuffix, true);
+ try
+ {
+ FdoPtr<FdoIDescribeSchema> pDescCmd = (FdoIDescribeSchema*) connection->CreateCommand(FdoCommandType_DescribeSchema);
+ FdoFeatureSchemasP pSchemas = pDescCmd->Execute();
+ if (pSchemas)
+ {
+ FdoFeatureSchemaP pSchema = pSchemas->FindItem( L"TestEmpty" );
+ if (!pSchema)
+ {
+ FdoIApplySchema* pCmd = (FdoIApplySchema*) connection->CreateCommand(FdoCommandType_ApplySchema);
+ //FdoPtr<FdoFeatureSchemaCollection> pSchemas = FdoFeatureSchemaCollection::Create(NULL);
+ FdoFeatureSchema* pNewSchema = FdoFeatureSchema::Create( L"TestEmpty", L"Test schema" );
+ //pSchemas->Add( pSchema );
+ FdoClass* pNewClass = FdoClass::Create( L"Empty", L"Test class" );
+ pNewClass->SetIsAbstract(false);
+ FdoDataPropertyDefinition* pProp = FdoDataPropertyDefinition::Create( L"AttrId", L"id" );
+ pProp->SetDataType( FdoDataType_Int64 );
+ pProp->SetNullable(false);
+ pProp->SetIsAutoGenerated(true);
+ pNewClass->GetProperties()->Add( pProp );
+ pNewClass->GetIdentityProperties()->Add( pProp );
+
+ pProp = FdoDataPropertyDefinition::Create( L"AttrName", L"Name" );
+ pProp->SetDataType( FdoDataType_String );
+ pProp->SetLength(64);
+ pProp->SetNullable(true);
+ pNewClass->GetProperties()->Add( pProp );
+
+ FDO_SAFE_RELEASE(pProp);
+
+ pNewSchema->GetClasses()->Add( pNewClass );
+ pCmd->SetFeatureSchema( pNewSchema );
+ pCmd->Execute();
+ }
+ }
+
+ FdoIInsert *insertCommand = (FdoIInsert *) connection->CreateCommand(FdoCommandType_Insert);
+ insertCommand->SetFeatureClassName(L"TestEmpty:Empty");
+ FdoPtr<FdoPropertyValueCollection> propertyValues = insertCommand->GetPropertyValues();
+ FdoIFeatureReader *myReader = insertCommand->Execute();
+ CPPUNIT_ASSERT(myReader != NULL);
+
+ while (myReader->ReadNext())
+ {
+ CPPUNIT_ASSERT(!myReader->IsNull(L"AttrId"));
+ }
+ myReader->Release();
+ connection->Close();
+ }
+ catch (...)
+ {
+ connection->Close ();
+ throw;
+ }
+}
+
Modified: trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.h
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.h 2007-01-20 14:20:11 UTC (rev 657)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/Common/FdoInsertTest.h 2007-01-22 17:45:43 UTC (rev 658)
@@ -35,6 +35,7 @@
CPPUNIT_TEST( smartPointerInsert );
CPPUNIT_TEST( insertFlushTest );
//CPPUNIT_TEST( conditionalInsert );
+ CPPUNIT_TEST( insertAutoGen );
CPPUNIT_TEST_SUITE_END();
public:
@@ -55,6 +56,7 @@
virtual void smartPointerInsert();
virtual void conditionalInsert();
virtual void DisableFailures(){m_DisableFailures=true;};
+ virtual void insertAutoGen(); //Insert empty non-feature
protected:
virtual void set_provider() {};
Modified: trunk/Providers/GenericRdbms/Src/UnitTest/apply_schema_err3S_master.txt
===================================================================
--- trunk/Providers/GenericRdbms/Src/UnitTest/apply_schema_err3S_master.txt 2007-01-20 14:20:11 UTC (rev 657)
+++ trunk/Providers/GenericRdbms/Src/UnitTest/apply_schema_err3S_master.txt 2007-01-22 17:45:43 UTC (rev 658)
@@ -26,6 +26,7 @@
Error in Column {USER_DS}_apply_schema.dbo.base_missing.scale_too_high: scale 128 is greater than maximum allowed (38)
Cannot change identity properties for class Error:Base Missing from () to (ID); identity property change is not supported
Base class Acad:Ghost for class Error:Base Missing not found in current database
+ Identity Property 'Error:Base Conflict.FeatId' for new class must be autogenerated or non-readonly
Cannot add/modify class Error:Base Conflict; identity properties inherited from base class are different in the Feature Schema (ID) and the Database (FeatId)
Class 'Error:Base Conflict' and base class 'Acad:AcDbEntity' have different class types
Class 'Error:Feature object property class', for object property 'Error:Error Op.featureClass', is not an FdoClass
More information about the fdo-commits
mailing list