logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickwilli...@apache.org
Subject svn commit: r1505258 - in /logging/log4j/log4j2/trunk/core/src/test: java/org/apache/logging/log4j/core/appender/db/jdbc/ java/org/apache/logging/log4j/core/appender/db/jpa/ resources/META-INF/ resources/org/apache/logging/log4j/core/appender/db/jpa/
Date Sun, 21 Jul 2013 03:50:14 GMT
Author: nickwilliams
Date: Sun Jul 21 03:50:13 2013
New Revision: 1505258

URL: http://svn.apache.org/r1505258
Log:
Changing the JPAAppender tests to test against both HyperSql and H2

Added:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
      - copied, changed from r1505255, logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaH2AppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaHyperSqlAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-base.xml
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-basic.xml
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-base.xml
      - copied, changed from r1505218, logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-base.xml
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-basic.xml
      - copied, changed from r1505255, logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-basic.xml
Removed:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-base.xml
    logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-basic.xml
Modified:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/resources/META-INF/persistence.xml

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java?rev=1505258&r1=1505257&r2=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -94,7 +94,8 @@ public abstract class AbstractJdbcAppend
                     if (statement != null) {
                         statement.close();
                     }
-                } catch (final SQLException ignore) { /* */
+                } catch (final SQLException ignore) {
+                    /* */
                 }
             }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java?rev=1505258&r1=1505257&r2=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -24,8 +24,8 @@ import java.sql.SQLException;
  * Tests the JDBC appender with the H2 database in memory.
  */
 public class JdbcH2AppenderTest extends AbstractJdbcAppenderTest {
-    private static final String PASSWORD = "";
     private static final String USER_ID = "sa";
+    private static final String PASSWORD = "";
 
     public JdbcH2AppenderTest() {
         super("h2");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java?rev=1505258&r1=1505257&r2=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -24,8 +24,8 @@ import java.sql.SQLException;
  * Tests the JDBC appender with the HyperSQL database (a.k.a. HSQLDB) in memory.
  */
 public class JdbcHyperSqlAppenderTest extends AbstractJdbcAppenderTest {
-    private static final String PASSWORD = "";
     private static final String USER_ID = "sa";
+    private static final String PASSWORD = "";
 
     public JdbcHyperSqlAppenderTest() {
         super("hsqldb");

Copied: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
(from r1505255, logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppenderTest.java)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java?p2=logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java&p1=logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppenderTest.java&r1=1505255&r2=1505258&rev=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/AbstractJpaAppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -19,7 +19,6 @@ package org.apache.logging.log4j.core.ap
 import java.io.ByteArrayOutputStream;
 import java.io.PrintWriter;
 import java.sql.Connection;
-import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
@@ -28,7 +27,6 @@ import java.util.Map;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Appender;
-import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
 import org.apache.logging.log4j.core.config.DefaultConfiguration;
@@ -37,27 +35,18 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
-public class JPAAppenderTest {
+public abstract class AbstractJpaAppenderTest {
+    private final String databaseType;
     private Connection connection;
 
-    public void setUp(final String configFileName) throws SQLException {
-        this.connection = DriverManager.getConnection("jdbc:hsqldb:mem:Log4j", "sa", "");
+    public AbstractJpaAppenderTest(final String databaseType) {
+        this.databaseType = databaseType;
+    }
 
-        Statement statement = this.connection.createStatement();
-        statement.executeUpdate("CREATE TABLE jpaBaseLogEntry ( " +
-                    "id INTEGER IDENTITY, eventDate DATETIME, level VARCHAR(10), logger VARCHAR(255),
" +
-                    "message VARCHAR(1024), exception VARCHAR(1048576)" +
-                " )");
-        statement.close();
-
-        statement = this.connection.createStatement();
-        statement.executeUpdate("CREATE TABLE jpaBasicLogEntry ( " +
-                    "id INTEGER IDENTITY, millis BIGINT, level VARCHAR(10), loggerName VARCHAR(255),
" +
-                    "message VARCHAR(1024), thrown VARCHAR(1048576), contextMapJson VARCHAR(1048576),"
+
-                    "fqcn VARCHAR(1024), contextStack VARCHAR(1048576), marker VARCHAR(255),
source VARCHAR(2048)," +
-                    "threadName VARCHAR(255)" +
-                " )");
-        statement.close();
+    protected abstract Connection setUpConnection() throws SQLException;
+
+    public void setUp(final String configFileName) throws SQLException {
+        this.connection = this.setUpConnection();
 
         System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY,
                 "org/apache/logging/log4j/core/appender/db/jpa/" + configFileName);
@@ -100,56 +89,9 @@ public class JPAAppenderTest {
     }
 
     @Test
-    public void testNoEntityClassName() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
null, "jpaAppenderTestUnit");
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
-    public void testNoPersistenceUnitName() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
TestBaseEntity.class.getName(),
-                null);
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
-    public void testBadEntityClassName() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
"com.foo.Bar",
-                "jpaAppenderTestUnit");
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
-    public void testNonLogEventEntity() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
Object.class.getName(),
-                "jpaAppenderTestUnit");
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
-    public void testBadConstructorEntity01() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
-                BadConstructorEntity1.class.getName(), "jpaAppenderTestUnit");
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
-    public void testBadConstructorEntity02() {
-        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
-                BadConstructorEntity2.class.getName(), "jpaAppenderTestUnit");
-
-        assertNull("The appender should be null.", appender);
-    }
-
-    @Test
     public void testBaseJpaEntityAppender() throws SQLException {
         try {
-            this.setUp("log4j2-jpa-base.xml");
+            this.setUp("log4j2-" + this.databaseType + "-jpa-base.xml");
 
             final RuntimeException exception = new RuntimeException("Hello, world!");
             final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -211,7 +153,7 @@ public class JPAAppenderTest {
     @Test
     public void testBasicJpaEntityAppender() throws SQLException {
         try {
-            this.setUp("log4j2-jpa-basic.xml");
+            this.setUp("log4j2-" + this.databaseType + "-jpa-basic.xml");
 
             final Error exception = new Error("Goodbye, cruel world!");
             final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -273,7 +215,7 @@ public class JPAAppenderTest {
     @Test
     public void testPerformanceOfAppenderWith10000EventsUsingBasicEntity() throws SQLException
{
         try {
-            this.setUp("log4j2-jpa-basic.xml");
+            this.setUp("log4j2-" + this.databaseType + "-jpa-basic.xml");
 
             final Error exception = new Error("Goodbye, cruel world!");
 
@@ -281,7 +223,7 @@ public class JPAAppenderTest {
                     ".testPerformanceOfAppenderWith10000EventsUsingBasicEntity");
             logger.info("This is a warm-up message.");
 
-            System.out.println("Starting a performance test for JDBC Appender for hsqldb.");
+            System.out.println("Starting a performance test for JDBC Appender for " + this.databaseType
+ ".");
 
             long start = System.nanoTime();
 
@@ -304,31 +246,9 @@ public class JPAAppenderTest {
             assertEquals("The number of records is not correct.", 10001, resultSet.getRow());
 
             System.out.println("Wrote 10,000 log events in " + elapsed + " nanoseconds ("
+ elapsedMilli +
-                    " milliseconds) for hsqldb.");
+                    " milliseconds) for " + this.databaseType + ".");
         } finally {
             this.tearDown();
         }
     }
-
-    @SuppressWarnings("unused")
-    public static class BadConstructorEntity1 extends TestBaseEntity {
-        private static final long serialVersionUID = 1L;
-
-        public BadConstructorEntity1(final LogEvent wrappedEvent) {
-            super(wrappedEvent);
-        }
-    }
-
-    @SuppressWarnings("unused")
-    public static class BadConstructorEntity2 extends TestBaseEntity {
-        private static final long serialVersionUID = 1L;
-
-        public BadConstructorEntity2() {
-            super(null);
-        }
-
-        public BadConstructorEntity2(final LogEvent wrappedEvent, final String badParameter)
{
-            super(wrappedEvent);
-        }
-    }
 }

Added: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaH2AppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaH2AppenderTest.java?rev=1505258&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaH2AppenderTest.java
(added)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaH2AppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -0,0 +1,38 @@
+package org.apache.logging.log4j.core.appender.db.jpa;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class JpaH2AppenderTest extends AbstractJpaAppenderTest {
+    private static final String USER_ID = "sa";
+    private static final String PASSWORD = "";
+
+    public JpaH2AppenderTest() {
+        super("h2");
+    }
+
+    @Override
+    protected Connection setUpConnection() throws SQLException {
+        Connection connection = DriverManager.getConnection("jdbc:h2:mem:Log4j", USER_ID,
PASSWORD);
+
+        Statement statement = connection.createStatement();
+        statement.executeUpdate("CREATE TABLE jpaBaseLogEntry ( " +
+                "id INTEGER IDENTITY, eventDate DATETIME, level NVARCHAR(10), logger NVARCHAR(255),
" +
+                "message NVARCHAR(1024), exception NVARCHAR(1048576)" +
+                " )");
+        statement.close();
+
+        statement = connection.createStatement();
+        statement.executeUpdate("CREATE TABLE jpaBasicLogEntry ( " +
+                "id INTEGER IDENTITY, millis BIGINT, level NVARCHAR(10), loggerName NVARCHAR(255),
" +
+                "message NVARCHAR(1024), thrown NVARCHAR(1048576), contextMapJson NVARCHAR(1048576),"
+
+                "fqcn NVARCHAR(1024), contextStack NVARCHAR(1048576), marker NVARCHAR(255),
source NVARCHAR(2048)," +
+                "threadName NVARCHAR(255)" +
+                " )");
+        statement.close();
+
+        return connection;
+    }
+}

Added: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaHyperSqlAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaHyperSqlAppenderTest.java?rev=1505258&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaHyperSqlAppenderTest.java
(added)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/JpaHyperSqlAppenderTest.java
Sun Jul 21 03:50:13 2013
@@ -0,0 +1,112 @@
+package org.apache.logging.log4j.core.appender.db.jpa;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNull;
+
+public class JpaHyperSqlAppenderTest extends AbstractJpaAppenderTest {
+    private static final String USER_ID = "sa";
+    private static final String PASSWORD = "";
+
+    public JpaHyperSqlAppenderTest() {
+        super("hsqldb");
+    }
+
+    @Override
+    protected Connection setUpConnection() throws SQLException {
+        Connection connection = DriverManager.getConnection("jdbc:hsqldb:mem:Log4j", USER_ID,
PASSWORD);
+
+        Statement statement = connection.createStatement();
+        statement.executeUpdate("CREATE TABLE jpaBaseLogEntry ( " +
+                "id INTEGER IDENTITY, eventDate DATETIME, level VARCHAR(10), logger VARCHAR(255),
" +
+                "message VARCHAR(1024), exception VARCHAR(1048576)" +
+                " )");
+        statement.close();
+
+        statement = connection.createStatement();
+        statement.executeUpdate("CREATE TABLE jpaBasicLogEntry ( " +
+                "id INTEGER IDENTITY, millis BIGINT, level VARCHAR(10), loggerName VARCHAR(255),
" +
+                "message VARCHAR(1024), thrown VARCHAR(1048576), contextMapJson VARCHAR(1048576),"
+
+                "fqcn VARCHAR(1024), contextStack VARCHAR(1048576), marker VARCHAR(255),
source VARCHAR(2048)," +
+                "threadName VARCHAR(255)" +
+                " )");
+        statement.close();
+
+        return connection;
+    }
+
+    @Test
+    public void testNoEntityClassName() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
null, "jpaAppenderTestUnit");
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @Test
+    public void testNoPersistenceUnitName() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
TestBaseEntity.class.getName(),
+                null);
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @Test
+    public void testBadEntityClassName() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
"com.foo.Bar",
+                "jpaAppenderTestUnit");
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @Test
+    public void testNonLogEventEntity() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
Object.class.getName(),
+                "jpaAppenderTestUnit");
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @Test
+    public void testBadConstructorEntity01() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
+                BadConstructorEntity1.class.getName(), "jpaAppenderTestUnit");
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @Test
+    public void testBadConstructorEntity02() {
+        final JPAAppender appender = JPAAppender.createAppender("name", null, null, null,
+                BadConstructorEntity2.class.getName(), "jpaAppenderTestUnit");
+
+        assertNull("The appender should be null.", appender);
+    }
+
+    @SuppressWarnings("unused")
+    public static class BadConstructorEntity1 extends TestBaseEntity {
+        private static final long serialVersionUID = 1L;
+
+        public BadConstructorEntity1(final LogEvent wrappedEvent) {
+            super(wrappedEvent);
+        }
+    }
+
+    @SuppressWarnings("unused")
+    public static class BadConstructorEntity2 extends TestBaseEntity {
+        private static final long serialVersionUID = 1L;
+
+        public BadConstructorEntity2() {
+            super(null);
+        }
+
+        public BadConstructorEntity2(final LogEvent wrappedEvent, final String badParameter)
{
+            super(wrappedEvent);
+        }
+    }
+}

Modified: logging/log4j/log4j2/trunk/core/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/resources/META-INF/persistence.xml?rev=1505258&r1=1505257&r2=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/resources/META-INF/persistence.xml (original)
+++ logging/log4j/log4j2/trunk/core/src/test/resources/META-INF/persistence.xml Sun Jul 21
03:50:13 2013
@@ -22,10 +22,8 @@
                                  http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
              version="2.1">
 
-  <persistence-unit name="jpaAppenderTestUnit">
+  <persistence-unit name="hyperSqlJpaAppenderTestUnit">
     <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-    <class>org.apache.logging.log4j.core.appender.db.jpa.TestBaseEntity</class>
-    <class>org.apache.logging.log4j.core.appender.db.jpa.TestBasicEntity</class>
     <exclude-unlisted-classes>false</exclude-unlisted-classes>
     <shared-cache-mode>NONE</shared-cache-mode>
     <properties>
@@ -39,4 +37,19 @@
     </properties>
   </persistence-unit>
 
+  <persistence-unit name="h2JpaAppenderTestUnit">
+    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+    <exclude-unlisted-classes>false</exclude-unlisted-classes>
+    <shared-cache-mode>NONE</shared-cache-mode>
+    <properties>
+      <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
+      <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:Log4j"/>
+      <property name="javax.persistence.jdbc.user" value="sa"/>
+      <property name="javax.persistence.jdbc.password" value=""/>
+      <!--<property name="eclipselink.logging.level" value="FINE"/>
+      <property name="eclipselink.logging.level.sql" value="FINE"/>
+      <property name="eclipselink.logging.parameters" value="true"/> uncomment to troubleshoot
SQL-->
+    </properties>
+  </persistence-unit>
+
 </persistence>

Added: logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-base.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-base.xml?rev=1505258&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-base.xml
(added)
+++ logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-base.xml
Sun Jul 21 03:50:13 2013
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<configuration status="debug">
+
+  <appenders>
+    <Console name="STDOUT">
+      <PatternLayout pattern="%C{1.} %m %level MDC%X%n"/>
+    </Console>
+    <Jpa name="databaseAppender" persistenceUnitName="h2JpaAppenderTestUnit"
+         entityClassName="org.apache.logging.log4j.core.appender.db.jpa.TestBaseEntity" ignoreExceptions="false"
/>
+  </appenders>
+
+  <loggers>
+    <logger name="org.apache.logging.log4j.core.appender.db" level="debug">
+      <appender-ref ref="databaseAppender" />
+    </logger>
+
+    <root level="error">
+      <appender-ref ref="STDOUT"/>
+    </root>
+  </loggers>
+
+</configuration>

Added: logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-basic.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-basic.xml?rev=1505258&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-basic.xml
(added)
+++ logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-h2-jpa-basic.xml
Sun Jul 21 03:50:13 2013
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<configuration status="debug">
+
+  <appenders>
+    <Console name="STDOUT">
+      <PatternLayout pattern="%C{1.} %m %level MDC%X%n"/>
+    </Console>
+    <Jpa name="databaseAppender" persistenceUnitName="h2JpaAppenderTestUnit"
+         entityClassName="org.apache.logging.log4j.core.appender.db.jpa.TestBasicEntity"
ignoreExceptions="false" />
+  </appenders>
+
+  <loggers>
+    <logger name="org.apache.logging.log4j.core.appender.db" level="debug" additivity="false">
+      <appender-ref ref="databaseAppender" />
+    </logger>
+
+    <root level="error">
+      <appender-ref ref="STDOUT"/>
+    </root>
+  </loggers>
+
+</configuration>

Copied: logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-base.xml
(from r1505218, logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-base.xml)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-base.xml?p2=logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-base.xml&p1=logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-base.xml&r1=1505218&r2=1505258&rev=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-base.xml
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-base.xml
Sun Jul 21 03:50:13 2013
@@ -21,7 +21,7 @@
     <Console name="STDOUT">
       <PatternLayout pattern="%C{1.} %m %level MDC%X%n"/>
     </Console>
-    <Jpa name="databaseAppender" persistenceUnitName="jpaAppenderTestUnit"
+    <Jpa name="databaseAppender" persistenceUnitName="hyperSqlJpaAppenderTestUnit"
          entityClassName="org.apache.logging.log4j.core.appender.db.jpa.TestBaseEntity" ignoreExceptions="false"
/>
   </appenders>
 

Copied: logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-basic.xml
(from r1505255, logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-basic.xml)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-basic.xml?p2=logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-basic.xml&p1=logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-basic.xml&r1=1505255&r2=1505258&rev=1505258&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-jpa-basic.xml
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/resources/org/apache/logging/log4j/core/appender/db/jpa/log4j2-hsqldb-jpa-basic.xml
Sun Jul 21 03:50:13 2013
@@ -21,7 +21,7 @@
     <Console name="STDOUT">
       <PatternLayout pattern="%C{1.} %m %level MDC%X%n"/>
     </Console>
-    <Jpa name="databaseAppender" persistenceUnitName="jpaAppenderTestUnit"
+    <Jpa name="databaseAppender" persistenceUnitName="hyperSqlJpaAppenderTestUnit"
          entityClassName="org.apache.logging.log4j.core.appender.db.jpa.TestBasicEntity"
ignoreExceptions="false" />
   </appenders>
 



Mime
View raw message