[mapguide-trac] #369: This ticket contains 5 Defects ID: 1014109, 1014117, 1014118, 1014123, 985011. All of the five defects are related to the Remove method. They have the same problem and could be fixed using a same way.

MapGuide Open Source trac_mapguide at osgeo.org
Wed Dec 26 04:57:28 EST 2007


#369: This ticket contains 5 Defects ID: 1014109,1014117,1014118,1014123,985011.
All of the five defects are related to the Remove method. They have the
same problem and could be fixed using a same way.
------------------------+---------------------------------------------------
 Reporter:  jessicacao  |         Owner:  jiab   
     Type:  defect      |        Status:  new    
 Priority:  medium      |     Milestone:  2.0    
Component:  General     |       Version:         
 Severity:  major       |    Resolution:         
 Keywords:  Remove      |   External_id:  1014109
------------------------+---------------------------------------------------
Changes (by jessicacao):

  * keywords:  MgClassDefinitionCollection::Remove => Remove
  * summary:  MgClassDefinitionCollection::Remove(MgClassDefinition value)
              returns a wrong value when the instance of
              MgClassDefinitionCollection is empty. => This
              ticket contains 5 Defects ID:
              1014109,1014117,1014118,1014123,985011. All of
              the five defects are related to the Remove
              method. They have the same problem and could be
              fixed using a same way.

Comment:

 [[BR]]
 [[BR]]
 This ticket contains 5 Defects ID: 1014109,1014117,1014118,1014123,985011.
 All of the five defects are related to the Remove method. They have the
 same problem and could be fixed using a same way.[[BR]]

 Their descriptions are bellow:[[BR]]

 1.985011[[BR]]

 MgStringPropertyCollection::Remove(MgStringProperty value) returns a wrong
 value when the instance of MgStringPropertyCollection is empty.[[BR]]

 Step to recur:[[BR]]

 a. Construct an instance of MgStringPropertyCollection using the following
 code [[BR]]

 MgStringPropertyCollection stringPropertyCollection = new
 MgStringPropertyCollection();[[BR]]

 b. Construct an instance of MgStringProperty using the following
 code[[BR]]

 MgStringProperty stringProperty = new
 MgStringPropert("stringProperty","testString");[[BR]]

 c Use the method Remove(MgStringProperty value) to return a bool type
 value.[[BR]]

 Sample code: [[BR]]

        private MgStringPropertyCollection stringPropertyCollection;[[BR]]
        private MgStringProperty stringProperty;[[BR]]
        stringPropertyCollection = new MgStringPropertyCollection();[[BR]]
        stringProperty = new MgStringProperty
 ("stringProperty","testString");[[BR]]
        bool bRet = stringPropertyCollection.Remove(stringProperty);[[BR]]

        Assert.IsTrue(bRet);[[BR]]

        Expect result:  False[[BR]]
        Actual result:  True[[BR]]

 2.1014109[[BR]]

 MgClassDefinitionCollection::Remove(MgClassDefinition value) returns a
 wrong value when the instance of MgClassDefinitionCollection is
 empty.[[BR]]

 Step to recur:[[BR]]

 a. Construct an instance of MgClassDefinitionCollection using the
 following code [[BR]]

 MgClassDefinitionCollection classDefColl = new
 MgClassDefinitionCollection();[[BR]]

 b. Construct an instance of MgClassDefinition using the following
 code[[BR]]

 MgClassDefinition classDef = new MgClassDefinition(); [[BR]]

 c. Use the method Remove(MgClassDefinition value) to return a bool type
 value.[[BR]]

 Sample code: [[BR]]

             Assert.IsFalse(classDefColl.Remove(classDef));[[BR]]

             Expect result:  False[[BR]]
             Actual result:  True[[BR]]

 3.1014117[[BR]]

 MgFeatureSchemaCollection:: Remove(MgFeatureSchema value) returns a wrong
 value when the instance of MgFeatureSchemaCollection is empty.[[BR]]

 Step to recur:[[BR]]

 a. Construct an instance of MgFeatureCommandCollection using the following
 code [[BR]]

  MgFeatureCommandCollection  featComColl = new
 MgFeatureCommandCollection();[[BR]]

 b. Construct an instance of MgFeatureCommand using the following
 code[[BR]]

             strClassName = "FeatureClassName";[[BR]]
             strFilterText = "FilterText";[[BR]]

             prop1 = new MgBooleanProperty("prop1", true);[[BR]]
             prop2 = new MgBooleanProperty("prop2", false);[[BR]]

             propColl1 = new MgPropertyCollection();[[BR]]
             propColl2 = new MgPropertyCollection();[[BR]]

             propColl1.Add(prop1);[[BR]]
             propColl1.Add(prop2);[[BR]]
             propColl2.Add(prop2);[[BR]]

 MgUpdateFeatures updateFeat = new MgUpdateFeatures(strClassName,
 propColl1, strFilterText);[[BR]]

 c. Use the method Remove(MgFeatureCommand command) to return a bool type
 value.[[BR]]

 Sample code: [[BR]]

    Assert.IsFalse(featComColl.Remove((MgFeatureCommand)updateFeat));[[BR]]

    Expect result:  False[[BR]]
    Actual result:  True[[BR]]

 4.1014118[[BR]]

 MgMapCollection::Remove(MgMapBase value) returns a wrong value when the
 instance of MgMapCollection is empty.[[BR]]

 Step to recur:[[BR]]

 a. Construct an instance of MgMapCollection using the following code
 [[BR]]

 MgMapCollection mapColl = new MgMapCollection();[[BR]]

 b. Construct an instance of MgMapBase using the following code[[BR]]

 MgMapBase mapBase = new MgMapBase();[[BR]]

 c. Use the method Remove(MgMapBase value)to return a bool type
 value.[[BR]]

 Sample code: [[BR]]

       Assert.IsFalse(mapColl.Remove(mapBase));[[BR]]

       Expect result:  False[[BR]]
       Actual result:  True[[BR]]

 5.1014123[[BR]]

 MgPropertyDefinitionCollection:: Remove(MgPropertyDefinition value)
 returns a wrong value when the instance of MgMapCollection is empty.[[BR]]

 Step to recur:[[BR]]

 a. Construct an instance of MgPropertyDefinitionCollection using the
 following code [[BR]]

   MgPropertyDefinitionCollection propDefColl = new
 MgPropertyDefinitionCollection();[[BR]]

 b. Construct an instance of MgPropertyDefinition using the following
 code[[BR]]

 MgPropertyDefinition propDef = new MgPropertyDefinition("propName",
 MgPropertyType.Boolean); [[BR]]

 c. Use the method Remove(MgPropertyDefinition value)to return a bool type
 value.[[BR]]

 Sample code: [[BR]]

           Assert.IsFalse(propDefColl.Remove(propDef));[[BR]]

           Expect result:  False[[BR]]
           Actual result:  True[[BR]]

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/369#comment:2>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list