You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ce...@apache.org on 2022/01/06 23:11:14 UTC

[logging-log4j1] 03/04: correct path for LoggingEventTest

This is an automated email from the ASF dual-hosted git repository.

ceki pushed a commit to branch branch_1.2.18
in repository https://gitbox.apache.org/repos/asf/logging-log4j1.git

commit 6661fce5be812ea325974e26d7ca668c5a28675b
Author: Ceki Gulcu <ce...@qos.ch>
AuthorDate: Thu Jan 6 19:32:45 2022 +0100

    correct path for LoggingEventTest
    
    Signed-off-by: Ceki Gulcu <ce...@qos.ch>
---
 src/test/java/org/apache/log4j/TestContants.java   | 25 ++++++++++++++++++++++
 .../org/apache/log4j/spi/LoggingEventTest.java     | 25 ++++++++++++----------
 2 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/src/test/java/org/apache/log4j/TestContants.java b/src/test/java/org/apache/log4j/TestContants.java
new file mode 100755
index 0000000..52f9de3
--- /dev/null
+++ b/src/test/java/org/apache/log4j/TestContants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.log4j;
+
+public class TestContants {
+
+	public static final String TEST_SRC_PREFIX = "src/test/";
+	public static final String TEST_WITNESS_PREFIX = TEST_SRC_PREFIX + "witness/";
+
+}
diff --git a/src/test/java/org/apache/log4j/spi/LoggingEventTest.java b/src/test/java/org/apache/log4j/spi/LoggingEventTest.java
index 9dbec3a..473ea7c 100644
--- a/src/test/java/org/apache/log4j/spi/LoggingEventTest.java
+++ b/src/test/java/org/apache/log4j/spi/LoggingEventTest.java
@@ -17,15 +17,18 @@
 
 package org.apache.log4j.spi;
 
-import junit.framework.TestCase;
+import static org.apache.log4j.TestContants.TEST_WITNESS_PREFIX;
 
+import org.apache.log4j.Category;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.MDC;
 import org.apache.log4j.NDC;
-import org.apache.log4j.util.SerializationTestHelper;
 import org.apache.log4j.Priority;
-import org.apache.log4j.Category;
+import org.apache.log4j.TestContants;
+import org.apache.log4j.util.SerializationTestHelper;
+
+import junit.framework.TestCase;
 
 
 /**
@@ -57,7 +60,7 @@ public class LoggingEventTest extends TestCase {
 
     int[] skip = new int[] { 352, 353, 354, 355, 356 };
     SerializationTestHelper.assertSerializationEquals(
-      "witness/serialization/simple.bin", event, skip, 237);
+      TEST_WITNESS_PREFIX+"serialization/simple.bin", event, skip, 237);
   }
 
   /**
@@ -76,7 +79,7 @@ public class LoggingEventTest extends TestCase {
 
     int[] skip = new int[] { 352, 353, 354, 355, 356 };
     SerializationTestHelper.assertSerializationEquals(
-      "witness/serialization/exception.bin", event, skip, 237);
+      TEST_WITNESS_PREFIX+"serialization/exception.bin", event, skip, 237);
   }
 
   /**
@@ -95,7 +98,7 @@ public class LoggingEventTest extends TestCase {
 
     int[] skip = new int[] { 352, 353, 354, 355, 356 };
     SerializationTestHelper.assertSerializationEquals(
-      "witness/serialization/location.bin", event, skip, 237);
+    		TEST_WITNESS_PREFIX+"serialization/location.bin", event, skip, 237);
   }
 
   /**
@@ -114,7 +117,7 @@ public class LoggingEventTest extends TestCase {
 
     int[] skip = new int[] { 352, 353, 354, 355, 356 };
     SerializationTestHelper.assertSerializationEquals(
-      "witness/serialization/ndc.bin", event, skip, 237);
+    		TEST_WITNESS_PREFIX+"serialization/ndc.bin", event, skip, 237);
     }
 
   /**
@@ -133,7 +136,7 @@ public class LoggingEventTest extends TestCase {
 
     int[] skip = new int[] { 352, 353, 354, 355, 356 };
     SerializationTestHelper.assertSerializationEquals(
-      "witness/serialization/mdc.bin", event, skip, 237);
+    		TEST_WITNESS_PREFIX+"serialization/mdc.bin", event, skip, 237);
   }
 
   /**
@@ -144,7 +147,7 @@ public class LoggingEventTest extends TestCase {
   public void testDeserializationSimple() throws Exception {
     Object obj =
       SerializationTestHelper.deserializeStream(
-        "witness/serialization/simple.bin");
+    		  TEST_WITNESS_PREFIX+"serialization/simple.bin");
     assertTrue(obj instanceof LoggingEvent);
 
     LoggingEvent event = (LoggingEvent) obj;
@@ -160,7 +163,7 @@ public class LoggingEventTest extends TestCase {
   public void testDeserializationWithException() throws Exception {
     Object obj =
       SerializationTestHelper.deserializeStream(
-        "witness/serialization/exception.bin");
+    		  TEST_WITNESS_PREFIX+"serialization/exception.bin");
     assertTrue(obj instanceof LoggingEvent);
 
     LoggingEvent event = (LoggingEvent) obj;
@@ -176,7 +179,7 @@ public class LoggingEventTest extends TestCase {
   public void testDeserializationWithLocation() throws Exception {
     Object obj =
       SerializationTestHelper.deserializeStream(
-        "witness/serialization/location.bin");
+    		  TEST_WITNESS_PREFIX+"serialization/location.bin");
     assertTrue(obj instanceof LoggingEvent);
 
     LoggingEvent event = (LoggingEvent) obj;