Permalink
Browse files

Add additional 'example' test to 'example tests' run

  • Loading branch information...
marcesher committed May 23, 2013
1 parent 1db88d1 commit 7e945b19d04fc18c91d11f46eedf47e2dd77e2fa
Showing with 40 additions and 16 deletions.
  1. +18 −0 copy_jars_to_cf_classpath.xml
  2. BIN lib/cfmongodb.jar
  3. +15 −15 test/DBCollectionTest.cfc
  4. +7 −1 test/IncludeExamplesTest.cfc
@@ -0,0 +1,18 @@
<project name="copy jars" default="copy_jars">
<target name="copy_jars">
<property name="cf9_libs" value="C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib"/>
<property name="cf10_libs" value="C:/ColdFusion10/cfusion/lib"/>
<delete dir="${cf9_libs}" includes="mongo-*.jar"/>
<copy todir="${cf9_libs}">
<fileset dir="lib" includes="cfmongodb.jar,mongo*.jar"/>
</copy>
<delete dir="${cf10_libs}" includes="mongo-*.jar"/>
<copy todir="C:/ColdFusion10/cfusion/lib">
<fileset dir="lib" includes="cfmongodb.jar,mongo*.jar"/>
</copy>
</target>
</project>
View
BIN +16 Bytes (100%) lib/cfmongodb.jar
Binary file not shown.
View
@@ -302,40 +302,40 @@ import cfmongodb.core.*;
var doc = one.asArray()[1];
assertEquals( 3, doc.counter );
}
function find_should_handle_asString_correctly() {
var people = createPeople(5, true, "unittest", true);
var all = dbCol.find({"counterAsString": 1});
var all = dbCol.find({"counterAsString"= 1});
//expect no results because it's searching as a number
assertEquals(0, all.size());
var all = dbCol.find({"counterAsString": mongo.getMongoUtil().asString("1")});
var all = dbCol.find({"counterAsString"= mongo.getMongoUtil().asString("1")});
//expect 1 result because it's searching as a string
assertEquals(1, all.size());
}
function find_should_handle_all_types_correctly() {
var people = createPeople(5, true, "unittest", true);
//make sure there is 5 double
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"networth"={"$exists"=1}},
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"networth"={"$exists"=1}},
{"networth"={"$type"=1}}]} ); //type 1 is double
assertEquals(5, all.size());
//make sure there is 5 integer
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"age"={"$exists"=1}},
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"age"={"$exists"=1}},
{"age"={"$type"=16}}]} ); //type 16 is integer
assertEquals(5, all.size());
//make sure there is 5 string for "ageAsString"
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"ageAsString"={"$exists"=1}},
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"ageAsString"={"$exists"=1}},
{"ageAsString"={"$type"=2}}]} ); //type 2 is string
assertEquals(5, all.size());
//make sure there is 5 string for "networthAsString"
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"networthAsString"={"$exists"=1}},
all = dbCol.find( {"$and"= [{"name"="unittest"},
{"networthAsString"={"$exists"=1}},
{"networthAsString"={"$type"=2}}]} ); //type 2 is stirng
assertEquals(5, all.size());
}
@@ -4,7 +4,13 @@
<cfset variables.rootURL = "http://" & cgi.SERVER_NAME & ":" & cgi.SERVER_PORT & "/cfmongodb/examples/">
<cfset debug(cgi)>
<cfset paths = ["gettingstarted.cfm", "aggregation/group.cfm", "aggregation/mapReduce.cfm", "geospatial/geo.cfm", "PeopleList/index.cfm"]>
<cfset paths = ["gettingstarted.cfm"
, "aggregation/group.cfm"
, "aggregation/mapReduce.cfm"
, "aggregation/popularity.cfm"
, "aggregation/aggregate.cfm"
, "geospatial/geo.cfm"
, "PeopleList/index.cfm"]>
<cfset useJavaLoader = variables.factoryType eq "cfmongodb.core.JavaLoaderFactory" ? true : false>

0 comments on commit 7e945b1

Please sign in to comment.