View Javadoc

1   package com.atlassian.johnson.event;
2   
3   import com.atlassian.johnson.config.ConfigurationException;
4   import com.atlassian.johnson.config.JohnsonConfig;
5   import junit.framework.TestCase;
6   
7   public class TestEventLevel extends TestCase
8   {
9       protected void tearDown() throws Exception
10      {
11          JohnsonConfig.setInstance(null);
12          super.tearDown();
13      }
14  
15      public void testEventLevel()
16      {
17          EventLevel level = new EventLevel("foo", "bar");
18          assertEquals("foo", level.getLevel());
19          assertEquals("bar", level.getDescription());
20      }
21  
22      public void testGetEventLevel() throws ConfigurationException
23      {
24          JohnsonConfig.setInstance(new JohnsonConfig("test-johnson-config.xml"));
25  
26          EventLevel expectedWarning = new EventLevel("warning", "This is a warning buddy");
27          assertEquals(expectedWarning, EventLevel.get("warning"));
28      }
29  }