Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2015-06-01 14:27:13 -0400
committerFlorian Waibel2015-06-01 14:27:13 -0400
commitd4f1949c92ceda081d99b638d03ae6360a7d056c (patch)
treef408037ed8a2f5d045fa6116a29894148273317f
parenteaaebb687d0ef2d0da523e8b91cc74e9af36745f (diff)
downloadorg.eclipse.virgo.kernel-d4f1949c92ceda081d99b638d03ae6360a7d056c.tar.gz
org.eclipse.virgo.kernel-d4f1949c92ceda081d99b638d03ae6360a7d056c.tar.xz
org.eclipse.virgo.kernel-d4f1949c92ceda081d99b638d03ae6360a7d056c.zip
Removes unused field in stub
-rw-r--r--org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ConfigurationsJSTests.java134
-rw-r--r--org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/objects/ObjectName.java48
2 files changed, 83 insertions, 99 deletions
diff --git a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ConfigurationsJSTests.java b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ConfigurationsJSTests.java
index d28715eb..8d018917 100644
--- a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ConfigurationsJSTests.java
+++ b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/ConfigurationsJSTests.java
@@ -8,6 +8,7 @@
* Contributors:
* VMware Inc. - initial contribution
*******************************************************************************/
+
package org.eclipse.virgo.management.console;
import static org.junit.Assert.assertFalse;
@@ -28,77 +29,66 @@ import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.Scriptable;
-/**
- *
- *
- */
public class ConfigurationsJSTests extends AbstractJSTests {
-
- /**
- * Test that the init script for the page reports back that the page is ready for display
- *
- * @throws ScriptException
- * @throws IOException
- * @throws NoSuchMethodException
- */
- @Before
- public void setUpConfigurationsJS() throws ScriptException, IOException, NoSuchMethodException{
- addCommonObjects();
- readFile("src/main/webapp/js/configurations.js");
-
- invokePageInit();
- assertNotNull(commonUtil.getLastQueryCallBack());
-
- commonUtil.getLastQueryCallBack().call(context, scope, scope, new Object[]{getTestData()});
- assertTrue("Page ready has not been called", commonUtil.isPageReady());
- }
-
- /**
- * Tests that the css class applied to the twisty changes from plus to minus as toggle is called.
- * @throws IOException
- *
- */
- @Test
- public void testConfigToggle() throws IOException {
- Function configurationConstructor = (Function) scope.get("Configuration", scope);
-
- HashMap<String, String> properties = new HashMap<String, String>();
- properties.put("name", "testName");
- ObjectName value = new ObjectName("domain", "objectNameString", properties);
-
- Scriptable labelElement = ((Function) scope.get("Element", scope)).construct(context, scope, new Object[]{"<div />"});
- Scriptable configuration = configurationConstructor.construct(context, scope, new Object[]{Context.javaToJS(value, scope), labelElement});
-
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("plus"));
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("minus"));
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
-
- Function toggleFunction = (Function) configuration.get("toggle", scope);
- toggleFunction.call(context, scope, configuration, Context.emptyArgs); //Close it
- assertTrue("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("plus"));
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("minus"));
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
-
- toggleFunction.call(context, scope, configuration, Context.emptyArgs); //Open it
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("plus"));
- assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("minus"));
- assertTrue("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
-
- //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"));
- //assertFalse("Icon not toggled", ((Element)configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
- }
-
- private Scriptable getTestData() throws IOException{
-
- readString( "var Data = function() {" +
- " this.value = {};" +
- " this.value.Value = {};" +
- "};");
-
- Function testData = (Function) scope.get("Data", scope);
- return testData.construct(context, scope, Context.emptyArgs);
- }
-
+
+ /**
+ * Test that the init script for the page reports back that the page is ready for display
+ *
+ * @throws ScriptException
+ * @throws IOException
+ * @throws NoSuchMethodException
+ */
+ @Before
+ public void setUpConfigurationsJS() throws ScriptException, IOException, NoSuchMethodException {
+ addCommonObjects();
+ readFile("src/main/webapp/js/configurations.js");
+
+ invokePageInit();
+ assertNotNull(commonUtil.getLastQueryCallBack());
+
+ commonUtil.getLastQueryCallBack().call(context, scope, scope, new Object[] { getTestData() });
+ assertTrue("Page ready has not been called", commonUtil.isPageReady());
+ }
+
+ /**
+ * Tests that the css class applied to the twisty changes from plus to minus as toggle is called.
+ *
+ * @throws IOException
+ *
+ */
+ @Test
+ public void testConfigToggle() throws IOException {
+ Function configurationConstructor = (Function) scope.get("Configuration", scope);
+
+ HashMap<String, String> properties = new HashMap<String, String>();
+ properties.put("name", "testName");
+ ObjectName value = new ObjectName("domain", properties);
+
+ Scriptable labelElement = ((Function) scope.get("Element", scope)).construct(context, scope, new Object[] { "<div />" });
+ Scriptable configuration = configurationConstructor.construct(context, scope, new Object[] { Context.javaToJS(value, scope), labelElement });
+
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("plus"));
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("minus"));
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
+
+ Function toggleFunction = (Function) configuration.get("toggle", scope);
+ toggleFunction.call(context, scope, configuration, Context.emptyArgs); // Close it
+ assertTrue("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("plus"));
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("minus"));
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
+
+ toggleFunction.call(context, scope, configuration, Context.emptyArgs); // Open it
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("plus"));
+ assertFalse("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("minus"));
+ assertTrue("Icon not toggled", ((Element) configuration.get("icon", scope)).jsFunction_hasClass("spinnerIcon"));
+ }
+
+ private Scriptable getTestData() throws IOException {
+
+ readString("var Data = function() { this.value = {}; this.value.Value = {}; };");
+
+ Function testData = (Function) scope.get("Data", 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/objects/ObjectName.java b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/objects/ObjectName.java
index 4ef65519..904301b1 100644
--- a/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/objects/ObjectName.java
+++ b/org.eclipse.virgo.management.console/src/test/java/org/eclipse/virgo/management/console/stubs/objects/ObjectName.java
@@ -8,36 +8,30 @@
* Contributors:
* VMware Inc. - initial contribution
*******************************************************************************/
+
package org.eclipse.virgo.management.console.stubs.objects;
import java.util.Map;
-/**
- *
- *
- */
public class ObjectName {
-
- private final String domain;
-
- private final Map<String, String> properties;
-
- public String toString;
-
- public ObjectName(String domain, String objectNameString, Map<String, String> properties) {
- this.domain = domain;
- this.toString = objectNameString;
- this.properties = properties;
- }
-
- // Stub methods
-
- public String get(String property){
- return this.properties.get(property);
- }
-
- public String domain(){
- return domain;
- }
-
+
+ private final String domain;
+
+ private final Map<String, String> properties;
+
+ public ObjectName(String domain, Map<String, String> properties) {
+ this.domain = domain;
+ this.properties = properties;
+ }
+
+ // Stub methods
+
+ public String get(String property) {
+ return this.properties.get(property);
+ }
+
+ public String domain() {
+ return domain;
+ }
+
}

Back to the top