Updated all tests to use latest test frameworks. Updated to latest Mockito, Hamcrest, JUnit, and SwtBot. Change-Id: I578e05204cbc48e5002c10afa999d9e47f4b9a04
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 3b08b5f..a5bec8f 100644 --- a/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF +++ b/com.google.eclipse.protobuf.cdt.test/META-INF/MANIFEST.MF
@@ -6,7 +6,5 @@ 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;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" +Require-Bundle: org.junit, + org.mockito
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 30b4757..6ad03ba 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 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 static org.hamcrest.CoreMatchers.hasItems; +import static org.junit.Assert.assertThat; 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), hasItems(message)); + assertThat(eObjectsFrom(locations), CoreMatchers.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 07b1e86..e663877 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,12 +8,11 @@ */ package com.google.eclipse.protobuf.cdt.util; -import static org.hamcrest.collection.IsCollectionContaining.hasItems; +import static org.hamcrest.CoreMatchers.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 308baf9..4f59c7b 100644 --- a/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF +++ b/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
@@ -1,13 +1,11 @@ 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;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 +Fragment-Host: com.google.eclipse.protobuf +Require-Bundle: org.eclipse.core.resources, + org.junit, + org.mockito
diff --git a/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF index c294255..8b4acc6 100644 --- a/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF +++ b/com.google.eclipse.protobuf.test/META-INF/MANIFEST.MF
@@ -1,16 +1,14 @@ 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;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 +Fragment-Host: com.google.eclipse.protobuf +Require-Bundle: org.eclipse.core.resources, + org.junit, + org.mockito 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 df05b72..ef3e724 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.Matchers.equalTo; +import static org.hamcrest.CoreMatchers.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 cc5ba7d..6369832 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,10 +1,11 @@ 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;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" +Fragment-Host: com.google.eclipse.protobuf.ui +Require-Bundle: org.eclipse.swtbot.eclipse.finder, + org.junit, + org.mockito
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 075b576..e9bf539 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,8 +21,6 @@ /** * Tests for "import" hyperlinking. - * - * @author alruiz@google.com (Alex Ruiz) */ public class ImportHyperlinking_Test { private static ProtobufBot robot; @@ -36,7 +34,7 @@ @Rule public CommentReaderRule commentReader = new CommentReaderRule(); // import 'google/protobuf/descriptor.proto'; - @Test public void should_open_file_in_plugIn() throws InterruptedException { + @Test public void should_open_file_in_plugIn() { 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 39923ce..b43c785 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;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 +Fragment-Host: com.google.eclipse.protobuf.ui +Require-Bundle: org.eclipse.swtbot.eclipse.finder, + org.eclipse.swtbot.junit4_x, + org.junit, + org.mockito
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 4fb9467..72b0081 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.Matchers.instanceOf; +import static org.hamcrest.CoreMatchers.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 75066e9..af6b200 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.hamcrest.TypeSafeMatcher; +import org.junit.internal.matchers.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 f1b24bf..b15941f 100644 --- a/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF +++ b/com.google.eclipse.protobuf.ui.test/META-INF/MANIFEST.MF
@@ -1,12 +1,10 @@ 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;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" +Fragment-Host: com.google.eclipse.protobuf.ui +Require-Bundle: org.junit, + org.mockito
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 558fbf9..61d1a5e 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,7 +13,9 @@ 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; @@ -30,7 +32,11 @@ private File project; @Before public void setUp() { - project = temporaryFolder.newFolder("project"); + try { + project = temporaryFolder.newFolder("project"); + } catch (IOException e) { + Assert.fail(e.toString()); + } } @Test public void should_return_project_directory_if_file_is_underneath_it() {