@Test
public void testConfigs() {

    Properties props = new Properties();
    
    try {
        // Fail when no props are given
        JMSMain.createSources(props);
        fail("Didn't exit when missing authToken and sources");
    } catch (ExitException e) {
        assert e.getMessage().equals("Exit Requested: auth token was not specified.");
        // Expected this Exception
    }
    
    try {
        // Fail when only authToken is set
        props.setProperty("authToken", "a token");
        JMSMain.createSources(props);
        fail("Didn't exit when missing sources");
    } catch (ExitException e) {
        assert e.getMessage().equals("Exit Requested: source(s) not specified.");
        // Expected this Exception
    }
    
    try {
        // Fail when only authToken and sources are set
        props.setProperty("sources", "a source");
        JMSMain.createSources(props);
        fail("Didn't exit when missing server");
    } catch (ExitException e) {
        assert e.getMessage().equals("Exit Requested: target server not specified.");
        // Expected this Exception
    }
    
    // Succeed when authToken, targetVantiqServer, and sources are set
    props.setProperty("sources", "s");
    props.setProperty("targetServer", "url");
    JMSMain.createSources(props);
    assert JMSMain.targetVantiqServer.equals("url");
    JMSCore s = JMSMain.sources.get(0);
    assert s.getSourceName().equals("s");
    s.stop();
    
    try {
        // Fail when only sources is set
        props.remove("authToken");
        JMSMain.createSources(props);
        fail("Didn't exit when missing authToken");
    } catch (ExitException e) {
        assert e.getMessage().equals("Exit Requested: auth token was not specified.");
        // Expected this Exception
    }
    
    String targetServer = "dev.vantiq.com";
    props.setProperty("authToken", "a token");
    props.setProperty("sources", "s2, s1  ");
    props.setProperty("targetServer", targetServer);
    JMSMain.createSources(props);
    assert JMSMain.targetVantiqServer.equals(targetServer);
    JMSCore s1 = JMSMain.sources.get(0);
    JMSCore s2 = JMSMain.sources.get(1);
    assert s1.getSourceName().equals("s1") || s2.getSourceName().equals("s1");
    assert s1.getSourceName().equals("s2") || s2.getSourceName().equals("s2");
    s1.stop();
    s2.stop();
}