source: josm/trunk/test/unit/org/openstreetmap/josm/plugins/PluginExceptionTest.java

Last change on this file was 18037, checked in by Don-vip, 3 years ago

fix #21064 - Add JUnit 5 extension for preferences (patch by taylor.smock)

  • Property svn:eol-style set to native
File size: 909 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5
6import org.junit.jupiter.api.Test;
7
8/**
9 * Unit tests of {@link PluginException} class.
10 */
11class PluginExceptionTest {
12 /**
13 * Unit test of {@link PluginException#PluginException}.
14 */
15 @Test
16 void testPluginDownloadException() {
17 PluginException ex = new PluginException("foo");
18 assertEquals("foo", ex.getMessage());
19 NullPointerException npe = new NullPointerException();
20 ex = new PluginException("bar", npe);
21 assertEquals("An error occurred in plugin bar", ex.getMessage());
22 assertEquals(npe, ex.getCause());
23 ex = new PluginException(null, "foobar", npe);
24 assertEquals("An error occurred in plugin foobar", ex.getMessage());
25 assertEquals(npe, ex.getCause());
26 }
27}
Note: See TracBrowser for help on using the repository browser.