Skip to content

Commit

Permalink
Tests for using a custom comparator.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Jelonek committed Feb 14, 2012
1 parent 039ed6a commit a911b10
Show file tree
Hide file tree
Showing 20 changed files with 620 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SBJson.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
3BB5955C14EAA4B8001BE91E /* SortedFormatTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BB5955B14EAA4B8001BE91E /* SortedFormatTest.m */; };
3BB5955D14EAA4B8001BE91E /* SortedFormatTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BB5955B14EAA4B8001BE91E /* SortedFormatTest.m */; };
BC12324B1391D5CC00131607 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC1232491391D5CC00131607 /* InfoPlist.strings */; };
BC1232561391D5CC00131607 /* SBJson.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC12323D1391D5CC00131607 /* SBJson.framework */; };
BC12325C1391D5CC00131607 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BC12325A1391D5CC00131607 /* InfoPlist.strings */; };
Expand Down Expand Up @@ -102,6 +104,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
3BB5955B14EAA4B8001BE91E /* SortedFormatTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SortedFormatTest.m; sourceTree = "<group>"; };
BC12323D1391D5CC00131607 /* SBJson.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SBJson.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BC1232481391D5CC00131607 /* SBJson-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SBJson-Info.plist"; sourceTree = "<group>"; };
BC12324A1391D5CC00131607 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -284,6 +287,7 @@
BC8852311391D6DD00370E55 /* RoundTripTest.m */,
BC8852971391D6DE00370E55 /* StreamParserIntegrationTest.m */,
BC8852981391D6DE00370E55 /* WriterTest.m */,
3BB5955B14EAA4B8001BE91E /* SortedFormatTest.m */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -610,6 +614,7 @@
BC88532C1391D6DE00370E55 /* RoundTripTest.m in Sources */,
BC8853911391D6DE00370E55 /* StreamParserIntegrationTest.m in Sources */,
BC8853921391D6DE00370E55 /* WriterTest.m in Sources */,
3BB5955C14EAA4B8001BE91E /* SortedFormatTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -644,6 +649,7 @@
BC417FFA13A1008F00C8BC49 /* RoundTripTest.m in Sources */,
BC417FFB13A1008F00C8BC49 /* StreamParserIntegrationTest.m in Sources */,
BC417FFC13A1008F00C8BC49 /* WriterTest.m in Sources */,
3BB5955D14EAA4B8001BE91E /* SortedFormatTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
1 change: 1 addition & 0 deletions Tests/Data/comparatorsort/basic/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["one",2,{"foo":null,"Boo":false,"quux":true,"bar":[1, 2, []]},{}]
17 changes: 17 additions & 0 deletions Tests/Data/comparatorsort/basic/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
"one",
2,
{
"bar": [
1,
2,
[
]
],
"Boo": false,
"foo": null,
"quux": true
},
{
}
]
1 change: 1 addition & 0 deletions Tests/Data/comparatorsort/json.org/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Source: http://json.org/example.html
22 changes: 22 additions & 0 deletions Tests/Data/comparatorsort/json.org/a/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
25 changes: 25 additions & 0 deletions Tests/Data/comparatorsort/json.org/a/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"glossary": {
"GlossDiv": {
"GlossList": {
"GlossEntry": {
"Abbrev": "ISO 8879:1986",
"Acronym": "SGML",
"GlossDef": {
"GlossSeeAlso": [
"GML",
"XML"
],
"para": "A meta-markup language, used to create markup languages such as DocBook."
},
"GlossSee": "markup",
"GlossTerm": "Standard Generalized Markup Language",
"ID": "SGML",
"SortAs": "SGML"
}
},
"title": "S"
},
"title": "example glossary"
}
}
11 changes: 11 additions & 0 deletions Tests/Data/comparatorsort/json.org/b/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
22 changes: 22 additions & 0 deletions Tests/Data/comparatorsort/json.org/b/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"menu": {
"id": "file",
"popup": {
"menuitem": [
{
"onclick": "CreateNewDoc()",
"value": "New"
},
{
"onclick": "OpenDoc()",
"value": "Open"
},
{
"onclick": "CloseDoc()",
"value": "Close"
}
]
},
"value": "File"
}
}
26 changes: 26 additions & 0 deletions Tests/Data/comparatorsort/json.org/c/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}}
28 changes: 28 additions & 0 deletions Tests/Data/comparatorsort/json.org/c/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"widget": {
"debug": "on",
"image": {
"alignment": "center",
"hOffset": 250,
"name": "sun1",
"src": "Images/Sun.png",
"vOffset": 250
},
"text": {
"alignment": "center",
"data": "Click Here",
"hOffset": 250,
"name": "text1",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;",
"size": 36,
"style": "bold",
"vOffset": 100
},
"window": {
"height": 500,
"name": "main_window",
"title": "Sample Konfabulator Widget",
"width": 500
}
}
}
88 changes: 88 additions & 0 deletions Tests/Data/comparatorsort/json.org/d/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{"web-app": {
"servlet": [
{
"servlet-name": "cofaxCDS",
"servlet-class": "org.cofax.cds.CDSServlet",
"init-param": {
"configGlossary:installationAt": "Philadelphia, PA",
"configGlossary:adminEmail": "ksm@pobox.com",
"configGlossary:poweredBy": "Cofax",
"configGlossary:poweredByIcon": "/images/cofax.gif",
"configGlossary:staticPath": "/content/static",
"templateProcessorClass": "org.cofax.WysiwygTemplate",
"templateLoaderClass": "org.cofax.FilesTemplateLoader",
"templatePath": "templates",
"templateOverridePath": "",
"defaultListTemplate": "listTemplate.htm",
"defaultFileTemplate": "articleTemplate.htm",
"useJSP": false,
"jspListTemplate": "listTemplate.jsp",
"jspFileTemplate": "articleTemplate.jsp",
"cachePackageTagsTrack": 200,
"cachePackageTagsStore": 200,
"cachePackageTagsRefresh": 60,
"cacheTemplatesTrack": 100,
"cacheTemplatesStore": 50,
"cacheTemplatesRefresh": 15,
"cachePagesTrack": 200,
"cachePagesStore": 100,
"cachePagesRefresh": 10,
"cachePagesDirtyRead": 10,
"searchEngineListTemplate": "forSearchEnginesList.htm",
"searchEngineFileTemplate": "forSearchEngines.htm",
"searchEngineRobotsDb": "WEB-INF/robots.db",
"useDataStore": true,
"dataStoreClass": "org.cofax.SqlDataStore",
"redirectionClass": "org.cofax.SqlRedirection",
"dataStoreName": "cofax",
"dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
"dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
"dataStoreUser": "sa",
"dataStorePassword": "dataStoreTestQuery",
"dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
"dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
"dataStoreInitConns": 10,
"dataStoreMaxConns": 100,
"dataStoreConnUsageLimit": 100,
"dataStoreLogLevel": "debug",
"maxUrlLength": 500}},
{
"servlet-name": "cofaxEmail",
"servlet-class": "org.cofax.cds.EmailServlet",
"init-param": {
"mailHost": "mail1",
"mailHostOverride": "mail2"}},
{
"servlet-name": "cofaxAdmin",
"servlet-class": "org.cofax.cds.AdminServlet"},

{
"servlet-name": "fileServlet",
"servlet-class": "org.cofax.cds.FileServlet"},
{
"servlet-name": "cofaxTools",
"servlet-class": "org.cofax.cms.CofaxToolsServlet",
"init-param": {
"templatePath": "toolstemplates/",
"log": 1,
"logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
"logMaxSize": "",
"dataLog": 1,
"dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
"dataLogMaxSize": "",
"removePageCache": "/content/admin/remove?cache=pages&id=",
"removeTemplateCache": "/content/admin/remove?cache=templates&id=",
"fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
"lookInContext": 1,
"adminGroupID": 4,
"betaServer": true}}],
"servlet-mapping": {
"cofaxCDS": "/",
"cofaxEmail": "/cofaxutil/aemail/*",
"cofaxAdmin": "/admin/*",
"fileServlet": "/static/*",
"cofaxTools": "/tools/*"},

"taglib": {
"taglib-uri": "cofax.tld",
"taglib-location": "/WEB-INF/tlds/cofax.tld"}}}
100 changes: 100 additions & 0 deletions Tests/Data/comparatorsort/json.org/d/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"web-app": {
"servlet": [
{
"init-param": {
"cachePackageTagsRefresh": 60,
"cachePackageTagsStore": 200,
"cachePackageTagsTrack": 200,
"cachePagesDirtyRead": 10,
"cachePagesRefresh": 10,
"cachePagesStore": 100,
"cachePagesTrack": 200,
"cacheTemplatesRefresh": 15,
"cacheTemplatesStore": 50,
"cacheTemplatesTrack": 100,
"configGlossary:adminEmail": "ksm@pobox.com",
"configGlossary:installationAt": "Philadelphia, PA",
"configGlossary:poweredBy": "Cofax",
"configGlossary:poweredByIcon": "/images/cofax.gif",
"configGlossary:staticPath": "/content/static",
"dataStoreClass": "org.cofax.SqlDataStore",
"dataStoreConnUsageLimit": 100,
"dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
"dataStoreInitConns": 10,
"dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
"dataStoreLogLevel": "debug",
"dataStoreMaxConns": 100,
"dataStoreName": "cofax",
"dataStorePassword": "dataStoreTestQuery",
"dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
"dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
"dataStoreUser": "sa",
"defaultFileTemplate": "articleTemplate.htm",
"defaultListTemplate": "listTemplate.htm",
"jspFileTemplate": "articleTemplate.jsp",
"jspListTemplate": "listTemplate.jsp",
"maxUrlLength": 500,
"redirectionClass": "org.cofax.SqlRedirection",
"searchEngineFileTemplate": "forSearchEngines.htm",
"searchEngineListTemplate": "forSearchEnginesList.htm",
"searchEngineRobotsDb": "WEB-INF/robots.db",
"templateLoaderClass": "org.cofax.FilesTemplateLoader",
"templateOverridePath": "",
"templatePath": "templates",
"templateProcessorClass": "org.cofax.WysiwygTemplate",
"useDataStore": true,
"useJSP": false
},
"servlet-class": "org.cofax.cds.CDSServlet",
"servlet-name": "cofaxCDS"
},
{
"init-param": {
"mailHost": "mail1",
"mailHostOverride": "mail2"
},
"servlet-class": "org.cofax.cds.EmailServlet",
"servlet-name": "cofaxEmail"
},
{
"servlet-class": "org.cofax.cds.AdminServlet",
"servlet-name": "cofaxAdmin"
},
{
"servlet-class": "org.cofax.cds.FileServlet",
"servlet-name": "fileServlet"
},
{
"init-param": {
"adminGroupID": 4,
"betaServer": true,
"dataLog": 1,
"dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
"dataLogMaxSize": "",
"fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
"log": 1,
"logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
"logMaxSize": "",
"lookInContext": 1,
"removePageCache": "/content/admin/remove?cache=pages&id=",
"removeTemplateCache": "/content/admin/remove?cache=templates&id=",
"templatePath": "toolstemplates/"
},
"servlet-class": "org.cofax.cms.CofaxToolsServlet",
"servlet-name": "cofaxTools"
}
],
"servlet-mapping": {
"cofaxAdmin": "/admin/*",
"cofaxCDS": "/",
"cofaxEmail": "/cofaxutil/aemail/*",
"cofaxTools": "/tools/*",
"fileServlet": "/static/*"
},
"taglib": {
"taglib-location": "/WEB-INF/tlds/cofax.tld",
"taglib-uri": "cofax.tld"
}
}
}
Loading

0 comments on commit a911b10

Please sign in to comment.