Search in sources :

Example 1 with SettingsDTO

use of aQute.bnd.connection.settings.SettingsDTO in project bnd by bndtools.

the class SettingsParserTest method testServerSelection.

public void testServerSelection() throws Exception {
    SettingsDTO settings = getSettings("server-selection.xml");
    assertEquals(1, settings.servers.size());
    ServerDTO p = settings.servers.get(0);
    assertEquals("httpbin.org", p.id);
    assertEquals(null, p.passphrase);
    assertEquals(null, p.privateKey);
    assertEquals("user", p.username);
    assertEquals("passwd", p.password);
}
Also used : ServerDTO(aQute.bnd.connection.settings.ServerDTO) SettingsDTO(aQute.bnd.connection.settings.SettingsDTO)

Example 2 with SettingsDTO

use of aQute.bnd.connection.settings.SettingsDTO in project bnd by bndtools.

the class SettingsParserTest method testSocksAuth.

public void testSocksAuth() throws Exception {
    SettingsDTO settings = getSettings("socks-auth.xml");
    assertEquals(1, settings.proxies.size());
    ProxyDTO p = settings.proxies.get(0);
    assertEquals("myproxy", p.id);
    assertEquals(true, p.active);
    assertEquals(Type.SOCKS, p.protocol);
    assertEquals(1080, p.port);
    assertEquals(null, p.nonProxyHosts);
    assertEquals("proxyuser", p.username);
    assertEquals("somepassword", p.password);
}
Also used : ProxyDTO(aQute.bnd.connection.settings.ProxyDTO) SettingsDTO(aQute.bnd.connection.settings.SettingsDTO)

Example 3 with SettingsDTO

use of aQute.bnd.connection.settings.SettingsDTO in project bnd by bndtools.

the class SettingsParserTest method testSocksNoAuth.

public void testSocksNoAuth() throws Exception {
    SettingsDTO settings = getSettings("socks-noauth.xml");
    assertEquals(1, settings.proxies.size());
    ProxyDTO p = settings.proxies.get(0);
    assertEquals("myproxy", p.id);
    assertEquals(true, p.active);
    assertEquals(Type.SOCKS, p.protocol);
    assertEquals(1080, p.port);
    assertEquals(null, p.nonProxyHosts);
    assertEquals(null, p.username);
    assertEquals(null, p.password);
}
Also used : ProxyDTO(aQute.bnd.connection.settings.ProxyDTO) SettingsDTO(aQute.bnd.connection.settings.SettingsDTO)

Example 4 with SettingsDTO

use of aQute.bnd.connection.settings.SettingsDTO in project bnd by bndtools.

the class SettingsParserTest method testServerSelectionWithTrust.

public void testServerSelectionWithTrust() throws Exception {
    SettingsDTO settings = getSettings("server-trust-selection.xml");
    assertEquals(1, settings.servers.size());
    ServerDTO p = settings.servers.get(0);
    assertEquals("httpbin.org", p.id);
    assertNotNull(p.trust);
}
Also used : ServerDTO(aQute.bnd.connection.settings.ServerDTO) SettingsDTO(aQute.bnd.connection.settings.SettingsDTO)

Example 5 with SettingsDTO

use of aQute.bnd.connection.settings.SettingsDTO in project bnd by bndtools.

the class SettingsParserTest method getSettings.

public SettingsDTO getSettings(String name) throws Exception {
    File f = aQute.lib.io.IO.getFile("testresources/" + name);
    SettingsParser msp = new SettingsParser(f);
    SettingsDTO settings = msp.getSettings();
    return settings;
}
Also used : SettingsDTO(aQute.bnd.connection.settings.SettingsDTO) SettingsParser(aQute.bnd.connection.settings.SettingsParser) File(java.io.File)

Aggregations

SettingsDTO (aQute.bnd.connection.settings.SettingsDTO)6 ProxyDTO (aQute.bnd.connection.settings.ProxyDTO)3 ServerDTO (aQute.bnd.connection.settings.ServerDTO)2 SettingsParser (aQute.bnd.connection.settings.SettingsParser)1 File (java.io.File)1