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 TestEventType extends TestCase
8   {
9       protected void tearDown() throws Exception
10      {
11          JohnsonConfig.setInstance(null);
12          super.tearDown();
13      }
14  
15      public void testEventType()
16      {
17          EventType type = new EventType("foo", "bar");
18          assertEquals("foo", type.getType());
19          assertEquals("bar", type.getDescription());
20      }
21  
22      public void testGetEventType() throws ConfigurationException
23      {
24          JohnsonConfig.setInstance(new JohnsonConfig("test-johnson-config.xml"));
25  
26          EventType expectedWarning = new EventType("database", "Database");
27          assertEquals(expectedWarning, EventType.get("database"));
28      }
29  }