Permalink
Browse files

Updated input validation so collections with periods like system.inde…

…xes can be used with the driver to do things like create ensure indexes.
  • Loading branch information...
1 parent 2cd158f commit 49096eb4ec89448e58f5c33ae42e7158627b55a3 @s9tpepper committed Oct 26, 2011
View
Binary file not shown.
@@ -23,9 +23,6 @@ package as3.mongo.db
{
if (null == collectionName || "" == collectionName)
throw new MongoError(MongoError.COLLECTION_NAME_MAY_NOT_BE_NULL_OR_EMPTY);
-
- if (collectionName.lastIndexOf(".") > -1)
- throw new MongoError(MongoError.INVALID_COLLECTION_NAME_CONTAINS_PERIOD);
}
public static function canAuthenticate(db:DB):Boolean
@@ -51,6 +51,8 @@ package flexUnitTests.as3.mongo.db
DBMethodInputValidator.checkForInvalidCollectionNames("");
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function checkForInvalidCollectionNames_inputHasPeriod_throwsMongoError():void
{
@@ -108,6 +108,8 @@ package flexUnitTests.as3.mongo.db
_db.find(null, new Document(), new FindOptions());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function find_invalidCollectionNameWithPeriod_throwsError():void
{
@@ -45,6 +45,8 @@ package flexUnitTests.as3.mongo.db
assertThat(mockWire, received().method("updateFirst").args(_testDBName, testCollectionName, selector, update).once());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function updateFirst_invalidCollectionNameContainsPeriod_throwsError():void
{
@@ -53,6 +53,8 @@ package flexUnitTests.as3.mongo.db
_db.update(null, new Document(), new Document());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function update_invalidCollectionNameWithPeriodInIt_throwsError():void
{
@@ -53,6 +53,8 @@ package flexUnitTests.as3.mongo.db
_db.upsert(null, new Document(), new Document());
}
+ [Deprecated(message = "This test is deprecated as of version 0.3. Periods in collection names are needed to access collections like 'system.indexes'.")]
+ [Ignore]
[Test(expects = "as3.mongo.error.MongoError")]
public function upsert_invalidCollectionNameWithPeriod_throwsError():void
{

0 comments on commit 49096eb

Please sign in to comment.