source: josm/test/org/openstreetmap/josm/plugins/PluginExceptionTest.java@ 267

Last change on this file since 267 was 267, checked in by imi, 17 years ago
  • added and fixed some tests
File size: 649 bytes
Line 
1package org.openstreetmap.josm.plugins;
2
3import junit.framework.TestCase;
4
5public class PluginExceptionTest extends TestCase {
6
7 public void testConstructorPassesExceptionParameterAndSetPluginName() {
8 RuntimeException barEx = new RuntimeException("bar");
9 PluginException e = new PluginException(new PluginProxy(new String(), null), "42", barEx);
10 assertEquals(barEx, e.getCause());
11 assertEquals("42", e.name);
12 }
13
14 public void testMessageContainsThePluginName() {
15 PluginException e = new PluginException(new PluginProxy(new String(), null), "42", new RuntimeException());
16 assertTrue(e.getMessage().contains("42"));
17 }
18}
Note: See TracBrowser for help on using the repository browser.