diff options
Diffstat (limited to 'java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java')
-rw-r--r-- | java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java index 7dc9fc15..cb2d34eb 100644 --- a/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java +++ b/java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java @@ -30,6 +30,9 @@ package com.google.protobuf; +import static com.google.protobuf.TestUtil.TEST_REQUIRED_INITIALIZED; +import static com.google.protobuf.TestUtil.TEST_REQUIRED_UNINITIALIZED; + import com.google.protobuf.Descriptors.FieldDescriptor; import protobuf_unittest.UnittestOptimizeFor.TestOptimizedForSize; import protobuf_unittest.UnittestProto; @@ -40,9 +43,8 @@ import protobuf_unittest.UnittestProto.TestPackedTypes; import protobuf_unittest.UnittestProto.TestRequired; import protobuf_unittest.UnittestProto.TestRequiredForeign; import protobuf_unittest.UnittestProto.TestUnpackedTypes; -import junit.framework.TestCase; - import java.util.Map; +import junit.framework.TestCase; /** * Unit test for {@link AbstractMessage}. @@ -347,11 +349,6 @@ public class AbstractMessageTest extends TestCase { // ----------------------------------------------------------------- // Tests for isInitialized(). - private static final TestRequired TEST_REQUIRED_UNINITIALIZED = - TestRequired.getDefaultInstance(); - private static final TestRequired TEST_REQUIRED_INITIALIZED = - TestRequired.newBuilder().setA(1).setB(2).setC(3).build(); - public void testIsInitialized() throws Exception { TestRequired.Builder builder = TestRequired.newBuilder(); AbstractMessageWrapper.Builder abstractBuilder = @@ -381,7 +378,7 @@ public class AbstractMessageTest extends TestCase { builder.setOptionalMessage(TEST_REQUIRED_UNINITIALIZED); assertFalse(abstractBuilder.isInitialized()); assertEquals( - "optional_message.a, optional_message.b, optional_message.c", + "optional_message.b, optional_message.c", abstractBuilder.getInitializationErrorString()); builder.setOptionalMessage(TEST_REQUIRED_INITIALIZED); @@ -391,7 +388,7 @@ public class AbstractMessageTest extends TestCase { builder.addRepeatedMessage(TEST_REQUIRED_UNINITIALIZED); assertFalse(abstractBuilder.isInitialized()); assertEquals( - "repeated_message[0].a, repeated_message[0].b, repeated_message[0].c", + "repeated_message[0].b, repeated_message[0].c", abstractBuilder.getInitializationErrorString()); builder.setRepeatedMessage(0, TEST_REQUIRED_INITIALIZED); @@ -492,7 +489,6 @@ public class AbstractMessageTest extends TestCase { checkEqualsIsConsistent(eUnknownFields, eUnknownFields2); } - /** * Asserts that the given proto has symmetric equals and hashCode methods. */ |