Rename js test class to be picked up by build
* Our maven build is configured to run all tests that follow the
pattern *_Test.
* JasmineTestRunner does not need to be a @Rule anymore.
diff --git a/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggestJs_Test.java b/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggestJs_Test.java
new file mode 100644
index 0000000..7b012a1
--- /dev/null
+++ b/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggestJs_Test.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2013 EclipseSource and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * EclipseSource - initial API and implementation
+ ******************************************************************************/
+package jasmine;
+
+import org.eclipse.rap.clientscripting.ClientListener;
+import org.eclipse.rap.jstestrunner.jasmine.JasmineTestRunner;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class AutoSuggestJs_Test {
+
+ private static final ClassLoader LOCAL = AutoSuggestJs_Test.class.getClassLoader();
+ private static final ClassLoader CLIENTSCRIPTING = ClientListener.class.getClassLoader();
+ private static final String AUTO_SUGGEST_JS
+ = "org/eclipse/rap/addons/autosuggest/internal/resources/AutoSuggest.js";
+
+ private JasmineTestRunner jasmine;
+
+ @Before
+ public void setUp() {
+ jasmine = new JasmineTestRunner();
+ jasmine.parseScript( LOCAL, "jasmine/fixture/rap-mock.js" );
+ jasmine.parseScript( LOCAL, "jasmine/fixture/rwt-mock.js" );
+ jasmine.parseScript( LOCAL, "rwt/remote/Model.js" );
+ }
+
+ @Test
+ public void testModelSpec() {
+ jasmine.parseScript( LOCAL, "jasmine/specs/ModelSpec.js" );
+ jasmine.execute();
+ }
+
+ @Test
+ public void testListenerSpec() {
+ jasmine.addResource( "AutoSuggest.js", LOCAL, AUTO_SUGGEST_JS );
+ jasmine.parseScript( CLIENTSCRIPTING, "org/eclipse/rap/clientscripting/SWT.js" );
+ jasmine.parseScript( CLIENTSCRIPTING, "org/eclipse/rap/clientscripting/Function.js" );
+ jasmine.parseScript( LOCAL, "jasmine/specs/AutoSuggestSpec.js" );
+ jasmine.execute();
+ }
+
+}
diff --git a/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggest_JsTest.java b/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggest_JsTest.java
deleted file mode 100644
index c87b341..0000000
--- a/tests/org.eclipse.rap.addons.autosuggest.test/jasmine/jasmine/AutoSuggest_JsTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 EclipseSource and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * EclipseSource - initial API and implementation
- ******************************************************************************/
-package jasmine;
-
-import org.eclipse.rap.clientscripting.ClientListener;
-import org.eclipse.rap.jstestrunner.jasmine.JasmineTestRunner;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-
-public class AutoSuggest_JsTest {
-
- private static final String AUTO_SUGGEST_JS
- = "org/eclipse/rap/addons/autosuggest/internal/resources/AutoSuggest.js";
- private static final ClassLoader LOCAL_LOADER = AutoSuggest_JsTest.class.getClassLoader();
- private static final ClassLoader SCRIPTING_LOADER = ClientListener.class.getClassLoader();
-
- @Rule
- public JasmineTestRunner jasmine = new JasmineTestRunner();
-
- @Before
- public void setUp() {
- jasmine.parseScript( LOCAL_LOADER, "jasmine/fixture/rap-mock.js" );
- jasmine.parseScript( LOCAL_LOADER, "jasmine/fixture/rwt-mock.js" );
- jasmine.parseScript( LOCAL_LOADER, "rwt/remote/Model.js" );
- }
-
- @Test
- public void testModelSpec() {
- jasmine.parseScript( LOCAL_LOADER, "jasmine/specs/ModelSpec.js" );
- jasmine.execute();
- }
-
- @Test
- public void testListenerSpec() {
- jasmine.parseScript( LOCAL_LOADER, "jasmine/specs/AutoSuggestSpec.js" );
- jasmine.parseScript( SCRIPTING_LOADER, "org/eclipse/rap/clientscripting/SWT.js" );
- jasmine.parseScript( SCRIPTING_LOADER, "org/eclipse/rap/clientscripting/Function.js" );
- jasmine.addResource( "AutoSuggest.js", LOCAL_LOADER, AUTO_SUGGEST_JS );
- jasmine.execute();
- }
-
-}
diff --git a/tests/org.eclipse.rap.jstestrunner/src/org/eclipse/rap/jstestrunner/jasmine/JasmineTestRunner.java b/tests/org.eclipse.rap.jstestrunner/src/org/eclipse/rap/jstestrunner/jasmine/JasmineTestRunner.java
index 22474e9..197ea83 100644
--- a/tests/org.eclipse.rap.jstestrunner/src/org/eclipse/rap/jstestrunner/jasmine/JasmineTestRunner.java
+++ b/tests/org.eclipse.rap.jstestrunner/src/org/eclipse/rap/jstestrunner/jasmine/JasmineTestRunner.java
@@ -12,13 +12,10 @@
import static org.junit.Assert.fail;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
import org.mozilla.javascript.ScriptableObject;
-public class JasmineTestRunner implements TestRule {
+public class JasmineTestRunner {
private final JasmineRunner jasmine;
private final JasmineJUnitReporter reporter;
@@ -48,23 +45,4 @@
}
}
- public Statement apply( Statement base, Description description ) {
- return base;
- }
-
- class JasmineStatement extends Statement {
-
- private final Statement base;
-
- public JasmineStatement( Statement base ) {
- this.base = base;
- }
-
- @Override
- public void evaluate() throws Throwable {
- base.evaluate();
- }
-
- }
-
}