/*
 * Copyright (C) 2013 Klaus Reimer <k@ailis.de>
 * See LICENSE.md for licensing information.
 */

package org.usb4java.javax;

import static org.junit.Assert.assertEquals;

import java.util.Properties;

import org.junit.Test;
import org.usb4java.javax.Config;

/**
 * Tests the {@link Config} class.
 * 
 * @author Klaus Reimer (k@ailis.de)
 */
public class ConfigTest
{    
    /**
     * Tests the default configuration
     */
    @Test
    public void testDefaultConfiguration()
    {
        final Properties properties = new Properties();
        final Config config = new Config(properties);
        assertEquals(5000, config.getTimeout());
        assertEquals(500, config.getScanInterval());
    }
    
    /**
     * Tests the scan interval configuration.
     */
    @Test
    public void testScanIntervalConfiguration()
    {
        final Properties properties = new Properties();
        properties.put("org.usb4java.javax.scanInterval", "123");
        final Config config = new Config(properties);
        assertEquals(123, config.getScanInterval());
    }
    
    /**
     * Tests the timeout configuration.
     */
    @Test
    public void testTimeoutConfiguration()
    {
        final Properties properties = new Properties();
        properties.put("org.usb4java.javax.timeout", "1234");
        final Config config = new Config(properties);
        assertEquals(1234, config.getTimeout());
    }
}

@@ -167,16 +167,103 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aimport
@@ -385,17 +385,16 @@
 lass.%0A *
- 
 %0A * @aut
@@ -452,20 +452,16 @@
 igTest%0A%7B
-    
 %0A    /**
@@ -775,35 +775,73 @@
 nterval());%0A
+        assertFalse(config.isUseUSBDK());%0A
     %7D%0A
-    
 %0A
+
     /**%0A    
@@ -1193,13 +1193,9 @@
   %7D%0A
-    
 %0A
+
     
@@ -1469,32 +1469,32 @@
 ig(properties);%0A
-
         assertEq
@@ -1531,11 +1531,357 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Tests the USBDK usage flag configuration.%0A     */%0A    @Test%0A    public void testUseUSBDKConfiguration()%0A    %7B%0A        final Properties properties = new Properties();%0A        properties.put(%22org.usb4java.javax.useUSBDK%22, %22true%22);%0A        final Config config = new Config(properties);%0A        assertTrue(config.isUseUSBDK());%0A    %7D
 %0A%7D%0A

Add unit tests for usbdk config flag