Search in sources :

Example 1 with URLManager

use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.

the class AtlasZookeeperURLManagerTest method doTestAtlasZooKeeperURLManager.

private void doTestAtlasZooKeeperURLManager(final String serviceName, final boolean enabled, final String ensemble, final String namespace) {
    HaServiceConfig config = new DefaultHaServiceConfig(serviceName);
    config.setEnabled(enabled);
    config.setZookeeperEnsemble(ensemble);
    config.setZookeeperNamespace(namespace);
    URLManager manager = URLManagerLoader.loadURLManager(config);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof AtlasZookeeperURLManager);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig)

Example 2 with URLManager

use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.

the class HBaseZookeeperURLManagerTest method testHBaseZookeeperURLManagerLoading.

@Test
public void testHBaseZookeeperURLManagerLoading() {
    HaServiceConfig config = new DefaultHaServiceConfig("WEBHBASE");
    config.setEnabled(true);
    config.setZookeeperEnsemble(cluster.getConnectString());
    URLManager manager = URLManagerLoader.loadURLManager(config);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof HBaseZookeeperURLManager);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig) Test(org.junit.Test)

Example 3 with URLManager

use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.

the class HS2ZookeeperURLManagerTest method testHS2URLManagerLoading.

@Test
public void testHS2URLManagerLoading() {
    HaServiceConfig config = new DefaultHaServiceConfig("HIVE");
    config.setEnabled(true);
    config.setZookeeperEnsemble(cluster.getConnectString());
    config.setZookeeperNamespace("hiveServer2");
    URLManager manager = URLManagerLoader.loadURLManager(config);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof HS2ZookeeperURLManager);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig) Test(org.junit.Test)

Example 4 with URLManager

use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.

the class SOLRZookeeperURLManagerTest method testSOLRZookeeperURLManagerLoading.

@Test
public void testSOLRZookeeperURLManagerLoading() {
    HaServiceConfig config = new DefaultHaServiceConfig("SOLR");
    config.setEnabled(true);
    config.setZookeeperEnsemble(cluster.getConnectString());
    URLManager manager = URLManagerLoader.loadURLManager(config);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof SOLRZookeeperURLManager);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig) Test(org.junit.Test)

Example 5 with URLManager

use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.

the class URLManagerLoaderTest method testDefaultURLManager.

@Test
public void testDefaultURLManager() {
    DefaultHaServiceConfig serviceConfig = new DefaultHaServiceConfig("nothing like this exists");
    URLManager manager = URLManagerLoader.loadURLManager(serviceConfig);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof DefaultURLManager);
    manager = URLManagerLoader.loadURLManager(null);
    Assert.assertNotNull(manager);
    Assert.assertTrue(manager instanceof DefaultURLManager);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) Test(org.junit.Test)

Aggregations

URLManager (org.apache.knox.gateway.ha.provider.URLManager)8 HaServiceConfig (org.apache.knox.gateway.ha.provider.HaServiceConfig)6 Test (org.junit.Test)6