PageRenderTime 27ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/apache-log4j-1.2.17/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java

#
Java | 589 lines | 446 code | 85 blank | 58 comment | 4 complexity | 824822d053dd52296858beeb916c841d MD5 | raw file
Possible License(s): Apache-2.0
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.log4j;
  18. import junit.framework.TestCase;
  19. import org.apache.log4j.util.AbsoluteDateAndTimeFilter;
  20. import org.apache.log4j.util.AbsoluteTimeFilter;
  21. import org.apache.log4j.util.Compare;
  22. import org.apache.log4j.util.ControlFilter;
  23. import org.apache.log4j.util.Filter;
  24. import org.apache.log4j.util.ISO8601Filter;
  25. import org.apache.log4j.util.EnhancedJunitTestRunnerFilter;
  26. import org.apache.log4j.util.EnhancedLineNumberFilter;
  27. import org.apache.log4j.util.RelativeTimeFilter;
  28. import org.apache.log4j.util.SunReflectFilter;
  29. import org.apache.log4j.util.Transformer;
  30. import org.apache.log4j.MDCOrderFilter;
  31. import org.apache.log4j.spi.ThrowableInformation;
  32. import java.text.ParsePosition;
  33. import java.text.SimpleDateFormat;
  34. import java.util.Date;
  35. import java.util.TimeZone;
  36. import java.io.*;
  37. public class EnhancedPatternLayoutTestCase extends TestCase {
  38. static String TEMP = "output/temp";
  39. static String FILTERED = "output/filtered";
  40. static String EXCEPTION1 = "java.lang.Exception: Just testing";
  41. static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
  42. static String EXCEPTION3 = "\\s*at .*\\((Native Method|Unknown Source)\\)";
  43. static String EXCEPTION4 = "\\s*at .*\\(.*Compiled Code\\)";
  44. static String PAT0 =
  45. "\\[main]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message \\d{1,2}";
  46. static String PAT1 = Filter.ISO8601_PAT + " " + PAT0;
  47. static String PAT2 = Filter.ABSOLUTE_DATE_AND_TIME_PAT + " " + PAT0;
  48. static String PAT3 = Filter.ABSOLUTE_TIME_PAT + " " + PAT0;
  49. static String PAT4 = Filter.RELATIVE_TIME_PAT + " " + PAT0;
  50. static String PAT5 =
  51. "\\[main]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* : Message \\d{1,2}";
  52. static String PAT6 =
  53. "\\[main]\\ (DEBUG|INFO |WARN |ERROR|FATAL) org.apache.log4j.EnhancedPatternLayoutTestCase.common\\(EnhancedPatternLayoutTestCase.java(:\\d{1,4})?\\): Message \\d{1,2}";
  54. static String PAT11a =
  55. "^(DEBUG|INFO |WARN |ERROR|FATAL) \\[main]\\ log4j.EnhancedPatternLayoutTest: Message \\d{1,2}";
  56. static String PAT11b =
  57. "^(DEBUG|INFO |WARN |ERROR|FATAL) \\[main]\\ root: Message \\d{1,2}";
  58. static String PAT12 =
  59. "^\\[main]\\ (DEBUG|INFO |WARN |ERROR|FATAL) "
  60. + "org.apache.log4j.EnhancedPatternLayoutTestCase.common\\(EnhancedPatternLayoutTestCase.java:\\d{3}\\): "
  61. + "Message \\d{1,2}";
  62. static String PAT13 =
  63. "^\\[main]\\ (DEBUG|INFO |WARN |ERROR|FATAL) "
  64. + "apache.log4j.EnhancedPatternLayoutTestCase.common\\(EnhancedPatternLayoutTestCase.java:\\d{3}\\): "
  65. + "Message \\d{1,2}";
  66. static String PAT14 =
  67. "^(TRACE|DEBUG| INFO| WARN|ERROR|FATAL)\\ \\d{1,2}\\ *- Message \\d{1,2}";
  68. static String PAT_MDC_1 = "";
  69. Logger root;
  70. Logger logger;
  71. public EnhancedPatternLayoutTestCase(final String name) {
  72. super(name);
  73. }
  74. public void setUp() {
  75. root = Logger.getRootLogger();
  76. logger = Logger.getLogger(EnhancedPatternLayoutTest.class);
  77. }
  78. public void tearDown() {
  79. root.getLoggerRepository().resetConfiguration();
  80. }
  81. /**
  82. * Configures log4j from a properties file resource in class loader path.
  83. * @param fileName resource name, only last element is significant.
  84. * @throws IOException if resource not found or error reading resource.
  85. */
  86. private static void configure(final String fileName) throws IOException {
  87. PropertyConfigurator.configure(fileName);
  88. }
  89. /**
  90. * Compares actual and expected files.
  91. * @param actual file name for file generated by test
  92. * @param expected resource name containing expected output
  93. * @return true if files are the same after adjustments
  94. * @throws IOException if IO error during comparison.
  95. */
  96. private static boolean compare(final String actual,
  97. final String expected) throws IOException {
  98. return Compare.compare(actual, expected);
  99. }
  100. public void test1() throws Exception {
  101. configure("input/pattern/enhancedPatternLayout1.properties");
  102. common();
  103. Transformer.transform(
  104. TEMP, FILTERED,
  105. new Filter[] {
  106. new EnhancedLineNumberFilter(), new SunReflectFilter(),
  107. new EnhancedJunitTestRunnerFilter()
  108. });
  109. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.1"));
  110. }
  111. public void test2() throws Exception {
  112. configure("input/pattern/enhancedPatternLayout2.properties");
  113. common();
  114. ControlFilter cf1 =
  115. new ControlFilter(
  116. new String[] { PAT1, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  117. Transformer.transform(
  118. TEMP, FILTERED,
  119. new Filter[] {
  120. cf1, new EnhancedLineNumberFilter(), new ISO8601Filter(),
  121. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  122. });
  123. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.2"));
  124. }
  125. public void test3() throws Exception {
  126. configure("input/pattern/enhancedPatternLayout3.properties");
  127. common();
  128. ControlFilter cf1 =
  129. new ControlFilter(
  130. new String[] { PAT1, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  131. Transformer.transform(
  132. TEMP, FILTERED,
  133. new Filter[] {
  134. cf1, new EnhancedLineNumberFilter(), new ISO8601Filter(),
  135. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  136. });
  137. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.3"));
  138. }
  139. // Output format:
  140. // 06 avr. 2002 18:30:58,937 [main] DEBUG atternLayoutTest - Message 0
  141. public void test4() throws Exception {
  142. configure("input/pattern/enhancedPatternLayout4.properties");
  143. common();
  144. ControlFilter cf1 =
  145. new ControlFilter(
  146. new String[] { PAT2, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  147. Transformer.transform(
  148. TEMP, FILTERED,
  149. new Filter[] {
  150. cf1, new EnhancedLineNumberFilter(), new AbsoluteDateAndTimeFilter(),
  151. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  152. });
  153. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.4"));
  154. }
  155. public void test5() throws Exception {
  156. configure("input/pattern/enhancedPatternLayout5.properties");
  157. common();
  158. ControlFilter cf1 =
  159. new ControlFilter(
  160. new String[] { PAT2, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  161. Transformer.transform(
  162. TEMP, FILTERED,
  163. new Filter[] {
  164. cf1, new EnhancedLineNumberFilter(), new AbsoluteDateAndTimeFilter(),
  165. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  166. });
  167. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.5"));
  168. }
  169. // 18:54:19,201 [main] DEBUG atternLayoutTest - Message 0
  170. public void test6() throws Exception {
  171. configure("input/pattern/enhancedPatternLayout6.properties");
  172. common();
  173. ControlFilter cf1 =
  174. new ControlFilter(
  175. new String[] { PAT3, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  176. Transformer.transform(
  177. TEMP, FILTERED,
  178. new Filter[] {
  179. cf1, new EnhancedLineNumberFilter(), new AbsoluteTimeFilter(),
  180. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  181. });
  182. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.6"));
  183. }
  184. public void test7() throws Exception {
  185. configure("input/pattern/enhancedPatternLayout7.properties");
  186. common();
  187. ControlFilter cf1 =
  188. new ControlFilter(
  189. new String[] { PAT3, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  190. Transformer.transform(
  191. TEMP, FILTERED,
  192. new Filter[] {
  193. cf1, new EnhancedLineNumberFilter(), new AbsoluteTimeFilter(),
  194. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  195. });
  196. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.7"));
  197. }
  198. public void test8() throws Exception {
  199. configure("input/pattern/enhancedPatternLayout8.properties");
  200. common();
  201. ControlFilter cf1 =
  202. new ControlFilter(
  203. new String[] { PAT4, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  204. Transformer.transform(
  205. TEMP, FILTERED,
  206. new Filter[] {
  207. cf1, new EnhancedLineNumberFilter(), new RelativeTimeFilter(),
  208. new SunReflectFilter(), new EnhancedJunitTestRunnerFilter()
  209. });
  210. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.8"));
  211. }
  212. public void test9() throws Exception {
  213. configure("input/pattern/enhancedPatternLayout9.properties");
  214. common();
  215. ControlFilter cf1 =
  216. new ControlFilter(
  217. new String[] { PAT5, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  218. Transformer.transform(
  219. TEMP, FILTERED,
  220. new Filter[] {
  221. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  222. new EnhancedJunitTestRunnerFilter()
  223. });
  224. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.9"));
  225. }
  226. public void test10() throws Exception {
  227. configure("input/pattern/enhancedPatternLayout10.properties");
  228. common();
  229. ControlFilter cf1 =
  230. new ControlFilter(
  231. new String[] { PAT6, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  232. Transformer.transform(
  233. TEMP, FILTERED,
  234. new Filter[] {
  235. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  236. new EnhancedJunitTestRunnerFilter()
  237. });
  238. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.10"));
  239. }
  240. public void test11() throws Exception {
  241. configure("input/pattern/enhancedPatternLayout11.properties");
  242. common();
  243. ControlFilter cf1 =
  244. new ControlFilter(
  245. new String[] { PAT11a, PAT11b, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  246. Transformer.transform(
  247. TEMP, FILTERED,
  248. new Filter[] {
  249. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  250. new EnhancedJunitTestRunnerFilter()
  251. });
  252. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.11"));
  253. }
  254. public void test12() throws Exception {
  255. configure("input/pattern/enhancedPatternLayout12.properties");
  256. common();
  257. ControlFilter cf1 =
  258. new ControlFilter(
  259. new String[] { PAT12, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  260. Transformer.transform(
  261. TEMP, FILTERED,
  262. new Filter[] {
  263. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  264. new EnhancedJunitTestRunnerFilter()
  265. });
  266. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.12"));
  267. }
  268. public void test13() throws Exception {
  269. configure("input/pattern/enhancedPatternLayout13.properties");
  270. common();
  271. ControlFilter cf1 =
  272. new ControlFilter(
  273. new String[] { PAT13, EXCEPTION1, EXCEPTION2, EXCEPTION3 });
  274. Transformer.transform(
  275. TEMP, FILTERED,
  276. new Filter[] {
  277. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  278. new EnhancedJunitTestRunnerFilter()
  279. });
  280. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.13"));
  281. }
  282. /**
  283. * Test of class abbreviation.
  284. *
  285. * @throws Exception
  286. */
  287. public void test14() throws Exception {
  288. configure("input/pattern/enhancedPatternLayout14.properties");
  289. common();
  290. Transformer.transform(
  291. TEMP, FILTERED,
  292. new Filter[] {
  293. new EnhancedLineNumberFilter(), new SunReflectFilter(),
  294. new EnhancedJunitTestRunnerFilter()
  295. });
  296. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.14"));
  297. }
  298. private static void clearMDC() throws Exception {
  299. java.util.Hashtable context = MDC.getContext();
  300. if (context != null) {
  301. context.clear();
  302. }
  303. }
  304. public void testMDC1() throws Exception {
  305. configure("input/pattern/enhancedPatternLayout.mdc.1.properties");
  306. clearMDC();
  307. MDC.put("key1", "va11");
  308. MDC.put("key2", "va12");
  309. logger.debug("Hello World");
  310. MDC.remove("key1");
  311. MDC.remove("key2");
  312. Transformer.transform(
  313. TEMP, FILTERED,
  314. new Filter[] {
  315. new EnhancedLineNumberFilter(), new SunReflectFilter(),
  316. new EnhancedJunitTestRunnerFilter(),
  317. new MDCOrderFilter()
  318. });
  319. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.mdc.1"));
  320. }
  321. /**
  322. * Tests log4j 1.2 style extension of EnhancedPatternLayout.
  323. * Was test14 in log4j 1.2.
  324. * @throws Exception
  325. */
  326. public void test15() throws Exception {
  327. configure("input/pattern/enhancedPatternLayout15.properties");
  328. common();
  329. ControlFilter cf1 = new ControlFilter(new String[]{PAT14, EXCEPTION1,
  330. EXCEPTION2, EXCEPTION3, EXCEPTION4});
  331. Transformer.transform(
  332. TEMP, FILTERED,
  333. new Filter[] {
  334. cf1, new EnhancedLineNumberFilter(), new SunReflectFilter(),
  335. new EnhancedJunitTestRunnerFilter()
  336. });
  337. assertTrue(compare(FILTERED, "witness/pattern/enhancedPatternLayout.15"));
  338. }
  339. /**
  340. * Tests explicit UTC time zone in pattern.
  341. * @throws Exception
  342. */
  343. public void test16() throws Exception {
  344. final long start = new Date().getTime();
  345. configure("input/pattern/enhancedPatternLayout16.properties");
  346. common();
  347. final long end = new Date().getTime();
  348. FileReader reader = new FileReader("output/patternLayout16.log");
  349. char chars[] = new char[50];
  350. reader.read(chars, 0, chars.length);
  351. reader.close();
  352. SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  353. format.setTimeZone(TimeZone.getTimeZone("GMT+0"));
  354. String utcStr = new String(chars, 0, 19);
  355. Date utcDate = format.parse(utcStr, new ParsePosition(0));
  356. assertTrue(utcDate.getTime() >= start - 1000 && utcDate.getTime() < end + 1000);
  357. String cstStr = new String(chars, 21, 19);
  358. format.setTimeZone(TimeZone.getTimeZone("GMT-6"));
  359. Date cstDate = format.parse(cstStr, new ParsePosition(0));
  360. assertFalse(cstStr.equals(utcStr));
  361. assertTrue(cstDate.getTime() >= start - 1000 && cstDate.getTime() < end + 1000);
  362. }
  363. void common() {
  364. int i = -1;
  365. logger.debug("Message " + ++i);
  366. root.debug("Message " + i);
  367. logger.info("Message " + ++i);
  368. root.info("Message " + i);
  369. logger.warn("Message " + ++i);
  370. root.warn("Message " + i);
  371. logger.error("Message " + ++i);
  372. root.error("Message " + i);
  373. logger.log(Level.FATAL, "Message " + ++i);
  374. root.log(Level.FATAL, "Message " + i);
  375. Exception e = new Exception("Just testing");
  376. logger.debug("Message " + ++i, e);
  377. logger.info("Message " + ++i, e);
  378. logger.warn("Message " + ++i, e);
  379. logger.error("Message " + ++i, e);
  380. logger.log(Level.FATAL, "Message " + ++i, e);
  381. }
  382. /**
  383. Test case for MDC conversion pattern. */
  384. public void testMDC2() throws Exception {
  385. String OUTPUT_FILE = "output/patternLayout.mdc.2";
  386. String WITNESS_FILE = "witness/pattern/enhancedPatternLayout.mdc.2";
  387. String mdcMsgPattern1 = "%m : %X%n";
  388. String mdcMsgPattern2 = "%m : %X{key1}%n";
  389. String mdcMsgPattern3 = "%m : %X{key2}%n";
  390. String mdcMsgPattern4 = "%m : %X{key3}%n";
  391. String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
  392. // set up appender
  393. EnhancedPatternLayout layout = new EnhancedPatternLayout("%m%n");
  394. Appender appender = new FileAppender(layout, OUTPUT_FILE, false);
  395. // set appender on root and set level to debug
  396. root.addAppender(appender);
  397. root.setLevel(Level.DEBUG);
  398. clearMDC();
  399. // output starting message
  400. root.debug("starting mdc pattern test");
  401. layout.setConversionPattern(mdcMsgPattern1);
  402. layout.activateOptions();
  403. root.debug("empty mdc, no key specified in pattern");
  404. layout.setConversionPattern(mdcMsgPattern2);
  405. layout.activateOptions();
  406. root.debug("empty mdc, key1 in pattern");
  407. layout.setConversionPattern(mdcMsgPattern3);
  408. layout.activateOptions();
  409. root.debug("empty mdc, key2 in pattern");
  410. layout.setConversionPattern(mdcMsgPattern4);
  411. layout.activateOptions();
  412. root.debug("empty mdc, key3 in pattern");
  413. layout.setConversionPattern(mdcMsgPattern5);
  414. layout.activateOptions();
  415. root.debug("empty mdc, key1, key2, and key3 in pattern");
  416. MDC.put("key1", "value1");
  417. MDC.put("key2", "value2");
  418. layout.setConversionPattern(mdcMsgPattern1);
  419. layout.activateOptions();
  420. root.debug("filled mdc, no key specified in pattern");
  421. layout.setConversionPattern(mdcMsgPattern2);
  422. layout.activateOptions();
  423. root.debug("filled mdc, key1 in pattern");
  424. layout.setConversionPattern(mdcMsgPattern3);
  425. layout.activateOptions();
  426. root.debug("filled mdc, key2 in pattern");
  427. layout.setConversionPattern(mdcMsgPattern4);
  428. layout.activateOptions();
  429. root.debug("filled mdc, key3 in pattern");
  430. layout.setConversionPattern(mdcMsgPattern5);
  431. layout.activateOptions();
  432. root.debug("filled mdc, key1, key2, and key3 in pattern");
  433. MDC.remove("key1");
  434. MDC.remove("key2");
  435. layout.setConversionPattern("%m%n");
  436. layout.activateOptions();
  437. root.debug("finished mdc pattern test");
  438. Transformer.transform(
  439. OUTPUT_FILE, FILTERED,
  440. new Filter[] {
  441. new EnhancedLineNumberFilter(), new SunReflectFilter(),
  442. new EnhancedJunitTestRunnerFilter(),
  443. new MDCOrderFilter()
  444. });
  445. assertTrue(compare(FILTERED, WITNESS_FILE));
  446. }
  447. /**
  448. Test case for throwable conversion pattern. */
  449. public void testThrowable() throws Exception {
  450. String OUTPUT_FILE = "output/patternLayout.throwable";
  451. String WITNESS_FILE = "witness/pattern/enhancedPatternLayout.throwable";
  452. // set up appender
  453. EnhancedPatternLayout layout = new EnhancedPatternLayout("%m%n");
  454. Appender appender = new FileAppender(layout, OUTPUT_FILE, false);
  455. // set appender on root and set level to debug
  456. root.addAppender(appender);
  457. root.setLevel(Level.DEBUG);
  458. // output starting message
  459. root.debug("starting throwable pattern test");
  460. Exception ex = new Exception("Test Exception");
  461. root.debug("plain pattern, no exception");
  462. root.debug("plain pattern, with exception", ex);
  463. layout.setConversionPattern("%m%n%throwable");
  464. layout.activateOptions();
  465. root.debug("%throwable, no exception");
  466. root.debug("%throwable, with exception", ex);
  467. layout.setConversionPattern("%m%n%throwable{short}");
  468. layout.activateOptions();
  469. root.debug("%throwable{short}, no exception");
  470. root.debug("%throwable{short}, with exception", ex);
  471. layout.setConversionPattern("%m%n%throwable{none}");
  472. layout.activateOptions();
  473. root.debug("%throwable{none}, no exception");
  474. root.debug("%throwable{none}, with exception", ex);
  475. layout.setConversionPattern("%m%n%throwable{0}");
  476. layout.activateOptions();
  477. root.debug("%throwable{0}, no exception");
  478. root.debug("%throwable{0}, with exception", ex);
  479. layout.setConversionPattern("%m%n%throwable{1}");
  480. layout.activateOptions();
  481. root.debug("%throwable{1}, no exception");
  482. root.debug("%throwable{1}, with exception", ex);
  483. layout.setConversionPattern("%m%n%throwable{100}");
  484. layout.activateOptions();
  485. root.debug("%throwable{100}, no exception");
  486. root.debug("%throwable{100}, with exception", ex);
  487. //
  488. // manufacture a pattern to get just the first two lines
  489. //
  490. String[] trace = new ThrowableInformation(ex).getThrowableStrRep();
  491. layout.setConversionPattern("%m%n%throwable{" + (2 - trace.length) + "}");
  492. layout.activateOptions();
  493. root.debug("%throwable{-n}, no exception");
  494. root.debug("%throwable{-n}, with exception", ex);
  495. Transformer.transform(
  496. OUTPUT_FILE, FILTERED,
  497. new Filter[] {
  498. new EnhancedLineNumberFilter(), new SunReflectFilter(),
  499. new EnhancedJunitTestRunnerFilter(),
  500. new MDCOrderFilter()
  501. });
  502. assertTrue(compare(FILTERED, WITNESS_FILE));
  503. }
  504. }