diff --git a/com.rescripter.editor.test/META-INF/MANIFEST.MF b/com.rescripter.editor.test/META-INF/MANIFEST.MF
index 8934184..d06302a 100644
--- a/com.rescripter.editor.test/META-INF/MANIFEST.MF
+++ b/com.rescripter.editor.test/META-INF/MANIFEST.MF
@@ -2,20 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RescripterEditorTests
Bundle-SymbolicName: com.rescripter.editor.test;singleton:=true
+Fragment-Host: com.rescripter.editor
Bundle-Version: 1.0.7.qualifier
Require-Bundle: com.rescripter.jmock,
- com.rescripter.rhino,
- com.rescripter.editor,
- org.eclipse.ui,
- org.eclipse.ui.editors,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jface.text,
- org.eclipse.ui.ide,
- org.eclipse.jdt.core,
- org.eclipse.jdt.ui,
org.junit4
Comment: org.junit must be after jmock, so Hamcrest 1.2 is used instead of 1.1 which comes with JUnit.
-Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ClassPath: .
diff --git a/com.rescripter.editor.test/pom.xml b/com.rescripter.editor.test/pom.xml
index 32b03eb..55724a3 100644
--- a/com.rescripter.editor.test/pom.xml
+++ b/com.rescripter.editor.test/pom.xml
@@ -4,7 +4,7 @@
com.rescripter
- Rescripter
+ com.rescripter.parent
1.0.7-SNAPSHOT
diff --git a/com.rescripter.editor.test/src/integrationtest/com/rescripter/ASTIntegrationTest.java b/com.rescripter.editor.test/src/integrationtest/com/rescripter/ASTIntegrationTest.java
index f76d2c5..e72d6e5 100644
--- a/com.rescripter.editor.test/src/integrationtest/com/rescripter/ASTIntegrationTest.java
+++ b/com.rescripter.editor.test/src/integrationtest/com/rescripter/ASTIntegrationTest.java
@@ -1,93 +1,93 @@
-package com.rescripter;
-
-import static com.rescripter.ASTIntegrationTest.ASTNodeMatcher.a_node;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.MethodInvocation;
-import org.hamcrest.Description;
-import org.hamcrest.Matchers;
-import org.hamcrest.TypeSafeDiagnosingMatcher;
-import org.junit.Test;
-
-import com.rescripter.script.RunScript;
-
-public class ASTIntegrationTest extends BaseRescripterIntegrationTest {
-
- @Test public void
- parses_compilation_unit() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents(
- "var person = Find.typeByName('Person');\n" +
- "var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n", null, "inline script");
-
- ASTNode ast = runScript.getProperty(ASTNode.class, "ast");
-
- assertThat(ast, is(notNullValue()));
- assertThat(ast.toString(), containsString("public class Person"));
- assertThat(ast.toString(), containsString("public Person("));
- }
-
- @SuppressWarnings("unchecked")
- @Test public void
- finds_covered_node() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- String methodCallText = "person.setName(\"Bob\")";
- IType personType = getJavaProject().findType("com.example.Person");
- String personSource = personType.getCompilationUnit().getSource();
- int offsetOfCall = personSource.indexOf(methodCallText);
- runScript.withContents(
- "var person = Find.typeByName('Person');\n" +
- "var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n" +
- "var node = AST.findCoveredNode(ast, " + offsetOfCall + ", " + methodCallText.length() + ");\n"
- , null, "inline script");
-
- MethodInvocation node = runScript.getProperty(MethodInvocation.class, "node");
-
- assertThat(node, is(notNullValue()));
- assertThat(node.getExpression().toString(), is("person"));
- assertThat(node.getName().toString(), is("setName"));
- assertThat((List) node.arguments(),
- Matchers.hasItems(a_node().with_text_representation("\"Bob\"")));
- }
-
- public static final class ASTNodeMatcher extends TypeSafeDiagnosingMatcher {
- public static final ASTNodeMatcher a_node() {
- return new ASTNodeMatcher();
- }
-
- private String text;
-
- private ASTNodeMatcher() { }
-
- public ASTNodeMatcher with_text_representation(String text) {
- this.text = text;
- return this;
- }
-
- public void describeTo(Description description) {
- description.appendText("an ASTNode");
- if (text != null) {
- description.appendText(" with text representation '" + text + "'");
- }
- }
-
- @Override
- protected boolean matchesSafely(ASTNode node, Description description) {
- description.appendText("an ASTNode");
- if (text != null && !node.toString().equals(text)) {
- description.appendText(" with text representation '" + node.toString() + "'");
- return false;
- }
- return true;
- }
- }
-}
+package com.rescripter;
+
+import static com.rescripter.ASTIntegrationTest.ASTNodeMatcher.a_node;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.hamcrest.Description;
+import org.hamcrest.Matchers;
+import org.hamcrest.TypeSafeDiagnosingMatcher;
+import org.junit.Test;
+
+import com.rescripter.script.RunScript;
+
+public class ASTIntegrationTest extends BaseRescripterIntegrationTest {
+
+ @Test public void
+ parses_compilation_unit() throws IOException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents(
+ "var person = Find.typeByName('Person');\n" +
+ "var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n", null, "inline script");
+
+ ASTNode ast = runScript.getProperty(ASTNode.class, "ast");
+
+ assertThat(ast, is(notNullValue()));
+ assertThat(ast.toString(), containsString("public class Person"));
+ assertThat(ast.toString(), containsString("public Person("));
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test public void
+ finds_covered_node() throws IOException, CoreException {
+ RunScript runScript = new RunScript(getWindow());
+ String methodCallText = "person.setName(\"Bob\")";
+ IType personType = getJavaProject().findType("com.example.Person");
+ String personSource = personType.getCompilationUnit().getSource();
+ int offsetOfCall = personSource.indexOf(methodCallText);
+ runScript.withContents(
+ "var person = Find.typeByName('Person');\n" +
+ "var ast = AST.parseCompilationUnit(person.getCompilationUnit());\n" +
+ "var node = AST.findCoveredNode(ast, " + offsetOfCall + ", " + methodCallText.length() + ");\n"
+ , null, "inline script");
+
+ MethodInvocation node = runScript.getProperty(MethodInvocation.class, "node");
+
+ assertThat(node, is(notNullValue()));
+ assertThat(node.getExpression().toString(), is("person"));
+ assertThat(node.getName().toString(), is("setName"));
+ assertThat((List) node.arguments(),
+ Matchers.hasItems(a_node().with_text_representation("\"Bob\"")));
+ }
+
+ public static final class ASTNodeMatcher extends TypeSafeDiagnosingMatcher {
+ public static final ASTNodeMatcher a_node() {
+ return new ASTNodeMatcher();
+ }
+
+ private String text;
+
+ private ASTNodeMatcher() { }
+
+ public ASTNodeMatcher with_text_representation(String textRepresentation) {
+ this.text = textRepresentation;
+ return this;
+ }
+
+ public void describeTo(Description description) {
+ description.appendText("an ASTNode");
+ if (text != null) {
+ description.appendText(" with text representation '" + text + "'");
+ }
+ }
+
+ @Override
+ protected boolean matchesSafely(ASTNode node, Description description) {
+ description.appendText("an ASTNode");
+ if (text != null && !node.toString().equals(text)) {
+ description.appendText(" with text representation '" + node.toString() + "'");
+ return false;
+ }
+ return true;
+ }
+ }
+}
diff --git a/com.rescripter.editor.test/src/integrationtest/com/rescripter/FindIntegrationTest.java b/com.rescripter.editor.test/src/integrationtest/com/rescripter/FindIntegrationTest.java
index f06b524..4f8353e 100644
--- a/com.rescripter.editor.test/src/integrationtest/com/rescripter/FindIntegrationTest.java
+++ b/com.rescripter.editor.test/src/integrationtest/com/rescripter/FindIntegrationTest.java
@@ -1,48 +1,48 @@
-package com.rescripter;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.junit.Test;
-
-import com.rescripter.script.RunScript;
-
-public class FindIntegrationTest extends BaseRescripterIntegrationTest {
- @Test public void
- finds_types_by_name() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents("var person = Find.typeByName('Person');\n", null, "inline script");
- IType type = runScript.getProperty(IType.class, "person");
- assertThat(type, is(notNullValue()));
- assertThat(type, is(getJavaProject().findType("com.example.Person")));
- }
-
- @Test(expected=Exception.class) public void
- fails_to_find_missing_type_by_name() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents("var person = Find.typeByName('NotAPerson');\n", null, "inline script");
- }
-
- @Test public void
- finds_method_by_name() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents(
- "var person = Find.typeByName('Person');\n" +
- "var getName = Find.methodByName(person, 'getName');\n", null, "inline script");
- assertThat(runScript.getProperty(IMethod.class, "getName"), is(notNullValue()));
- }
-
- @Test(expected=Exception.class) public void
- fails_to_find_missing_method_by_name() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents(
- "var person = Find.typeByName('Person');\n" +
- "var getName = Find.methodByName(person, 'noSuchGetName');\n", null, "inline script");
- }
-}
+package com.rescripter;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.junit.Test;
+
+import com.rescripter.script.RunScript;
+
+public class FindIntegrationTest extends BaseRescripterIntegrationTest {
+ @Test public void
+ finds_types_by_name() throws IOException, CoreException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents("var person = Find.typeByName('Person');\n", null, "inline script");
+ IType type = runScript.getProperty(IType.class, "person");
+ assertThat(type, is(notNullValue()));
+ assertThat(type, is(getJavaProject().findType("com.example.Person")));
+ }
+
+ @Test(expected=Exception.class) public void
+ fails_to_find_missing_type_by_name() throws IOException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents("var person = Find.typeByName('NotAPerson');\n", null, "inline script");
+ }
+
+ @Test public void
+ finds_method_by_name() throws IOException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents(
+ "var person = Find.typeByName('Person');\n" +
+ "var getName = Find.methodByName(person, 'getName');\n", null, "inline script");
+ assertThat(runScript.getProperty(IMethod.class, "getName"), is(notNullValue()));
+ }
+
+ @Test(expected=Exception.class) public void
+ fails_to_find_missing_method_by_name() throws IOException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents(
+ "var person = Find.typeByName('Person');\n" +
+ "var getName = Find.methodByName(person, 'noSuchGetName');\n", null, "inline script");
+ }
+}
diff --git a/com.rescripter.editor.test/src/integrationtest/com/rescripter/RescripterIntegrationTest.java b/com.rescripter.editor.test/src/integrationtest/com/rescripter/RescripterIntegrationTest.java
index c87e5e8..5aac9c5 100644
--- a/com.rescripter.editor.test/src/integrationtest/com/rescripter/RescripterIntegrationTest.java
+++ b/com.rescripter.editor.test/src/integrationtest/com/rescripter/RescripterIntegrationTest.java
@@ -1,29 +1,28 @@
-package com.rescripter;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaModelException;
-import org.junit.Test;
-
-import com.rescripter.script.RunScript;
-
-public class RescripterIntegrationTest extends BaseRescripterIntegrationTest {
-
- @Test public void
- populates_java_project() throws JavaModelException {
- assertThat(getJavaProject().findType("com.example.Person"), is(notNullValue()));
- }
-
- @Test public void
- runs_basic_script() throws IOException, CoreException {
- RunScript runScript = new RunScript(getWindow());
- runScript.withContents("var response = 42;\n", null, "inline script");
- assertThat(runScript.getIntegerProperty("response"), is(42));
- }
-
-}
+package com.rescripter;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+
+import java.io.IOException;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.junit.Test;
+
+import com.rescripter.script.RunScript;
+
+public class RescripterIntegrationTest extends BaseRescripterIntegrationTest {
+
+ @Test public void
+ populates_java_project() throws JavaModelException {
+ assertThat(getJavaProject().findType("com.example.Person"), is(notNullValue()));
+ }
+
+ @Test public void
+ runs_basic_script() throws IOException {
+ RunScript runScript = new RunScript(getWindow());
+ runScript.withContents("var response = 42;\n", null, "inline script");
+ assertThat(runScript.getIntegerProperty("response"), is(42));
+ }
+
+}
diff --git a/com.rescripter.editor.test/src/test/com/rescripter/handler/RunRescripterHandlerTest.java b/com.rescripter.editor.test/src/test/com/rescripter/handler/RunRescripterHandlerTest.java
index 33ab8b1..e7e9f23 100644
--- a/com.rescripter.editor.test/src/test/com/rescripter/handler/RunRescripterHandlerTest.java
+++ b/com.rescripter.editor.test/src/test/com/rescripter/handler/RunRescripterHandlerTest.java
@@ -45,13 +45,13 @@ public class RunRescripterHandlerTest {
}});
RunRescripterHandler handler = new RunRescripterHandler() {
- @Override protected IWorkbenchWindow getWindow(ExecutionEvent event) throws ExecutionException {
+ @Override protected IWorkbenchWindow getWindow(ExecutionEvent evnt) {
return window;
}
@Override protected ITextEditor getEditor() {
return editor;
}
- @Override protected RunScript createRunScript(IWorkbenchWindow window) {
+ @Override protected RunScript createRunScript(IWorkbenchWindow win) {
return runScript;
}
};
diff --git a/com.rescripter.editor.test/src/test/com/rescripter/resources/FileContentsReaderTest.java b/com.rescripter.editor.test/src/test/com/rescripter/resources/FileContentsReaderTest.java
index a6812c5..cd68d34 100644
--- a/com.rescripter.editor.test/src/test/com/rescripter/resources/FileContentsReaderTest.java
+++ b/com.rescripter.editor.test/src/test/com/rescripter/resources/FileContentsReaderTest.java
@@ -7,13 +7,12 @@
import java.io.IOException;
import java.io.InputStream;
-import org.eclipse.core.runtime.CoreException;
import org.junit.Test;
public class FileContentsReaderTest {
@Test public void
- reads_contents_of_a_stream() throws IOException, CoreException {
+ reads_contents_of_a_stream() throws IOException {
String contents = "first line\nof the contents\n";
final InputStream inputStream = new ByteArrayInputStream(contents.getBytes());
@@ -24,7 +23,7 @@ public class FileContentsReaderTest {
}
@Test public void
- reads_windows_format_file_contents() throws IOException, CoreException {
+ reads_windows_format_file_contents() throws IOException {
String contents = "first line\r\nof the contents\r\n";
final InputStream inputStream = new ByteArrayInputStream(contents.getBytes());
@@ -35,7 +34,7 @@ public class FileContentsReaderTest {
}
@Test public void
- appends_cr_to_contents() throws IOException, CoreException {
+ appends_cr_to_contents() throws IOException {
String contents = "contents";
final InputStream inputStream = new ByteArrayInputStream(contents.getBytes());
diff --git a/com.rescripter.editor.test/src/test/com/rescripter/script/RunScriptTest.java b/com.rescripter.editor.test/src/test/com/rescripter/script/RunScriptTest.java
index e2a431b..0d3273c 100644
--- a/com.rescripter.editor.test/src/test/com/rescripter/script/RunScriptTest.java
+++ b/com.rescripter.editor.test/src/test/com/rescripter/script/RunScriptTest.java
@@ -5,7 +5,6 @@
import java.io.IOException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.IWorkbenchWindow;
import org.jmock.Expectations;
@@ -18,7 +17,7 @@ public class RunScriptTest {
private Mockery context = new Mockery() {{ setImposteriser(ClassImposteriser.INSTANCE); }};
@Test public void
- runs_script() throws IOException, CoreException {
+ runs_script() throws IOException {
final IWorkbenchWindow window = context.mock(IWorkbenchWindow.class);
final IFile file = context.mock(IFile.class);
final ScriptRunner scriptRunner = context.mock(ScriptRunner.class);
diff --git a/com.rescripter.editor.test/src/test/com/rescripter/script/ScriptRunnerTest.java b/com.rescripter.editor.test/src/test/com/rescripter/script/ScriptRunnerTest.java
index c0bba67..b0808be 100644
--- a/com.rescripter.editor.test/src/test/com/rescripter/script/ScriptRunnerTest.java
+++ b/com.rescripter.editor.test/src/test/com/rescripter/script/ScriptRunnerTest.java
@@ -1,81 +1,80 @@
-package com.rescripter.script;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.is;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.CoreException;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.lib.legacy.ClassImposteriser;
-import org.junit.Test;
-
-import com.rescripter.resources.FileContentsReader;
-import com.rescripter.syntax.ASTTokenFinder;
-import com.rescripter.syntax.ChangeText;
-
-public class ScriptRunnerTest {
-
- private Mockery context = new Mockery() {{ setImposteriser(ClassImposteriser.INSTANCE); }};
-
- public static class CheckCalled {
- boolean called = false;
-
- public void call() {
- called = true;
- }
- }
-
- @Test public void
- runs_script() throws IOException, CoreException {
- final FileContentsReader fileReader = context.mock(FileContentsReader.class);
-
- context.checking(new Expectations() {{
- oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
- }});
-
- ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
-
- CheckCalled stuff = new CheckCalled();
- runner.putProperty("test",stuff);
- runner.run("test.call()","test source");
-
- assertThat(stuff.called, is(true));
- }
-
- @Test public void
- scope_includes_required_classes() throws IOException, CoreException {
- final FileContentsReader fileReader = context.mock(FileContentsReader.class);
-
- context.checking(new Expectations() {{
- oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
- }});
-
- ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
- assertThat(runner.getProperty("Load"), instanceOf(ScriptStack.class));
- assertThat(runner.getProperty("TestResult"), instanceOf(TestResultPublisher.class));
- assertThat(runner.getProperty("Alert"), instanceOf(Alerter.class));
- assertThat(runner.getProperty("SearchHelper"), instanceOf(SearchHelper.class));
- assertThat(runner.getProperty("ChangeText"), instanceOf(ChangeText.class));
- assertThat(runner.getProperty("ASTTokenFinder"), instanceOf(ASTTokenFinder.class));
- }
-
- @Test public void
- get_property_returns_variables_written_from_script() throws IOException, CoreException {
- final FileContentsReader fileReader = context.mock(FileContentsReader.class);
-
- context.checking(new Expectations() {{
- oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
- }});
-
- ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
-
- runner.run("var response = 42", "inline script");
-
- assertThat((Integer) runner.getProperty("response"), is(42));
- }
-
-}
+package com.rescripter.script;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.Test;
+
+import com.rescripter.resources.FileContentsReader;
+import com.rescripter.syntax.ASTTokenFinder;
+import com.rescripter.syntax.ChangeText;
+
+public class ScriptRunnerTest {
+
+ private Mockery context = new Mockery() {{ setImposteriser(ClassImposteriser.INSTANCE); }};
+
+ public static class CheckCalled {
+ boolean called = false;
+
+ public void call() {
+ called = true;
+ }
+ }
+
+ @Test public void
+ runs_script() throws IOException {
+ final FileContentsReader fileReader = context.mock(FileContentsReader.class);
+
+ context.checking(new Expectations() {{
+ oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
+ }});
+
+ ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
+
+ CheckCalled stuff = new CheckCalled();
+ runner.putProperty("test",stuff);
+ runner.run("test.call()","test source");
+
+ assertThat(stuff.called, is(true));
+ }
+
+ @Test public void
+ scope_includes_required_classes() throws IOException {
+ final FileContentsReader fileReader = context.mock(FileContentsReader.class);
+
+ context.checking(new Expectations() {{
+ oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
+ }});
+
+ ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
+ assertThat(runner.getProperty("Load"), instanceOf(ScriptStack.class));
+ assertThat(runner.getProperty("TestResult"), instanceOf(TestResultPublisher.class));
+ assertThat(runner.getProperty("Alert"), instanceOf(Alerter.class));
+ assertThat(runner.getProperty("SearchHelper"), instanceOf(SearchHelper.class));
+ assertThat(runner.getProperty("ChangeText"), instanceOf(ChangeText.class));
+ assertThat(runner.getProperty("ASTTokenFinder"), instanceOf(ASTTokenFinder.class));
+ }
+
+ @Test public void
+ get_property_returns_variables_written_from_script() throws IOException {
+ final FileContentsReader fileReader = context.mock(FileContentsReader.class);
+
+ context.checking(new Expectations() {{
+ oneOf(fileReader).getContents(with(any(InputStream.class))); will(returnValue(""));
+ }});
+
+ ScriptRunner runner = new ScriptRunner(null, new ScriptStack(), fileReader);
+
+ runner.run("var response = 42", "inline script");
+
+ assertThat((Integer) runner.getProperty("response"), is(42));
+ }
+
+}
diff --git a/com.rescripter.editor/META-INF/MANIFEST.MF b/com.rescripter.editor/META-INF/MANIFEST.MF
index a889196..9dff5fd 100644
--- a/com.rescripter.editor/META-INF/MANIFEST.MF
+++ b/com.rescripter.editor/META-INF/MANIFEST.MF
@@ -18,7 +18,3 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .,
resources/
-Export-Package: com.rescripter.handler,
- com.rescripter.resources,
- com.rescripter.script,
- com.rescripter.syntax
diff --git a/com.rescripter.editor/build.properties b/com.rescripter.editor/build.properties
index a97d5ae..52dccde 100644
--- a/com.rescripter.editor/build.properties
+++ b/com.rescripter.editor/build.properties
@@ -4,5 +4,4 @@ bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
- lib/rhino-1.7R2.jar,\
resources/
diff --git a/com.rescripter.editor/plugin.xml b/com.rescripter.editor/plugin.xml
index 14e6a73..81e5256 100644
--- a/com.rescripter.editor/plugin.xml
+++ b/com.rescripter.editor/plugin.xml
@@ -52,7 +52,7 @@
+ id="com.rescripter.editor.toolbars.runVSToolbar">
-
-
-
- com.rescripter
- Rescripter
- 1.0.7-SNAPSHOT
-
-
- 4.0.0
- com.rescripter.editor
- eclipse-plugin
- Rescripter Editor Plugin
-
-
+
+
+
+
+ com.rescripter
+ com.rescripter.parent
+ 1.0.7-SNAPSHOT
+
+
+ 4.0.0
+ com.rescripter.editor
+ eclipse-plugin
+ Rescripter Editor Plugin
+
+
diff --git a/com.rescripter.editor/src/com/rescripter/Activator.java b/com.rescripter.editor/src/com/rescripter/Activator.java
index 288f98f..d54c61c 100644
--- a/com.rescripter.editor/src/com/rescripter/Activator.java
+++ b/com.rescripter.editor/src/com/rescripter/Activator.java
@@ -1,51 +1,29 @@
package com.rescripter;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
-/**
- * The activator class controls the plug-in life cycle
- */
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "EditorTest"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = "com.rescripter.editor"; //$NON-NLS-1$
- // The shared instance
private static Activator plugin;
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
public static Activator getDefault() {
return plugin;
}
@@ -60,4 +38,9 @@ public static Activator getDefault() {
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ public static void warn(Throwable e) {
+ getDefault().getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, e.getMessage(), e));
+ }
+
}
diff --git a/com.rescripter.editor/src/com/rescripter/ColorManager.java b/com.rescripter.editor/src/com/rescripter/ColorManager.java
index 0b1f41b..c8ebe25 100644
--- a/com.rescripter.editor/src/com/rescripter/ColorManager.java
+++ b/com.rescripter.editor/src/com/rescripter/ColorManager.java
@@ -10,7 +10,7 @@
public class ColorManager {
- protected Map fColorTable = new HashMap(10);
+ private final Map fColorTable = new HashMap(10);
public void dispose() {
Iterator e = fColorTable.values().iterator();
diff --git a/com.rescripter.editor/src/com/rescripter/RSDoubleClickStrategy.java b/com.rescripter.editor/src/com/rescripter/RSDoubleClickStrategy.java
index 85c1bb9..5773dd4 100644
--- a/com.rescripter.editor/src/com/rescripter/RSDoubleClickStrategy.java
+++ b/com.rescripter.editor/src/com/rescripter/RSDoubleClickStrategy.java
@@ -1,6 +1,9 @@
package com.rescripter;
-import org.eclipse.jface.text.*;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextViewer;
public class RSDoubleClickStrategy implements ITextDoubleClickStrategy {
protected ITextViewer fText;
diff --git a/com.rescripter.editor/src/com/rescripter/RSPartitionScanner.java b/com.rescripter.editor/src/com/rescripter/RSPartitionScanner.java
index 1641070..f765263 100644
--- a/com.rescripter.editor/src/com/rescripter/RSPartitionScanner.java
+++ b/com.rescripter.editor/src/com/rescripter/RSPartitionScanner.java
@@ -1,6 +1,11 @@
package com.rescripter;
-import org.eclipse.jface.text.rules.*;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.Token;
public class RSPartitionScanner extends RuleBasedPartitionScanner {
public final static String COMMENT = "__comment";
diff --git a/com.rescripter.editor/src/com/rescripter/RSScanner.java b/com.rescripter.editor/src/com/rescripter/RSScanner.java
index d2a77c0..5499a8f 100644
--- a/com.rescripter.editor/src/com/rescripter/RSScanner.java
+++ b/com.rescripter.editor/src/com/rescripter/RSScanner.java
@@ -1,7 +1,12 @@
package com.rescripter;
-import org.eclipse.jface.text.rules.*;
-import org.eclipse.jface.text.*;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
public class RSScanner extends RuleBasedScanner {
diff --git a/com.rescripter.editor/src/com/rescripter/RescripterEditor.java b/com.rescripter.editor/src/com/rescripter/RescripterEditor.java
index 1b4e6e7..d09390f 100644
--- a/com.rescripter.editor/src/com/rescripter/RescripterEditor.java
+++ b/com.rescripter.editor/src/com/rescripter/RescripterEditor.java
@@ -4,14 +4,14 @@
public class RescripterEditor extends TextEditor {
- private ColorManager colorManager;
+ private final ColorManager colorManager;
public RescripterEditor() {
- super();
colorManager = new ColorManager();
setSourceViewerConfiguration(new RSConfiguration(colorManager));
setDocumentProvider(new RSDocumentProvider());
}
+
@Override
public void dispose() {
colorManager.dispose();
diff --git a/com.rescripter.editor/src/com/rescripter/handler/RunRescripterHandler.java b/com.rescripter.editor/src/com/rescripter/handler/RunRescripterHandler.java
index c82f65d..c4da668 100644
--- a/com.rescripter.editor/src/com/rescripter/handler/RunRescripterHandler.java
+++ b/com.rescripter.editor/src/com/rescripter/handler/RunRescripterHandler.java
@@ -6,7 +6,6 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
@@ -16,11 +15,11 @@
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.texteditor.ITextEditor;
+import com.rescripter.Activator;
import com.rescripter.script.Alerter;
import com.rescripter.script.RunScript;
public class RunRescripterHandler extends AbstractHandler {
- public RunRescripterHandler() { }
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = getWindow(event);
@@ -36,13 +35,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
return null;
} catch (Throwable t) {
- t.printStackTrace();
- new Alerter(window).error("Error running script: "+t.getMessage());
+ new Alerter(window).error("Error running script: " + t.getMessage());
+ Activator.warn(t);
return null;
}
}
- protected RunScript createRunScript(IWorkbenchWindow window) throws IOException, CoreException {
+ protected RunScript createRunScript(IWorkbenchWindow window) throws IOException {
return new RunScript(window);
}
diff --git a/com.rescripter.editor/src/com/rescripter/resources/ClasspathScriptLoader.java b/com.rescripter.editor/src/com/rescripter/resources/ClasspathScriptLoader.java
index e5d1435..665da6f 100644
--- a/com.rescripter.editor/src/com/rescripter/resources/ClasspathScriptLoader.java
+++ b/com.rescripter.editor/src/com/rescripter/resources/ClasspathScriptLoader.java
@@ -2,8 +2,6 @@
import java.io.IOException;
-import org.eclipse.core.runtime.CoreException;
-
import com.rescripter.script.ScriptRunner;
import com.rescripter.script.ScriptStack;
@@ -21,7 +19,7 @@ public ClasspathScriptLoader(ScriptRunner scriptRunner,
this.fileReader = fileReader;
}
- public void file(String filename) throws IOException, CoreException {
+ public void file(String filename) throws IOException {
String contents = fileReader.getContents(getClass().getClassLoader().getResourceAsStream(filename));
scriptStack.push(new ClasspathScriptLoader(scriptRunner, scriptStack, fileReader));
diff --git a/com.rescripter.editor/src/com/rescripter/resources/FileContentsReader.java b/com.rescripter.editor/src/com/rescripter/resources/FileContentsReader.java
index 1be7f4a..d3982cc 100644
--- a/com.rescripter.editor/src/com/rescripter/resources/FileContentsReader.java
+++ b/com.rescripter.editor/src/com/rescripter/resources/FileContentsReader.java
@@ -5,12 +5,10 @@
import java.io.InputStreamReader;
import java.io.LineNumberReader;
-import org.eclipse.core.runtime.CoreException;
-
public class FileContentsReader {
- public String getContents(InputStream inputStream) throws IOException, CoreException {
- StringBuffer buff = new StringBuffer();
+ public String getContents(InputStream inputStream) throws IOException {
+ StringBuilder buff = new StringBuilder();
LineNumberReader in = new LineNumberReader(new InputStreamReader(inputStream));
try {
String line;
diff --git a/com.rescripter.editor/src/com/rescripter/resources/ScriptLoader.java b/com.rescripter.editor/src/com/rescripter/resources/ScriptLoader.java
index 8b2e073..3963066 100644
--- a/com.rescripter.editor/src/com/rescripter/resources/ScriptLoader.java
+++ b/com.rescripter.editor/src/com/rescripter/resources/ScriptLoader.java
@@ -6,6 +6,6 @@
public interface ScriptLoader {
- public void file(String filename) throws IOException, CoreException;
+ void file(String filename) throws IOException, CoreException;
}
diff --git a/com.rescripter.editor/src/com/rescripter/resources/WorkspaceScriptLoader.java b/com.rescripter.editor/src/com/rescripter/resources/WorkspaceScriptLoader.java
index 5d6cd48..33cf003 100644
--- a/com.rescripter.editor/src/com/rescripter/resources/WorkspaceScriptLoader.java
+++ b/com.rescripter.editor/src/com/rescripter/resources/WorkspaceScriptLoader.java
@@ -45,6 +45,7 @@ public IFile getCurrentLocation() {
return location;
}
+ @Override
public String toString() {
return "a workspace script loader";
}
diff --git a/com.rescripter.editor/src/com/rescripter/script/DebugMessage.java b/com.rescripter.editor/src/com/rescripter/script/DebugMessage.java
index d3c5433..bf8c8a4 100644
--- a/com.rescripter.editor/src/com/rescripter/script/DebugMessage.java
+++ b/com.rescripter.editor/src/com/rescripter/script/DebugMessage.java
@@ -7,20 +7,24 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
+import com.rescripter.Activator;
+
public class DebugMessage {
private MessageConsoleStream stream;
- private static MessageConsole console = new MessageConsole("Rescripter Debug", null);
+ private static final MessageConsole console = new MessageConsole("Rescripter Debug", null);
+ private static final IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
static {
- ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
+ consoleManager.addConsoles(new IConsole[] { console });
}
public DebugMessage() {
- ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
+ consoleManager.showConsoleView(console);
stream = console.newMessageStream();
}
@@ -36,7 +40,7 @@ public void done() {
try {
stream.close();
} catch (IOException e) {
- e.printStackTrace();
+ Activator.warn(e);
}
}
}
diff --git a/com.rescripter.editor/src/com/rescripter/script/RunScript.java b/com.rescripter.editor/src/com/rescripter/script/RunScript.java
index 78c5480..acead0a 100644
--- a/com.rescripter.editor/src/com/rescripter/script/RunScript.java
+++ b/com.rescripter.editor/src/com/rescripter/script/RunScript.java
@@ -3,7 +3,6 @@
import java.io.IOException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IWorkbenchWindow;
import org.mozilla.javascript.NativeJavaObject;
@@ -16,7 +15,7 @@ public class RunScript {
private final FileContentsReader fileReader = new FileContentsReader();
private ScriptRunner runner;
- public RunScript(IWorkbenchWindow window) throws IOException, CoreException {
+ public RunScript(IWorkbenchWindow window) throws IOException {
this.runner = new ScriptRunner(window, scriptStack, fileReader);
}
diff --git a/com.rescripter.editor/src/com/rescripter/script/ScriptRunner.java b/com.rescripter.editor/src/com/rescripter/script/ScriptRunner.java
index a8b6a08..aba4179 100644
--- a/com.rescripter.editor/src/com/rescripter/script/ScriptRunner.java
+++ b/com.rescripter.editor/src/com/rescripter/script/ScriptRunner.java
@@ -2,7 +2,6 @@
import java.io.IOException;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.IWorkbenchWindow;
import org.mozilla.javascript.Context;
@@ -16,56 +15,56 @@
public class ScriptRunner {
- private final Context context;
- private final Scriptable scope;
- private DebugMessage debugMessage;
- private final ScriptStack scriptStack;
- private final FileContentsReader fileReader;
+ private final Context context;
+ private final Scriptable scope;
+ private final DebugMessage debugMessage;
+ private final ScriptStack scriptStack;
+ private final FileContentsReader fileReader;
- public ScriptRunner(IWorkbenchWindow window,
- ScriptStack scriptStack,
- FileContentsReader fileReader) throws IOException, CoreException {
- this.scriptStack = scriptStack;
- this.fileReader = fileReader;
- this.context = createContext();
- this.scope = context.initStandardObjects();
- putProperty("Load", scriptStack);
- if (Platform.isRunning()) {
- putProperty("Debug", debugMessage = new DebugMessage());
- }
- putProperty("TestResult", new TestResultPublisher());
- putProperty("Alert", new Alerter(window));
- putProperty("SearchHelper", new SearchHelper());
- putProperty("ChangeText", new ChangeText());
- putProperty("ASTTokenFinder", new ASTTokenFinder());
+ public ScriptRunner(IWorkbenchWindow window, ScriptStack scriptStack, FileContentsReader fileReader) throws IOException {
+ this.scriptStack = scriptStack;
+ this.fileReader = fileReader;
+ context = createContext();
+ scope = context.initStandardObjects();
+ putProperty("Load", scriptStack);
+ if (Platform.isRunning()) {
+ putProperty("Debug", debugMessage = new DebugMessage());
+ } else {
+ debugMessage = null;
+ }
+ putProperty("TestResult", new TestResultPublisher());
+ putProperty("Alert", new Alerter(window));
+ putProperty("SearchHelper", new SearchHelper());
+ putProperty("ChangeText", new ChangeText());
+ putProperty("ASTTokenFinder", new ASTTokenFinder());
- includeSystem();
- }
-
- protected Context createContext() {
- return Context.enter();
- }
+ includeSystem();
+ }
- public void run(String source, String sourceName) {
- context.evaluateString(scope, source, sourceName, 1, null);
- }
+ private Context createContext() {
+ return Context.enter();
+ }
- public void putProperty(String name, Object object) {
- ScriptableObject.putProperty(scope, name, object);
- }
-
- public Object getProperty(String name) {
- return ScriptableObject.getProperty(scope, name);
- }
+ public void run(String source, String sourceName) {
+ context.evaluateString(scope, source, sourceName, 1, null);
+ }
- private void includeSystem() throws IOException, CoreException {
- ClasspathScriptLoader loader = new ClasspathScriptLoader(this, scriptStack, fileReader);
- loader.file("System.rs");
- }
+ public final void putProperty(String name, Object object) {
+ ScriptableObject.putProperty(scope, name, object);
+ }
- public void done() {
- if (debugMessage != null) {
- debugMessage.done();
- }
- }
+ public Object getProperty(String name) {
+ return ScriptableObject.getProperty(scope, name);
+ }
+
+ private void includeSystem() throws IOException {
+ ClasspathScriptLoader loader = new ClasspathScriptLoader(this, scriptStack, fileReader);
+ loader.file("System.rs");
+ }
+
+ public void done() {
+ if (debugMessage != null) {
+ debugMessage.done();
+ }
+ }
}
diff --git a/com.rescripter.editor/src/com/rescripter/script/ScriptStack.java b/com.rescripter.editor/src/com/rescripter/script/ScriptStack.java
index 5f133e4..9d06f1c 100644
--- a/com.rescripter.editor/src/com/rescripter/script/ScriptStack.java
+++ b/com.rescripter.editor/src/com/rescripter/script/ScriptStack.java
@@ -9,7 +9,7 @@
public class ScriptStack implements ScriptLoader {
- private Stack stack = new Stack();
+ private final Stack stack = new Stack();
public void file(String filename) throws IOException, CoreException {
peek().file(filename);
diff --git a/com.rescripter.editor/src/com/rescripter/script/SearchHelper.java b/com.rescripter.editor/src/com/rescripter/script/SearchHelper.java
index 87a9750..efd7290 100644
--- a/com.rescripter.editor/src/com/rescripter/script/SearchHelper.java
+++ b/com.rescripter.editor/src/com/rescripter/script/SearchHelper.java
@@ -16,10 +16,12 @@
public class SearchHelper {
- public IType findTypeByName(String name) throws CoreException {
+ private static final String NO_PATTERN = "No pattern!?";
+
+ public IType findTypeByName(String name) throws CoreException {
SearchPattern pattern = SearchPattern.createPattern(name, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH);
if (pattern == null) {
- throw new NullPointerException("No pattern!?");
+ throw new NullPointerException(NO_PATTERN);
}
final List matches = new ArrayList();
@@ -48,7 +50,7 @@ public SearchMatch[] findSubClassesOf(IType type) throws CoreException {
SearchPattern pattern = SearchPattern.createPattern(type, IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE);
if (pattern == null) {
// E.g. element not found / no longer exists
- throw new NullPointerException("No pattern!?");
+ throw new NullPointerException(NO_PATTERN);
}
SearchRequestor requestor = new SearchRequestor() {
@@ -76,7 +78,7 @@ public SearchMatch[] findReferencesTo(IJavaElement element, IJavaElement withinT
SearchPattern pattern = SearchPattern.createPattern(element, IJavaSearchConstants.REFERENCES);
if (pattern == null) {
// E.g. element not found / no longer exists
- throw new NullPointerException("No pattern!?");
+ throw new NullPointerException(NO_PATTERN);
}
SearchRequestor requestor = new SearchRequestor() {
@@ -107,7 +109,7 @@ public SearchMatch[] findMethodReferences(String methodName, IJavaElement within
SearchPattern.R_FULL_MATCH);
if (pattern == null) {
// E.g. element not found / no longer exists
- throw new NullPointerException("No pattern!?");
+ throw new NullPointerException(NO_PATTERN);
}
SearchRequestor requestor = new SearchRequestor() {
diff --git a/com.rescripter.editor/src/com/rescripter/script/TestResultPublisher.java b/com.rescripter.editor/src/com/rescripter/script/TestResultPublisher.java
index f5ccca1..121734f 100644
--- a/com.rescripter.editor/src/com/rescripter/script/TestResultPublisher.java
+++ b/com.rescripter.editor/src/com/rescripter/script/TestResultPublisher.java
@@ -10,8 +10,8 @@
public class TestResultPublisher {
- private int numSpecsStarted = 0;
- private int numSpecsInError = 0;
+ private int numSpecsStarted;
+ private int numSpecsInError;
private List results = new ArrayList();
@@ -22,7 +22,7 @@ public synchronized void startTest(int numSpecs) throws PartInitException {
numSpecsInError = 0;
}
- public synchronized void specStarted() throws PartInitException {
+ public synchronized void specStarted() {
numSpecsStarted++;
}
diff --git a/com.rescripter.editor/src/com/rescripter/syntax/ASTTokenFinder.java b/com.rescripter.editor/src/com/rescripter/syntax/ASTTokenFinder.java
index caba71e..5e52370 100644
--- a/com.rescripter.editor/src/com/rescripter/syntax/ASTTokenFinder.java
+++ b/com.rescripter.editor/src/com/rescripter/syntax/ASTTokenFinder.java
@@ -27,13 +27,13 @@ public ISourceRange findTokenOfType(ICompilationUnit theCU, int tokenType, int o
}
}
} catch (InvalidInputException e) {
- throw new RuntimeException("Error finding token: "+e.getMessage(), e);
+ throw new IllegalArgumentException("Error finding token: "+e.getMessage(), e);
}
return null;
}
- public static interface FoundToken {
+ public interface FoundToken {
void found(int tokenType, int offset, int length);
}
@@ -58,7 +58,7 @@ public void scanTokens(ICompilationUnit theCU, int offset, int length, FoundToke
*/
class SourceRange implements ISourceRange {
- protected final int offset, length;
+ private final int offset, length;
public SourceRange(int offset, int length) {
this.offset = offset;
diff --git a/com.rescripter.editor/src/com/rescripter/views/TestResultLabelProvider.java b/com.rescripter.editor/src/com/rescripter/views/TestResultLabelProvider.java
index 1b89f68..21d0f24 100644
--- a/com.rescripter.editor/src/com/rescripter/views/TestResultLabelProvider.java
+++ b/com.rescripter.editor/src/com/rescripter/views/TestResultLabelProvider.java
@@ -10,8 +10,8 @@
final class TestResultLabelProvider implements ILabelProvider, IColorProvider {
- private Color red;
- private Color green;
+ private final Color red;
+ private final Color green;
public TestResultLabelProvider() {
this.red = new Color(null, 128, 0, 0);
@@ -46,7 +46,6 @@ public Color getForeground(Object element) {
}
public Color getBackground(Object element) {
- // TODO Auto-generated method stub
return null;
}
diff --git a/com.rescripter.editor/src/com/rescripter/views/TestResultView.java b/com.rescripter.editor/src/com/rescripter/views/TestResultView.java
index c8b9a26..0d34d28 100644
--- a/com.rescripter.editor/src/com/rescripter/views/TestResultView.java
+++ b/com.rescripter.editor/src/com/rescripter/views/TestResultView.java
@@ -1,6 +1,7 @@
package com.rescripter.views;
import java.util.ArrayList;
+import java.util.List;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -24,7 +25,7 @@ public class TestResultView extends ViewPart {
private Composite panel;
private TestProgressBar progress;
- private java.util.List testResultList;
+ private List testResultList;
private TreeViewer treeViewer;
@Override
diff --git a/com.rescripter.jmock/pom.xml b/com.rescripter.jmock/pom.xml
index 9f2bf38..87068a8 100644
--- a/com.rescripter.jmock/pom.xml
+++ b/com.rescripter.jmock/pom.xml
@@ -1,16 +1,16 @@
-
-
-
-
- com.rescripter
- Rescripter
- 1.0.7-SNAPSHOT
-
-
- 4.0.0
- com.rescripter.jmock
- eclipse-plugin
- Rescripter JMock Dependencies
-
-
+
+
+
+
+ com.rescripter
+ com.rescripter.parent
+ 1.0.7-SNAPSHOT
+
+
+ 4.0.0
+ com.rescripter.jmock
+ eclipse-plugin
+ Rescripter JMock Dependencies
+
+
diff --git a/com.rescripter.rhino/pom.xml b/com.rescripter.rhino/pom.xml
index 26911d2..c9f3b1e 100644
--- a/com.rescripter.rhino/pom.xml
+++ b/com.rescripter.rhino/pom.xml
@@ -1,16 +1,16 @@
-
-
-
-
- com.rescripter
- Rescripter
- 1.0.7-SNAPSHOT
-
-
- 4.0.0
- com.rescripter.rhino
- eclipse-plugin
- Rescripter Rhino Dependencies
-
-
+
+
+
+
+ com.rescripter
+ com.rescripter.parent
+ 1.0.7-SNAPSHOT
+
+
+ 4.0.0
+ com.rescripter.rhino
+ eclipse-plugin
+ Rescripter Rhino Dependencies
+
+
diff --git a/com.rescripter/pom.xml b/com.rescripter/pom.xml
index 429913d..4e9cf52 100644
--- a/com.rescripter/pom.xml
+++ b/com.rescripter/pom.xml
@@ -1,16 +1,16 @@
-
-
-
-
- com.rescripter
- Rescripter
- 1.0.7-SNAPSHOT
-
-
- 4.0.0
- com.rescripter.feature.group
- eclipse-feature
- Rescripter Feature Group
-
-
+
+
+
+
+ com.rescripter
+ com.rescripter.parent
+ 1.0.7-SNAPSHOT
+
+
+ 4.0.0
+ com.rescripter
+ eclipse-feature
+ Rescripter Feature
+
+
diff --git a/pom.xml b/pom.xml
index 52ffd3a..180b427 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.rescripter
- Rescripter
+ com.rescripter.parent
pom
Rescripter Parent
1.0.7-SNAPSHOT
@@ -19,7 +19,7 @@
Jenkins
- https://codecop.ci.cloudbees.com/job/${project.artifactId}/
+ https://codecop.ci.cloudbees.com/job/Rescripter/
2011
@@ -56,9 +56,9 @@
- scm:git:git://github.com/activelylazy/${project.artifactId}.git
- scm:git:https://github.com/activelylazy/${project.artifactId}.git
- https://github.com/activelylazy/${project.artifactId}
+ scm:git:git://github.com/codecop/${project.artifactId}.git
+ scm:git:https://github.com/codecop/${project.artifactId}.git
+ https://github.com/codecop/${project.artifactId}
@@ -76,6 +76,7 @@
${tycho-version}
p2
+ consider
@@ -86,7 +87,10 @@
tycho-compiler-plugin
${tycho-version}
- UTF-8
+ ${project.build.java.target}
+ ${project.build.sourceEncoding}
+ ${project.build.java.target}
+ ${project.build.java.target}
@@ -98,9 +102,9 @@
org.apache.maven.plugins
maven-resources-plugin
- 2.4.1
+ 2.5
- UTF-8
+ ${project.build.sourceEncoding}
@@ -111,14 +115,10 @@
platform-galileo
-
- platform-version-name
- galileo
-
+ true
- http://download.eclipse.org/releases/galileo
- [3.5,3.6)
+ http://download.eclipse.org/releases/galileo
@@ -129,10 +129,6 @@
helios
-
- http://download.eclipse.org/releases/helios
- [3.6,3.7)
-
platform-indigo
@@ -142,10 +138,15 @@
indigo
-
- http://download.eclipse.org/releases/indigo
- [3.7,3.8)
-
+
+
+ platform-juno
+
+
+ platform-version-name
+ juno
+
+
@@ -154,21 +155,29 @@
com.rescripter.jmock
com.rescripter.editor
com.rescripter.editor.test
- com.rescripter
+ com.rescripter
+
- helios
+ Eclipse
p2
- ${eclipse-site}
+ ${eclipse-p2}
+
+ true
+
+
+ true
+
- 0.12.0
- galileo
- http://download.eclipse.org/releases/${platform-version-name}
+ 0.15.0
+ UTF-8
+ 1.5
+ http://download.eclipse.org/releases/${platform-version-name}
diff --git a/update-site/pom.xml b/update-site/pom.xml
index 266fdf8..0ccde25 100644
--- a/update-site/pom.xml
+++ b/update-site/pom.xml
@@ -1,16 +1,16 @@
-
-
-
-
- com.rescripter
- Rescripter
- 1.0.7-SNAPSHOT
-
-
- 4.0.0
- com.rescripter.update-site
- eclipse-update-site
- Rescripter Update Site
-
-
+
+
+
+
+ com.rescripter
+ com.rescripter.parent
+ 1.0.7-SNAPSHOT
+
+
+ 4.0.0
+ com.rescripter.update-site
+ eclipse-update-site
+ Rescripter Update Site
+
+