Skip to content

Commit 57daf35

Browse files
committed
Add unit tests for usbdk config flag
1 parent 5ae0a7a commit 57daf35

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/test/java/org/usb4java/javax/ConfigTest.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
package org.usb4java.javax;
77

88
import static org.junit.Assert.assertEquals;
9+
import static org.junit.Assert.assertFalse;
10+
import static org.junit.Assert.assertTrue;
911

1012
import java.util.Properties;
1113

@@ -14,11 +16,11 @@
1416

1517
/**
1618
* Tests the {@link Config} class.
17-
*
19+
*
1820
* @author Klaus Reimer (k@ailis.de)
1921
*/
2022
public class ConfigTest
21-
{
23+
{
2224
/**
2325
* Tests the default configuration
2426
*/
@@ -29,8 +31,9 @@ public void testDefaultConfiguration()
2931
final Config config = new Config(properties);
3032
assertEquals(5000, config.getTimeout());
3133
assertEquals(500, config.getScanInterval());
34+
assertFalse(config.isUseUSBDK());
3235
}
33-
36+
3437
/**
3538
* Tests the scan interval configuration.
3639
*/
@@ -42,7 +45,7 @@ public void testScanIntervalConfiguration()
4245
final Config config = new Config(properties);
4346
assertEquals(123, config.getScanInterval());
4447
}
45-
48+
4649
/**
4750
* Tests the timeout configuration.
4851
*/
@@ -54,4 +57,16 @@ public void testTimeoutConfiguration()
5457
final Config config = new Config(properties);
5558
assertEquals(1234, config.getTimeout());
5659
}
60+
61+
/**
62+
* Tests the USBDK usage flag configuration.
63+
*/
64+
@Test
65+
public void testUseUSBDKConfiguration()
66+
{
67+
final Properties properties = new Properties();
68+
properties.put("org.usb4java.javax.useUSBDK", "true");
69+
final Config config = new Config(properties);
70+
assertTrue(config.isUseUSBDK());
71+
}
5772
}

0 commit comments

Comments
 (0)