-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added namespace support (binding variable, new category method, cover…
…ed in the tutorial) Upped the release version to 0.4.4 Updated the Javadocs Fixed some a couple typos in the tutorial
- Loading branch information
Showing
45 changed files
with
1,395 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
core/src/test/groovyx/gaelyk/NamespaceCategoryMethodsTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,51 @@ | |||
package groovyx.gaelyk | |||
|
|||
import com.google.appengine.api.NamespaceManager | |||
import com.google.appengine.tools.development.testing.LocalServiceTestHelper | |||
|
|||
/** | |||
* Test the category methods associated with the NamespaceManager class introduced in SDK 1.3.7. | |||
* | |||
* @author Guillaume Laforge | |||
*/ | |||
class NamespaceCategoryMethodsTest extends GroovyTestCase { | |||
|
|||
def namespace = NamespaceManager | |||
|
|||
// setup the local environement so the NamespaceManager is initialized | |||
private LocalServiceTestHelper helper = new LocalServiceTestHelper() | |||
|
|||
protected void setUp() { | |||
super.setUp() | |||
helper.setUp() | |||
} | |||
|
|||
protected void tearDown() { | |||
super.tearDown() | |||
helper.tearDown() | |||
} | |||
|
|||
void testNamespaceOf() { | |||
use(GaelykCategory) { | |||
def oldNs = namespace.get() | |||
boolean executed = false | |||
|
|||
namespace.of("customerA") { | |||
executed = true | |||
assert namespace.get() == "customerA" | |||
} | |||
assert executed | |||
|
|||
def currentNs = namespace.get() | |||
// check that the original namespace is restored | |||
assert oldNs == currentNs | |||
} | |||
} | |||
|
|||
void testAnExceptionIsThrownWhenUsingCategoryMethodWithWrongClass() { | |||
shouldFail(MissingMethodException) { | |||
Integer.of("foo") {} | |||
} | |||
} | |||
|
|||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.