"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "logback-core/src/test/java/ch/qos/logback/core/joran/action/IncludeActionTest.java" between
logback-1.2.3.tar.gz and logback-v_1.2.7.tar.gz

About: Logback is a generic Logging Framework (intended as a log4j successor).

IncludeActionTest.java  (logback-1.2.3):IncludeActionTest.java  (logback-v_1.2.7)
skipping to change at line 186 skipping to change at line 186
while ((b = fis.read()) != -1) { while ((b = fis.read()) != -1) {
fos.write(b); fos.write(b);
} }
fis.close(); fis.close();
fos.close(); fos.close();
return out; return out;
} }
@Test @Test
public void malformedURL() throws JoranException { public void malformedURL() throws JoranException {
System.setProperty(INCLUDE_KEY, "htp://logback.qos.ch"); String MALFORMED = "htp://logback.qos.ch";
System.setProperty(INCLUDE_KEY, MALFORMED);
tc.doConfigure(TOP_BY_URL); tc.doConfigure(TOP_BY_URL);
assertEquals(Status.ERROR, statusChecker.getHighestLevel(0)); assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
assertTrue(statusChecker.containsException(MalformedURLException.class)) ; assertTrue(statusChecker.containsException(MalformedURLException.class)) ;
} }
@Test @Test
public void unknownURL() throws JoranException { public void unknownURL() throws JoranException {
System.setProperty(INCLUDE_KEY, "http://logback2345.qos.ch"); System.setProperty(INCLUDE_KEY, "http://logback2345.qos.ch");
tc.doConfigure(TOP_BY_URL); tc.doConfigure(TOP_BY_URL);
assertEquals(Status.WARN, statusChecker.getHighestLevel(0)); assertEquals(Status.WARN, statusChecker.getHighestLevel(0));
skipping to change at line 222 skipping to change at line 223
public void multiInclude() throws JoranException { public void multiInclude() throws JoranException {
System.setProperty(INCLUDE_KEY, INCLUDED_FILE); System.setProperty(INCLUDE_KEY, INCLUDED_FILE);
System.setProperty(SECOND_FILE_KEY, SECOND_FILE); System.setProperty(SECOND_FILE_KEY, SECOND_FILE);
tc.doConfigure(MULTI_INCLUDE_BY_FILE); tc.doConfigure(MULTI_INCLUDE_BY_FILE);
verifyConfig(new String[] { "IA", "IB", "SECOND" }); verifyConfig(new String[] { "IA", "IB", "SECOND" });
} }
@Test @Test
public void includeAsEntity() throws JoranException { public void includeAsEntity() throws JoranException {
tc.doConfigure(TOP_BY_ENTITY); tc.doConfigure(TOP_BY_ENTITY);
verifyConfig(new String[] { "EA", "EB" });
// entity inclusion disabled
// verifyConfig(new String[] { "EA", "EB" });
verifyConfig(new String[] { });
} }
void verifyConfig(String[] expected) { void verifyConfig(String[] expected) {
Stack<String> witness = new Stack<String>(); Stack<String> witness = new Stack<String>();
witness.addAll(Arrays.asList(expected)); witness.addAll(Arrays.asList(expected));
assertEquals(witness, stackAction.getStack()); assertEquals(witness, stackAction.getStack());
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)