Package org.apache.log4j

Examples of org.apache.log4j.Logger.removeAppender()


            ForceServiceConnector cacheHitConnector = new ForceServiceConnector(config);
            cacheHitConnector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
           
            logger.removeAppender(mockHitAppender);
            logger.removeAppender(mockMissAppender);
            logger.removeAppender(mockCheckAppender);
        }
       
        assertTrue(mockCheckAppender.receivedLogLine(), "Did not receive expected log line: " + expectedCheckLogLine);
View Full Code Here


            cacheHitConnector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
           
            logger.removeAppender(mockHitAppender);
            logger.removeAppender(mockMissAppender);
            logger.removeAppender(mockCheckAppender);
        }
       
        assertTrue(mockCheckAppender.receivedLogLine(), "Did not receive expected log line: " + expectedCheckLogLine);
        assertTrue(mockMissAppender.receivedLogLine(), "Did not receive expected log line: " + expectedMissLogLine);
View Full Code Here

        } finally {
            logger.setLevel(oldLevel);
           
            logger.removeAppender(mockHitAppender);
            logger.removeAppender(mockMissAppender);
            logger.removeAppender(mockCheckAppender);
        }
       
        assertTrue(mockCheckAppender.receivedLogLine(), "Did not receive expected log line: " + expectedCheckLogLine);
        assertTrue(mockMissAppender.receivedLogLine(), "Did not receive expected log line: " + expectedMissLogLine);
        assertTrue(mockHitAppender.receivedLogLine(), "Did not receive expected log line: " + expectedHitLogLine);
View Full Code Here

            connector.getMetadataConnection();
            connector.getBulkConnection();
            connector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockCheckAppender);
        }
       
        Assert.assertFalse(mockCheckAppender.receivedLogLine(), "The cache should not be checked when skipCache is set.");
        Assert.assertFalse(mockMissAppender.receivedLogLine(), "The cache should not be checked when skipCache is set.");
        Assert.assertFalse(mockHitAppender.receivedLogLine(), "The cache should not be checked when skipCache is set.");
View Full Code Here

        EntityManagerFactory emf =
            Persistence.createEntityManagerFactory("SchemaLoadInvocationFTest");
        emf.createEntityManager();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
        // if this test is run along with the rest of the force-jpa-test suite, the connector will have
        // already been instantiated previously, and the cache will always be hit (expected log line
        // will not appear).  if this test is run by itself, the cache will be missed only once
        // (expected log line will appear only once).
View Full Code Here

           
            Assert.assertTrue(receivedTableLog.get(), "Did not receive log messages for missing tables");
            Assert.assertTrue(receivedFieldLog.get(), "Did not receive log messages for missing fields");
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(appender);
        }
    }
   
    @Test
    /**
 
View Full Code Here

        try {
            logger.addAppender(appender);
            SecretKeySpec key = AESUtil.getSecretKey("incorrect-file-name");
            Assert.assertNotNull(key);
        } finally {
            logger.removeAppender(appender);
            logger.setLevel(origLevel);
        }

        Assert.assertTrue(appender.finishedPatterns());
    }
View Full Code Here

        try {
            logger.addAppender(appender);
            SecretKeySpec key = AESUtil.getSecretKey("funcconnurl.properties");
            Assert.assertNotNull(key);
        } finally {
            logger.removeAppender(appender);
            logger.setLevel(origLevel);
        }

         Assert.assertTrue(appender.finishedPatterns());
    }
View Full Code Here

            em.detach(entity);
            entity = em.merge(entity);
            em.remove(entity);
            tx.commit();
        } finally {
            logger.removeAppender(appender);
            logger.setLevel(origLevel);
        }
    }
   
    @Test
View Full Code Here

            emm.refresh(entityFromDb1);
            // The object should be overwritten from db and the junk text should be overwritten with the newString
            Assert.assertEquals(entityFromDb1.getStringObject(), newString);
            deleteObject(parent.getClass(), parent.getId(), emm);
        } finally {
            logger.removeAppender(appender);
            logger.setLevel(origLevel);
        }
    }
   
    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.