forked from usb4java/usb4java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoaderExceptionTest.java
More file actions
40 lines (35 loc) · 991 Bytes
/
LoaderExceptionTest.java
File metadata and controls
40 lines (35 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (C) 2014 Klaus Reimer <[email protected]>
* See LICENSE.md for licensing information.
*/
package org.usb4java;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* Tests the {@link LoaderException} class.
*
* @author Klaus Reimer ([email protected])
*/
public class LoaderExceptionTest
{
/**
* Tests the constructor with only an error message.
*/
@Test
public void testConstructorWithMessage()
{
final LoaderException e = new LoaderException("Custom message");
assertEquals("Custom message", e.getMessage());
}
/**
* Tests the constructor with an error message and a cause.
*/
@Test
public void testConstructorWithMessageAndCause()
{
final RuntimeException cause = new RuntimeException();
final LoaderException e = new LoaderException("Custom message", cause);
assertEquals("Custom message", e.getMessage());
assertEquals(cause, e.getCause());
}
}