コード例 #1
0
 @Test
 public void intArgSetsCapacityIfPropertySpecified() throws Exception {
   System.setProperty("log4j2.ContextData", FactoryTestStringMap.class.getName());
   final FactoryTestStringMap actual =
       (FactoryTestStringMap) ContextDataFactory.createContextData(2);
   assertEquals(2, actual.initialCapacity);
   System.clearProperty("log4j2.ContextData");
 }
コード例 #2
0
 @Test
 public void intArgReturnsSpecifiedImplIfPropertySpecified() throws Exception {
   System.setProperty("log4j2.ContextData", FactoryTestStringMap.class.getName());
   assertTrue(ContextDataFactory.createContextData(2) instanceof FactoryTestStringMap);
   System.clearProperty("log4j2.ContextData");
 }