source: josm/trunk/test/unit/org/openstreetmap/josm/plugins/PluginDownloadExceptionTest.java@ 12337

Last change on this file since 12337 was 10050, checked in by Don-vip, 8 years ago

add more unit tests

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins;
3
4import static org.junit.Assert.assertEquals;
5
6import org.junit.BeforeClass;
7import org.junit.Test;
8import org.openstreetmap.josm.JOSMFixture;
9
10/**
11 * Unit tests of {@link PluginDownloadException} class.
12 */
13public class PluginDownloadExceptionTest {
14
15 /**
16 * Setup test.
17 */
18 @BeforeClass
19 public static void setUp() {
20 JOSMFixture.createUnitTestFixture().init();
21 }
22
23 /**
24 * Unit test of {@link PluginDownloadException#PluginDownloadException}.
25 */
26 @Test
27 public void testPluginDownloadException() {
28 PluginDownloadException ex = new PluginDownloadException("foo");
29 assertEquals("foo", ex.getMessage());
30 NullPointerException npe = new NullPointerException();
31 ex = new PluginDownloadException(npe);
32 assertEquals(npe, ex.getCause());
33 ex = new PluginDownloadException("bar", npe);
34 assertEquals("bar", ex.getMessage());
35 assertEquals(npe, ex.getCause());
36 }
37}
Note: See TracBrowser for help on using the repository browser.