You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/09/10 05:15:50 UTC

git commit: Move serialization tests to own test class.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master d93ca3d9a -> 7d0935f42


Move serialization tests to own test class.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7d0935f4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7d0935f4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7d0935f4

Branch: refs/heads/master
Commit: 7d0935f422669badb68710a49b4d77ee7880a352
Parents: d93ca3d
Author: Matt Sicker <ma...@apache.org>
Authored: Tue Sep 9 22:15:42 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Tue Sep 9 22:15:42 2014 -0500

----------------------------------------------------------------------
 .../MessageFormatMessageSerializationTest.java  | 40 ++++++++++++++++++++
 .../log4j/message/MessageFormatMessageTest.java | 16 --------
 2 files changed, 40 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7d0935f4/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageSerializationTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageSerializationTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageSerializationTest.java
new file mode 100644
index 0000000..d158cd2
--- /dev/null
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageSerializationTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.message;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.apache.logging.log4j.AbstractSerializationTest;
+import org.junit.runners.Parameterized;
+
+public class MessageFormatMessageSerializationTest extends AbstractSerializationTest {
+
+    @Parameterized.Parameters
+    public static Collection<Object[]> data() {
+        return Arrays.asList(new Object[][]{
+            {new MessageFormatMessage("Test")},
+            {new MessageFormatMessage("Test {0} {1}", "message", "test")},
+            {new MessageFormatMessage("{0}{1}{2}", 3, '.', 14L)}
+        });
+    }
+
+    public MessageFormatMessageSerializationTest(final MessageFormatMessage message) {
+        super(message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7d0935f4/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
index 1e6417c..12c8e1c 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.logging.log4j.message;
 
-import org.apache.logging.log4j.SerializationTestUtils;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -88,19 +87,4 @@ public class MessageFormatMessageTest {
         final String actual = msg.getFormattedMessage();
         assertEquals("Should use initial param value", "Test message abc", actual);
     }
-
-    @Test
-    public void testSerializationWithParameters() throws Exception {
-        SerializationTestUtils.roundtripEquals(new MessageFormatMessage("Test {0} {1}", "message", "test"));
-    }
-
-    @Test
-    public void testSerializationWithNoParameters() throws Exception {
-        SerializationTestUtils.roundtripEquals(new MessageFormatMessage("Test"));
-    }
-
-    @Test
-    public void testSerializationWithNonStringParameters() throws Exception {
-        SerializationTestUtils.roundtripEquals(new MessageFormatMessage("{0}{1}{2}", 3, '.', 14L));
-    }
 }