Code cleanup. Fixed broken tests.
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
index 0c95518..34c230d 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue131_AddOptionsForService_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue131_AddOptionsForService_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
index 3ac67ee..73c6b97 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue147_AddSupportForGroupOptions_Test.java
@@ -14,7 +14,6 @@
import static com.google.eclipse.protobuf.junit.matchers.ContainAllFields.containAll;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import java.util.Collection;
@@ -33,16 +32,11 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue147_AddSupportForGroupOptions_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
- @Inject private ProtobufScopeProvider scopeProvider;
+ @Inject private EReference reference;
@Inject private ProtoDescriptorProvider descriptorProvider;
+ @Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
//
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
index 14c75aa..4ae0f8b 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue156_AddSupportForEnumValueOptions_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue156_AddSupportForEnumValueOptions_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
index 174a7c8..38ee735 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue157_GroupsShouldBeTypes_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue157_GroupsShouldBeTypes_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
index ddf9cc2..4b32554 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue161_PackageScoping_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue161_PackageScoping_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// // Create file types.proto
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue167_PackageScopingWithNestedTypes_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue167_PackageScopingWithNestedTypes_Test.java
index b722886..d395cbf 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue167_PackageScopingWithNestedTypes_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue167_PackageScopingWithNestedTypes_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue167_PackageScopingWithNestedTypes_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// // Create file types.proto
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue187_ExposeAllTypesInDescriptor_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue187_ExposeAllTypesInDescriptor_Test.java
index f7df378..e4dafe1 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue187_ExposeAllTypesInDescriptor_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue187_ExposeAllTypesInDescriptor_Test.java
@@ -13,31 +13,25 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainNames.contain;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.xtext.scoping.IScope;
+import org.junit.*;
import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.*;
import com.google.eclipse.protobuf.scoping.ProtobufScopeProvider;
import com.google.inject.Inject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.xtext.scoping.IScope;
-import org.junit.*;
-
/**
* Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=187">Issue 187</a>.
*
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue187_ExposeAllTypesInDescriptor_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue189_ScopingShouldLookForClosestType.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue189_ScopingShouldLookForClosestType.java
index 6c809d2..56ac4e9 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue189_ScopingShouldLookForClosestType.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/bugs/Issue189_ScopingShouldLookForClosestType.java
@@ -12,7 +12,6 @@
import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static org.junit.Assert.assertSame;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.*;
import org.eclipse.xtext.scoping.IScope;
@@ -29,14 +28,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Issue189_ScopingShouldLookForClosestType {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
index 4ef8f33..f8b8bf9 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_ComplexTypeLink_target_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -29,14 +28,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_ComplexTypeLink_target_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
index 7956b3d..8f03977 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -29,14 +28,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_FieldName_target_with_ExtensionFieldName_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
index a3df5a2..6a263d9 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllFieldsInMessage.containAllFieldsIn;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -29,14 +28,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_FieldName_target_with_NormalFieldName_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
index a43e48b..a93e554 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_LiteralLink_target_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllLiteralsInEnum.containAllLiteralsIn;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,16 +29,11 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_LiteralLink_target_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
- @Inject private ProtobufScopeProvider scopeProvider;
+ @Inject private EReference reference;
@Inject private ProtoDescriptorProvider descriptorProvider;
+ @Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
//
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
index 9f52751..fbbc45c 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test.java
@@ -13,7 +13,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -29,14 +28,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_OptionField_target_with_ExtensionOptionField_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
index 3088479..e63b452 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test.java
@@ -14,7 +14,6 @@
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static com.google.eclipse.protobuf.junit.matchers.ContainAllFieldsInMessage.containAllFieldsIn;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
@@ -30,14 +29,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_OptionField_target_with_MessageOptionField_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
+ @Inject private EReference reference;
@Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
index 2402b29..3a0bfdb 100644
--- a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/ProtobufScopeProvider_scope_OptionSource_target_Test.java
@@ -15,7 +15,6 @@
import static com.google.eclipse.protobuf.junit.matchers.ContainAllNames.containAll;
import static com.google.eclipse.protobuf.scoping.OptionType.*;
import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
import java.util.Collection;
@@ -33,16 +32,11 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class ProtobufScopeProvider_scope_OptionSource_target_Test {
- private static EReference reference;
-
- @BeforeClass public static void setUpOnce() {
- reference = mock(EReference.class);
- }
-
@Rule public XtextRule xtext = overrideRuntimeModuleWith(integrationTestModule());
- @Inject private ProtobufScopeProvider scopeProvider;
+ @Inject private EReference reference;
@Inject private ProtoDescriptorProvider descriptorProvider;
+ @Inject private ProtobufScopeProvider scopeProvider;
// syntax = "proto2";
//
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/IntegrationTestModule.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/IntegrationTestModule.java
index 21a96f8..dcb4de6 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/IntegrationTestModule.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/junit/core/IntegrationTestModule.java
@@ -10,15 +10,17 @@
import static com.google.eclipse.protobuf.junit.core.GeneratedProtoFiles.protoFile;
import static org.eclipse.xtext.util.Strings.isEmpty;
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EReference;
import com.google.eclipse.protobuf.protobuf.Import;
import com.google.eclipse.protobuf.scoping.IFileUriResolver;
import com.google.inject.AbstractModule;
-import org.eclipse.emf.common.util.URI;
-
-import java.io.File;
-
/**
* Guice module for unit testing.
*
@@ -33,6 +35,7 @@
@Override protected void configure() {
binder().bind(IFileUriResolver.class).to(FileUriResolver.class);
+ binder().bind(EReference.class).toInstance(mock(EReference.class));
}
private static class FileUriResolver implements IFileUriResolver {
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/model/util/Packages_areRelated_Test.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/model/util/Packages_areRelated_Test.java
index 32c625e..bc6260c 100644
--- a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/model/util/Packages_areRelated_Test.java
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/model/util/Packages_areRelated_Test.java
@@ -8,12 +8,16 @@
*/
package com.google.eclipse.protobuf.model.util;
+import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
+import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.*;
+import com.google.eclipse.protobuf.junit.core.XtextRule;
import com.google.eclipse.protobuf.protobuf.Package;
+import com.google.inject.Inject;
/**
* Tests for <code>{@link Packages#areRelated(Package, Package)}</code>.
@@ -21,11 +25,9 @@
* @author alruiz@google.com (Alex Ruiz)
*/
public class Packages_areRelated_Test {
- private static Packages packages;
+ @Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
- @BeforeClass public static void setUpOnce() {
- packages = new Packages();
- }
+ @Inject private Packages packages;
private String baseName;
private String[] subpackageNames;