Revert "Updated all tests to use latest test frameworks."
This reverts commit f552a9c1fde9a5da5cc26edde2fbc9bdd55c9eb2.
diff --git a/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF
index a5bec8f..3b08b5f 100644
--- a/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF
@@ -6,5 +6,7 @@
Bundle-Vendor: Google, Inc.
Fragment-Host: com.google.eclipse.protobuf.cdt;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.junit,
- org.mockito
+Require-Bundle: org.junit;bundle-version="4.8.2",
+ org.mockito;bundle-version="1.8.5",
+ org.hamcrest;bundle-version="1.1.0",
+ org.hamcrest.library;bundle-version="1.1.0"
diff --git a/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/matching/MessageMatcherStrategy_matchingProtobufElementLocations_Test.java b/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/matching/MessageMatcherStrategy_matchingProtobufElementLocations_Test.java
index 6ad03ba..30b4757 100644
--- a/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/matching/MessageMatcherStrategy_matchingProtobufElementLocations_Test.java
+++ b/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/matching/MessageMatcherStrategy_matchingProtobufElementLocations_Test.java
@@ -8,26 +8,26 @@
*/
package com.google.eclipse.protobuf.cdt.matching;
+import static org.hamcrest.collection.IsCollectionContaining.hasItems;
+import static org.junit.Assert.assertThat;
+
import static com.google.eclipse.protobuf.cdt.matching.Resources.eObjects;
import static com.google.eclipse.protobuf.cdt.util.ExtendedListIterator.newIterator;
import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
-import static org.hamcrest.CoreMatchers.hasItems;
-import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.junit.Rule;
+import org.junit.Test;
import com.google.eclipse.protobuf.cdt.util.ExtendedIterator;
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.Message;
import com.google.inject.Inject;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.hamcrest.CoreMatchers;
-import org.junit.Rule;
-import org.junit.Test;
-
-import java.util.List;
-
/**
* Tests for <code>{@link MessageMatcherStrategy#matchingProtobufElementLocations(EObject, ExtendedIterator)}</code>
*
@@ -46,7 +46,7 @@
@Test public void should_find_top_level_perfect_match() {
List<URI> locations = matcher.matchingProtobufElementLocations(xtext.root(), newIterator("Address"));
EObject message = xtext.find("Address", Message.class);
- assertThat(eObjectsFrom(locations), CoreMatchers.hasItems(message));
+ assertThat(eObjectsFrom(locations), hasItems(message));
}
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/util/ExtendedListIterator_Test.java b/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/util/ExtendedListIterator_Test.java
index e663877..07b1e86 100644
--- a/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/util/ExtendedListIterator_Test.java
+++ b/com.google.eclipse.protobuf.cdt.test/src/com/google/eclipse/protobuf/cdt/util/ExtendedListIterator_Test.java
@@ -8,11 +8,12 @@
*/
package com.google.eclipse.protobuf.cdt.util;
-import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.collection.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+
import static com.google.common.collect.Lists.newArrayList;
import java.util.List;
diff --git a/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
index 4f59c7b..308baf9 100644
--- a/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
@@ -1,11 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Integration tests for com.google.eclipse.protobuf
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-SymbolicName: com.google.eclipse.protobuf.integration.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Google Inc.
-Fragment-Host: com.google.eclipse.protobuf
-Require-Bundle: org.eclipse.core.resources,
- org.junit,
- org.mockito
+Fragment-Host: com.google.eclipse.protobuf;bundle-version="1.0.9"
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.mockito;bundle-version="1.8.5",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.hamcrest;bundle-version="1.1.0",
+ org.hamcrest.library;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF
index 8b4acc6..c294255 100644
--- a/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF
@@ -1,14 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests for com.google.eclipse.protobuf
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-SymbolicName: com.google.eclipse.protobuf.test
Bundle-Version: 1.0.0
Bundle-Vendor: Google Inc.
-Fragment-Host: com.google.eclipse.protobuf
-Require-Bundle: org.eclipse.core.resources,
- org.junit,
- org.mockito
+Fragment-Host: com.google.eclipse.protobuf;bundle-version="1.0.0"
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.mockito;bundle-version="1.8.5",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.hamcrest;bundle-version="1.1.0",
+ org.hamcrest.library;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: com.google.eclipse.protobuf.junit.core,
com.google.eclipse.protobuf.junit.matchers,
com.google.eclipse.protobuf.junit.stubs.resources,
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue229_ReferenceToTypeFromNestedMessage.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue229_ReferenceToTypeFromNestedMessage.java
index ef3e724..df05b72 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue229_ReferenceToTypeFromNestedMessage.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue229_ReferenceToTypeFromNestedMessage.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.bugs;
-import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
diff --git a/com.google.eclipse.protobuf.ui.functional.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.ui.functional.test/META-INF/MANIFEST.MF
index 6369832..cc5ba7d 100644
--- a/com.google.eclipse.protobuf.ui.functional.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.ui.functional.test/META-INF/MANIFEST.MF
@@ -1,11 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-SymbolicName: com.google.eclipse.protobuf.ui.functional.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Google Inc.
-Fragment-Host: com.google.eclipse.protobuf.ui
-Require-Bundle: org.eclipse.swtbot.eclipse.finder,
- org.junit,
- org.mockito
+Fragment-Host: com.google.eclipse.protobuf.ui;bundle-version="1.1.1"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.swtbot.go;bundle-version="2.0.5",
+ org.mockito;bundle-version="1.8.5"
diff --git a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/hyperlinking/ImportHyperlinking_Test.java b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/hyperlinking/ImportHyperlinking_Test.java
index e9bf539..075b576 100644
--- a/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/hyperlinking/ImportHyperlinking_Test.java
+++ b/com.google.eclipse.protobuf.ui.functional.test/src/com/google/eclipse/protobuf/ui/editor/hyperlinking/ImportHyperlinking_Test.java
@@ -21,6 +21,8 @@
/**
* Tests for "import" hyperlinking.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
*/
public class ImportHyperlinking_Test {
private static ProtobufBot robot;
@@ -34,7 +36,7 @@
@Rule public CommentReaderRule commentReader = new CommentReaderRule();
// import 'google/protobuf/descriptor.proto';
- @Test public void should_open_file_in_plugIn() {
+ @Test public void should_open_file_in_plugIn() throws InterruptedException {
String text = commentReader.comments().get(0);
SWTBotEclipseEditor editor = robot.createFileWithText("importDescriptor.proto", text);
navigateToImportedFile(editor);
diff --git a/com.google.eclipse.protobuf.ui.integration.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.ui.integration.test/META-INF/MANIFEST.MF
index b43c785..39923ce 100644
--- a/com.google.eclipse.protobuf.ui.integration.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.ui.integration.test/META-INF/MANIFEST.MF
@@ -1,12 +1,12 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Integration tests for com.google.eclipse.protobuf.ui
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-SymbolicName: com.google.eclipse.protobuf.ui.integration.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Google Inc.
-Fragment-Host: com.google.eclipse.protobuf.ui
-Require-Bundle: org.eclipse.swtbot.eclipse.finder,
- org.eclipse.swtbot.junit4_x,
- org.junit,
- org.mockito
+Fragment-Host: com.google.eclipse.protobuf.ui;bundle-version="1.2.3"
+Require-Bundle: org.junit4;bundle-version="4.8.1",
+ org.mockito;bundle-version="1.8.5",
+ org.hamcrest;bundle-version="1.1.0",
+ org.hamcrest.library;bundle-version="1.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/Labels_labelFor_Test.java b/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/Labels_labelFor_Test.java
index 72b0081..4fb9467 100644
--- a/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/Labels_labelFor_Test.java
+++ b/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/Labels_labelFor_Test.java
@@ -8,7 +8,7 @@
*/
package com.google.eclipse.protobuf.ui.labeling;
-import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
diff --git a/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/ProjectFileExists.java b/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/ProjectFileExists.java
index af6b200..75066e9 100644
--- a/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/ProjectFileExists.java
+++ b/com.google.eclipse.protobuf.ui.integration.test/src/com/google/eclipse/protobuf/ui/labeling/ProjectFileExists.java
@@ -14,7 +14,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.hamcrest.Description;
-import org.junit.internal.matchers.TypeSafeMatcher;
+import org.hamcrest.TypeSafeMatcher;
import com.google.eclipse.protobuf.ui.internal.ProtobufActivator;
diff --git a/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF
index b15941f..f1b24bf 100644
--- a/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF
@@ -1,10 +1,12 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests for com.google.eclipse.protobuf.ui
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-SymbolicName: com.google.eclipse.protobuf.ui.test
Bundle-Version: 1.0.0
Bundle-Vendor: Google Inc.
-Fragment-Host: com.google.eclipse.protobuf.ui
-Require-Bundle: org.junit,
- org.mockito
+Fragment-Host: com.google.eclipse.protobuf.ui;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.mockito;bundle-version="1.8.5",
+ org.hamcrest;bundle-version="1.1.0",
+ org.hamcrest.library;bundle-version="1.1.0"
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/protoc/command/ImportRootsProtocOption_singleImportRoot_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/protoc/command/ImportRootsProtocOption_singleImportRoot_Test.java
index 61d1a5e..558fbf9 100644
--- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/protoc/command/ImportRootsProtocOption_singleImportRoot_Test.java
+++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/protoc/command/ImportRootsProtocOption_singleImportRoot_Test.java
@@ -13,9 +13,7 @@
import static org.junit.Assert.assertTrue;
import java.io.File;
-import java.io.IOException;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -32,11 +30,7 @@
private File project;
@Before public void setUp() {
- try {
- project = temporaryFolder.newFolder("project");
- } catch (IOException e) {
- Assert.fail(e.toString());
- }
+ project = temporaryFolder.newFolder("project");
}
@Test public void should_return_project_directory_if_file_is_underneath_it() {