Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-12-05 17:51:51 -0500
committerChristopher Frost2012-12-05 17:51:51 -0500
commit9a25b2989f08cb3eb7b6d9805fe09b5578160888 (patch)
treed1809b0f3ce023e3d31c7892f9c952c924224cd8 /org.eclipse.virgo.management.console
parent7c7177245bc3f834d5d07887894f6c611a5c8c73 (diff)
downloadorg.eclipse.virgo.kernel-9a25b2989f08cb3eb7b6d9805fe09b5578160888.tar.gz
org.eclipse.virgo.kernel-9a25b2989f08cb3eb7b6d9805fe09b5578160888.tar.xz
org.eclipse.virgo.kernel-9a25b2989f08cb3eb7b6d9805fe09b5578160888.zip
Fixing up the tests
Diffstat (limited to 'org.eclipse.virgo.management.console')
-rw-r--r--org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ArtifactsJSTests.java23
-rw-r--r--org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/types/Element.java3
2 files changed, 19 insertions, 7 deletions
diff --git a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ArtifactsJSTests.java b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ArtifactsJSTests.java
index 50ea6774..7217ce1a 100644
--- a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ArtifactsJSTests.java
+++ b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ArtifactsJSTests.java
@@ -82,7 +82,7 @@ public class ArtifactsJSTests extends AbstractJSTests {
public void testTreeTopLevelTwisty() throws IOException {
commonUtil.clean();
ScriptableObject tree = (ScriptableObject) scope.get("tree", scope);
- ScriptableObject.callMethod(tree, "renderTopLevel", new Object[]{getTestEventData()});
+ ScriptableObject.callMethod(tree, "nodeTwistyClicked", new Object[]{getTestTopLevelEventData()});
assertEquals("<li />", Dollar.getDollarLookup());
assertEquals("search/org.eclipse.virgo.kernel:type=ArtifactModel,*", commonUtil.getLastQuery());
}
@@ -91,7 +91,7 @@ public class ArtifactsJSTests extends AbstractJSTests {
public void testTreeTwisty() throws IOException {
commonUtil.clean();
ScriptableObject tree = (ScriptableObject) scope.get("tree", scope);
- ScriptableObject.callMethod(tree, "renderArtifact", new Object[]{getTestEventData()});
+ ScriptableObject.callMethod(tree, "nodeTwistyClicked", new Object[]{getTestOtherLevelEventData()});
assertEquals("<li />", Dollar.getDollarLookup());
assertEquals("read/objectName", commonUtil.getLastQuery());
}
@@ -104,14 +104,23 @@ public class ArtifactsJSTests extends AbstractJSTests {
return testData.construct(context, scope, Context.emptyArgs);
}
- private Scriptable getTestEventData() throws IOException{
+ private Scriptable getTestTopLevelEventData() throws IOException{
readString( "var TestEventData = function() {" +
" this.data = {};" +
" this.data.node = new Element('node');" +
- " this.data.filter = {};" +
- " this.data.objectName = {};" +
- " this.data.objectName.toString = 'objectName';" +
- " this.data.node.length = 1" +
+ " this.data.node.addClass('top-level');" +
+ " this.data.queryData = {};" +
+ "};");
+ Function testData = (Function) scope.get("TestEventData", scope);
+ return testData.construct(context, scope, Context.emptyArgs);
+ }
+
+ private Scriptable getTestOtherLevelEventData() throws IOException{
+ readString( "var TestEventData = function() {" +
+ " this.data = {};" +
+ " this.data.node = new Element('node');" +
+ " this.data.queryData = {};" +
+ " this.data.queryData.toString = 'objectName';" +
"};");
Function testData = (Function) scope.get("TestEventData", scope);
return testData.construct(context, scope, Context.emptyArgs);
diff --git a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/types/Element.java b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/types/Element.java
index 9e45dd0e..0455af9a 100644
--- a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/types/Element.java
+++ b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/types/Element.java
@@ -105,6 +105,9 @@ public class Element extends ParentStub {
public void jsFunction_prop(String prop){
}
+
+ public void jsFunction_data(String name, String value){
+ }
public void jsFunction_click() {
CLICK_COUNT++;

Back to the top