summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-05-03 07:17:42 (EDT)
committer Glyn Normington2012-05-03 08:38:30 (EDT)
commitde7c49effef9e11d2d9712c288648fbe2858feb9 (patch)
tree56d1e319c0a40ce17cc3b8b1d18e1af177de80d8
parent8f8db43abab6d75543f86bb4fe408879d09f6b31 (diff)
downloadorg.eclipse.virgo.apps-de7c49effef9e11d2d9712c288648fbe2858feb9.zip
org.eclipse.virgo.apps-de7c49effef9e11d2d9712c288648fbe2858feb9.tar.gz
org.eclipse.virgo.apps-de7c49effef9e11d2d9712c288648fbe2858feb9.tar.bz2
375319 build fixed and general tidy up abstract super test
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/AbstractJSTests.java4
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ArtifactsJSTests.java9
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ConfigurationJSTests.java3
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/DumpsJSTests.java2
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/LogsJSTests.java2
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/OverviewJSTests.java8
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/RepositoriesJSTests.java10
-rw-r--r--org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/stubs/objects/Util.java2
8 files changed, 17 insertions, 23 deletions
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/AbstractJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/AbstractJSTests.java
index 1bf1013..949817d 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/AbstractJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/AbstractJSTests.java
@@ -44,7 +44,7 @@ public abstract class AbstractJSTests {
protected static String alertMsg;
- protected Util commonUtil = null;
+ protected static Util commonUtil = null;
@BeforeClass
public static void setUp() throws ScriptException, IOException, IllegalAccessException, InstantiationException, InvocationTargetException, SecurityException, NoSuchMethodException{
@@ -91,7 +91,7 @@ public abstract class AbstractJSTests {
}
protected final void addCommonObjects(){
- this.commonUtil = new Util(CONTEXT, SCOPE);
+ commonUtil = new Util(CONTEXT, SCOPE);
addObject(commonUtil, "util");
}
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ArtifactsJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ArtifactsJSTests.java
index 920cbbf..82e4df2 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ArtifactsJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ArtifactsJSTests.java
@@ -19,7 +19,6 @@ import java.io.IOException;
import javax.script.ScriptException;
import org.eclipse.virgo.apps.admin.web.stubs.objects.Dollar;
-import org.junit.BeforeClass;
import org.junit.Test;
import sun.org.mozilla.javascript.internal.Context;
@@ -33,8 +32,8 @@ import sun.org.mozilla.javascript.internal.Scriptable;
public class ArtifactsJSTests extends AbstractJSTests {
- @BeforeClass
- public static void setup(){
+// @BeforeClass
+// public static void setup(){
// Function fObj = (Function) SCOPE.get(Element.class.getSimpleName(), SCOPE);
// if (fObj instanceof Function) {
// Function constructor = (Function)fObj;
@@ -42,7 +41,7 @@ public class ArtifactsJSTests extends AbstractJSTests {
// } else {
// Assert.fail("Element constructor not found");
// }
- }
+// }
@Test
public void testPageinit() throws ScriptException, IOException, NoSuchMethodException{
@@ -53,7 +52,7 @@ public class ArtifactsJSTests extends AbstractJSTests {
assertNotNull(commonUtil.getLastQueryCallBack());
commonUtil.getLastQueryCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[]{this.getTestData(), "type"});
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
@Test
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ConfigurationJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ConfigurationJSTests.java
index 68e45d4..4cf0fa3 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ConfigurationJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/ConfigurationJSTests.java
@@ -48,7 +48,7 @@ public class ConfigurationJSTests extends AbstractJSTests {
assertNotNull(commonUtil.getLastQueryCallBack());
commonUtil.getLastQueryCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[]{getTestData()});
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
/**
@@ -80,7 +80,6 @@ public class ConfigurationJSTests extends AbstractJSTests {
toggleFunction.call(CONTEXT, SCOPE, configuration, Context.emptyArgs); //Open it
assertTrue("Icon not toggled", ((Element)configuration.get("icon", SCOPE)).jsFunction_hasClass("spinnerIcon"));
- //System.out.println("foo " + commonUtil);
commonUtil.getLastQueryCallBack().call(CONTEXT, SCOPE, configuration, new Object[]{getTestData()});
assertFalse("Icon not toggled", ((Element)configuration.get("icon", SCOPE)).jsFunction_hasClass("plus"));
assertTrue("Icon not toggled", ((Element)configuration.get("icon", SCOPE)).jsFunction_hasClass("minus"));
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/DumpsJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/DumpsJSTests.java
index 8af09d0..16e0dbc 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/DumpsJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/DumpsJSTests.java
@@ -53,7 +53,7 @@ public class DumpsJSTests extends AbstractJSTests {
assertTrue(successByUrl.containsKey(DUMPS_URL));
successByUrl.get(DUMPS_URL).call(CONTEXT, SCOPE, SCOPE, new Object[] { getTestDumpList() });
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
private Scriptable getTestDumpDirectory() throws IOException {
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/LogsJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/LogsJSTests.java
index 9720933..ef10761 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/LogsJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/LogsJSTests.java
@@ -31,7 +31,7 @@ public class LogsJSTests extends AbstractJSTests {
invokePageInit();
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
}
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/OverviewJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/OverviewJSTests.java
index d4c4993..93ace24 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/OverviewJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/OverviewJSTests.java
@@ -44,11 +44,11 @@ public class OverviewJSTests extends AbstractJSTests {
callback.call(CONTEXT, SCOPE, SCOPE, new Object[]{TEST_ROW});
assertTrue("Replaced DOM node not looked up", Element.getConstructorArgumentTrace().contains("#server-overview"));
- assertEquals("Wrong replacement DOM node", this.commonUtil.getLastMakeTableTable(), Element.getLastReplacement());
- assertArrayEquals("Wrong table headers", EXPECTED_HEADERS, this.commonUtil.getLastMakeTableHeaders());
- assertArrayEquals("Wrong table rows", TEST_ROW, this.commonUtil.getLastMakeTableRows());
+ assertEquals("Wrong replacement DOM node", commonUtil.getLastMakeTableTable(), Element.getLastReplacement());
+ assertArrayEquals("Wrong table headers", EXPECTED_HEADERS, commonUtil.getLastMakeTableHeaders());
+ assertArrayEquals("Wrong table rows", TEST_ROW, commonUtil.getLastMakeTableRows());
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
}
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/RepositoriesJSTests.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/RepositoriesJSTests.java
index 9822a02..e9601ab 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/RepositoriesJSTests.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/RepositoriesJSTests.java
@@ -49,7 +49,7 @@ public class RepositoriesJSTests extends AbstractJSTests {
Function eachOperation = Dollar.getEachOperation();
eachOperation.call(CONTEXT, SCOPE, SCOPE, new Object[] { 0, "org.eclipse.virgo.kernel:name=usr,type=Repository" });
- assertTrue("Page ready has not been called", this.commonUtil.isPageReady());
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
}
@@ -88,15 +88,13 @@ public class RepositoriesJSTests extends AbstractJSTests {
@Test
public void testDeploy() throws Exception {
- addCommonObjects();
-
Scriptable repositories = (Scriptable) SCOPE.get("Repositories", SCOPE);
Function deployFunction = (Function) repositories.get("deploy", SCOPE);
deployFunction.call(CONTEXT, SCOPE, repositories, new Object[] { "anArtifact" });
- Scriptable lastBulkQuery = this.commonUtil.getLastBulkQuery();
+ Scriptable lastBulkQuery = commonUtil.getLastBulkQuery();
Scriptable[] lastBulkQueryArray = (Scriptable[])Context.jsToJava(lastBulkQuery, Scriptable[].class);
Scriptable argumentsProperty = (Scriptable)ScriptableObject.getProperty(lastBulkQueryArray[0], "arguments");
String[] arguments = (String[])Context.jsToJava(argumentsProperty, String[].class);
@@ -110,10 +108,10 @@ public class RepositoriesJSTests extends AbstractJSTests {
" }" + //
"}];");
Scriptable aResponse = (Scriptable) SCOPE.get("aResponse", SCOPE);
- this.commonUtil.getLastBulkQueryCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[] { aResponse });
+ commonUtil.getLastBulkQueryCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[] { aResponse });
readString("var console = { log : function(xmlHttpRequest, textStatus, errorThrown) {}};");
- this.commonUtil.getLastBulkQueryErrorCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[] { "xmlHttpRequest", "textStatus", "errorThrown" });
+ commonUtil.getLastBulkQueryErrorCallBack().call(CONTEXT, SCOPE, SCOPE, new Object[] { "xmlHttpRequest", "textStatus", "errorThrown" });
}
private Scriptable getDisplayTestData() throws IOException {
diff --git a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/stubs/objects/Util.java b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/stubs/objects/Util.java
index f4cec88..f386388 100644
--- a/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/stubs/objects/Util.java
+++ b/org.eclipse.virgo.apps.admin/src/test/java/org/eclipse/virgo/apps/admin/web/stubs/objects/Util.java
@@ -88,8 +88,6 @@ public class Util {
}
public void doQuery(String query, Function callBack) {
- //System.out.println("query " + query);
- //System.out.println("callBack " + callBack);
this.lastQuery = query;
this.lastQueryCallBack = callBack;
// this.lastQueryErrorCallBack = errorCallBack;