Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Updated testing documentation, refactored TestCases to Tests

Mike McGann4235fe6edb2e
diff --git a/doc/NaturalDocs/Menu.txt b/doc/NaturalDocs/Menu.txt
index d9c439ef4..47c370ff5 100644
--- a/doc/NaturalDocs/Menu.txt
+++ b/doc/NaturalDocs/Menu.txt
@@ -104,7 +104,7 @@ Group: Code Reference {
Group: TestSuite {
File: Patcher (no auto-title, /Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite/Patcher.js)
- File: TestCases (no auto-title, /Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite/TestCases.js)
+ File: Tests (/Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite/Tests.js)
} # Group: TestSuite
} # Group: Code Reference
diff --git a/doc/NaturalDocs/Menu.txt.bak b/doc/NaturalDocs/Menu.txt.bak
deleted file mode 100644
index 9f1df9266..000000000
--- a/doc/NaturalDocs/Menu.txt.bak
+++ /dev/null
@@ -1,115 +0,0 @@
-Format: 1.52
-
-
-Title: Worldview
-
-# You can also add a sub-title to your menu like this:
-# SubTitle: [subtitle]
-
-# You can add a footer to your documentation like this:
-# Footer: [text]
-# If you want to add a copyright notice, this would be the place to do it.
-Timestamp: Updated mm/dd/yyyy
-# m - One or two digit month. January is "1"
-# mm - Always two digit month. January is "01"
-# mon - Short month word. January is "Jan"
-# month - Long month word. January is "January"
-# d - One or two digit day. 1 is "1"
-# dd - Always two digit day. 1 is "01"
-# day - Day with letter extension. 1 is "1st"
-# yy - Two digit year. 2006 is "06"
-# yyyy - Four digit year. 2006 is "2006"
-# year - Four digit year. 2006 is "2006"
-
-
-# --------------------------------------------------------------------------
-#
-# Cut and paste the lines below to change the order in which your files
-# appear on the menu. Don't worry about adding or removing files, Natural
-# Docs will take care of that.
-#
-# You can further organize the menu by grouping the entries. Add a
-# "Group: [name] {" line to start a group, and add a "}" to end it.
-#
-# You can add text and web links to the menu by adding "Text: [text]" and
-# "Link: [name] ([URL])" lines, respectively.
-#
-# The formatting and comments are auto-generated, so don't worry about
-# neatness when editing the file. Natural Docs will clean it up the next
-# time it is run. When working with groups, just deal with the braces and
-# forget about the indentation and comments.
-#
-# You can use this file on other computers even if they use different
-# directories. As long as the command line points to the same source files,
-# Natural Docs will be able to correct the locations automatically.
-#
-# --------------------------------------------------------------------------
-
-
-Group: Development Notes {
-
- File: Documentation (/Users/jmcgann/Code/Aptana/worldview/doc/Topics/Documentation.txt)
- File: Testing (/Users/jmcgann/Code/Aptana/worldview/doc/Topics/Testing.txt)
- } # Group: Development Notes
-
-Group: Code Reference {
-
- File: Logging (/Users/jmcgann/Code/Aptana/worldview/js/Logging.js)
- File: OpenLayers.Tile.Canvas (/Users/jmcgann/Code/Aptana/worldview/js/OpenLayers/Tile/Canvas.js)
- File: SOTE.util (/Users/jmcgann/Code/Aptana/worldview/js/util.js)
- File: Worldview (/Users/jmcgann/Code/Aptana/worldview/js/Worldview.js)
-
- Group: Worldview {
-
- File: OpenLayers (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/OpenLayers.js)
- File: OpenLayers.DailyProduct (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/OpenLayers/DailyProduct.js)
- File: OpenLayers.ProductMap (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/OpenLayers/ProductMap.js)
- File: OpenLayers.StaticProduct (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/OpenLayers/StaticProduct.js)
- File: Visual (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual.js)
-
- Group: JSON {
-
- File: MapConfig (/Users/jmcgann/Code/Aptana/worldview/doc/Topics/Worldview/JSON/MapConfig.txt)
-
- Group: MapConfig {
-
- File: Product (/Users/jmcgann/Code/Aptana/worldview/doc/Topics/Worldview/JSON/MapConfig/Product.txt)
- File: Projection (no auto-title, /Users/jmcgann/Code/Aptana/worldview/doc/Topics/Worldview/JSON/MapConfig/Projection.txt)
- } # Group: MapConfig
-
- } # Group: JSON
-
- Group: Visual {
-
- File: ColorBar (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/ColorBar.js)
- File: ColorHSL (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/ColorHSL.js)
- File: ColorRGBA (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/ColorRGBA.js)
- File: Lookup (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/Lookup.js)
- File: Palette (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/Palette.js)
- File: PaletteSelector (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/PaletteSelector.js)
- File: StopRGBA (/Users/jmcgann/Code/Aptana/worldview/js/Worldview/Visual/StopRGBA.js)
- } # Group: Visual
-
- } # Group: Worldview
-
- } # Group: Code Reference
-
-File: TestSuite (/Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite.js)
-File: TestSuite.Patcher (/Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite/Patcher.js)
-File: TestSuite.TestCases (/Users/jmcgann/Code/Aptana/worldview/test/lib/TestSuite/TestCases.js)
-
-Group: Index {
-
- Index: Everything
- Class Index: Classes
- Function Index: Functions
- Property Index: Properties
- Constant Index: Constants
- } # Group: Index
-
-
-
-##### Do not change or remove these lines. #####
-Data: 1(D3333a6GH63lE9`p\\30ufG3KItp\p37uHof/8G73l6)
-Data: 1(h3333a6GH63lE9`p\\30ufG3KItp\p37uHof/8G73fu93LuI896)
-Data: 1(T3333a6GH63lE9`p\\30ufG3KItp\p37uHof/8G73tG6t3o8Y)
diff --git a/doc/NaturalDocs/worldview.css b/doc/NaturalDocs/worldview.css
index 9638b8623..5f46d2e02 100644
--- a/doc/NaturalDocs/worldview.css
+++ b/doc/NaturalDocs/worldview.css
@@ -10,3 +10,22 @@ p {
.ContentPage .Firefox #Content {
margin-left: 35ex;
}
+
+/* Copied from the OpenLayers css file */
+
+.MGroup {
+ font-variant: normal;
+ margin: 0.4em 0 0em 10px
+}
+
+.MTitle {
+ font-variant: normal;
+}
+
+.CGroup .CTitle {
+ font-variant: normal;
+}
+
+.SGroup .SEntry {
+ font-variant: normal;
+}
diff --git a/doc/Topics/Testing.txt b/doc/Topics/Testing.txt
index 68ad5f028..3fa8aadcf 100644
--- a/doc/Topics/Testing.txt
+++ b/doc/Topics/Testing.txt
@@ -36,5 +36,23 @@ Now run the test entire unit test suite with the following
> ant test
+To run a single test case, invoke the test-one target and pass in a test
+parameter with the name of the test to run. For example, to run the Foo test
+use the following
+
+> ant -Dtest=Foo test-one
+
+The names for test cases are hierarchical. If there are two tests named Foo.Bar
+and Foo.Baz, specifying to run the "Foo" test will run both.
+
+Group: Writing
+
+Writing unit tests is fairly straightforward and follows the xUnit conventions.
+The <JsTestDriver at http://code.google.com/p/js-test-driver> web site
+provides everything needed to write tests.
+
+Patching code can be used with the <TestSuite.Patcher> object. Be sure to also use
+<TestSuite.Tests> to ensure patching is undone in tearDown.
+
diff --git a/test/Worldview/Map/testDailyProduct.js b/test/Worldview/Map/testDailyProduct.js
index 2709b1d26..b93ba64af 100644
--- a/test/Worldview/Map/testDailyProduct.js
+++ b/test/Worldview/Map/testDailyProduct.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Map.DailyProduct", TestSuite.TestCases({
+TestCase("Map.DailyProduct", TestSuite.Tests({
ns: null,
patcher: null,
diff --git a/test/Worldview/Map/testProductMap.js b/test/Worldview/Map/testProductMap.js
index edb8ef3bc..17e349bec 100644
--- a/test/Worldview/Map/testProductMap.js
+++ b/test/Worldview/Map/testProductMap.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Map.ProductMap", TestSuite.TestCases({
+TestCase("Map.ProductMap", TestSuite.Tests({
ns: null,
patcher: null,
diff --git a/test/Worldview/TestSuite/testTestCases.js b/test/Worldview/TestSuite/testTestCases.js
index 0123ee01c..8a1a572d3 100644
--- a/test/Worldview/TestSuite/testTestCases.js
+++ b/test/Worldview/TestSuite/testTestCases.js
@@ -9,12 +9,12 @@
* All Rights Reserved.
*/
-TestCase("TestSuite.TestCases", {
+TestCase("TestSuite.Tests", {
// Check that the setUp call is properly passed through
testSetupCalled: function() {
var called = false;
- var tc = TestSuite.TestCases({
+ var tc = TestSuite.Tests({
setUp: function() {
called = true;
}
@@ -26,7 +26,7 @@ TestCase("TestSuite.TestCases", {
// Check that the tearDown call is properly passed through
testTearDownCalled: function() {
var called = false;
- var tc = TestSuite.TestCases({
+ var tc = TestSuite.Tests({
tearDown: function() {
called = true;
}
@@ -38,7 +38,7 @@ TestCase("TestSuite.TestCases", {
// Check that the test call is properly passed through
testTestCalled: function() {
var called = false;
- var tc = TestSuite.TestCases({
+ var tc = TestSuite.Tests({
testSomething: function() {
called = true;
}
@@ -52,7 +52,7 @@ TestCase("TestSuite.TestCases", {
// called
testTearDownCalledOnError: function() {
var called = false;
- var tc = TestSuite.TestCases({
+ var tc = TestSuite.Tests({
tearDown: function() {
called = true;
},
diff --git a/test/Worldview/Widget/testMap.js b/test/Worldview/Widget/testMap.js
index 5b79ad92b..0d7ba884e 100644
--- a/test/Worldview/Widget/testMap.js
+++ b/test/Worldview/Widget/testMap.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Widget.Map", TestSuite.TestCases({
+TestCase("Widget.Map", TestSuite.Tests({
ns: null,
diff --git a/test/Worldview/testPermalink.js b/test/Worldview/testPermalink.js
index 31acf7eec..5b947e216 100644
--- a/test/Worldview/testPermalink.js
+++ b/test/Worldview/testPermalink.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Permalink.fromObject", TestSuite.TestCases({
+TestCase("Permalink.fromObject", TestSuite.Tests({
ns: null,
@@ -37,7 +37,7 @@ TestCase("Permalink.fromObject", TestSuite.TestCases({
}));
-TestCase("Permalink.fromRegistry", TestSuite.TestCases({
+TestCase("Permalink.fromRegistry", TestSuite.Tests({
ns: null,
patcher: null,
@@ -75,7 +75,7 @@ TestCase("Permalink.fromRegistry", TestSuite.TestCases({
}));
-TestCase("Permalink.decode", TestSuite.TestCases({
+TestCase("Permalink.decode", TestSuite.Tests({
ns: null,
diff --git a/test/testLogging.js b/test/testLogging.js
index 399b1caae..f25353b07 100644
--- a/test/testLogging.js
+++ b/test/testLogging.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Logging.standard", TestSuite.TestCases({
+TestCase("Logging.standard", TestSuite.Tests({
patcher: null,
mockConsole: null,
@@ -109,7 +109,7 @@ TestCase("Logging.standard", TestSuite.TestCases({
}));
-TestCase("Logging.noConsole", TestSuite.TestCases({
+TestCase("Logging.noConsole", TestSuite.Tests({
patcher: null,
@@ -133,7 +133,7 @@ TestCase("Logging.noConsole", TestSuite.TestCases({
}));
-TestCase("Logging.onlyLog", TestSuite.TestCases({
+TestCase("Logging.onlyLog", TestSuite.Tests({
patcher: null,
mockLog: null,
diff --git a/test/testWorldview.js b/test/testWorldview.js
index cdff2149d..325f99872 100644
--- a/test/testWorldview.js
+++ b/test/testWorldview.js
@@ -9,7 +9,7 @@
* All Rights Reserved.
*/
-TestCase("Worldview.general", TestSuite.TestCases({
+TestCase("Worldview.general", TestSuite.Tests({
testToISODateString: function() {
assertEquals("2013-03-15",
@@ -18,7 +18,7 @@ TestCase("Worldview.general", TestSuite.TestCases({
}));
-TestCase("Worldview.namespace", TestSuite.TestCases({
+TestCase("Worldview.namespace", TestSuite.Tests({
tearDown: function() {
if ( Worldview.test) {
@@ -51,7 +51,7 @@ TestCase("Worldview.namespace", TestSuite.TestCases({
}));
-TestCase("Worldview.error", TestSuite.TestCases({
+TestCase("Worldview.error", TestSuite.Tests({
patcher: null,
mockPanel: null,
@@ -105,7 +105,7 @@ TestCase("Worldview.error", TestSuite.TestCases({
}));
-TestCase("Worldview.error.withoutYahoo", TestSuite.TestCases({
+TestCase("Worldview.error.withoutYahoo", TestSuite.Tests({
patcher: null,
@@ -127,7 +127,7 @@ TestCase("Worldview.error.withoutYahoo", TestSuite.TestCases({
}));
-TestCase("Worldview.getObjectByPath", TestSuite.TestCases({
+TestCase("Worldview.getObjectByPath", TestSuite.Tests({
ns: null,