KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > api > AbstractViolationReporterTest


1 package com.puppycrawl.tools.checkstyle.api;
2
3 import junit.framework.TestCase;
4
5 /**
6  * Tests to ensure that default messagebundle is determined correctly.
7  *
8  * @author lkuehne
9  */

10 public class AbstractViolationReporterTest
11     extends TestCase
12 {
13     private final Check emptyCheck = new Check()
14     {
15         public int[] getDefaultTokens()
16         {
17             return new int[0];
18         }
19     };
20
21     public void testGetMessageBundleWithPackage()
22     {
23         assertEquals("com.mycompany.checks.messages",
24             emptyCheck.getMessageBundle("com.mycompany.checks.MyCoolCheck"));
25     }
26
27     public void testGetMessageBundleWithoutPackage()
28     {
29         assertEquals("messages",
30             emptyCheck.getMessageBundle("MyCoolCheck"));
31     }
32
33 }
34
Popular Tags