Search in sources :

Example 11 with ServiceManagerEnvironment

use of org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment in project jbosstools-openshift by jbosstools.

the class CDKOpenshiftUtilityTest method testOpenshiftRegistryDefault.

@Test
public void testOpenshiftRegistryDefault() throws Exception {
    CDKOpenshiftUtility util = new CDKOpenshiftUtility();
    IServer s = mockServer("openshift36");
    createCDKFile("Basic", null, null);
    ServiceManagerEnvironment adb = createLoader(s, "10.1.2.2", "2376", null);
    ConnectionsRegistry registry = (ConnectionsRegistry) mock(ConnectionsRegistry.class);
    IConnection con = util.createOpenshiftConnection(adb, registry);
    assertNotNull(con);
    Object o = ((Connection) con).getExtendedProperties().get(ICommonAttributes.IMAGE_REGISTRY_URL_KEY);
    assertEquals("https://hub.openshift.rhel-cdk.10.1.2.2.xip.io", o);
}
Also used : IServer(org.eclipse.wst.server.core.IServer) ConnectionsRegistry(org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry) CDKOpenshiftUtility(org.jboss.tools.openshift.cdk.server.core.internal.listeners.CDKOpenshiftUtility) ServiceManagerEnvironment(org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment) IConnection(org.jboss.tools.openshift.common.core.connection.IConnection) Test(org.junit.Test)

Example 12 with ServiceManagerEnvironment

use of org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment in project jbosstools-openshift by jbosstools.

the class CDKOpenshiftUtilityTest method testOpenshiftConnectionCredentials.

@Test
public void testOpenshiftConnectionCredentials() throws Exception {
    CDKOpenshiftUtility util = new CDKOpenshiftUtility();
    IServer s = mockServer("openshift33");
    createCDKFile("Basic", null, null);
    ServiceManagerEnvironment adb = createLoader(s);
    IConnection con = util.createOpenshiftConnection(adb, null);
    assertNotNull(con);
    assertEquals(con.getUsername(), "openshift-dev");
    assertEquals(con.getPassword(), "devel");
    createCDKFile("Basic", "test", null);
    adb = createLoader(s);
    con = util.createOpenshiftConnection(adb, null);
    assertNotNull(con);
    assertEquals(con.getUsername(), "test");
    assertEquals(con.getPassword(), null);
    createCDKFile("Basic", "test", "pass");
    adb = createLoader(s);
    con = util.createOpenshiftConnection(adb, null);
    assertNotNull(con);
    assertEquals(con.getUsername(), "test");
    assertEquals(con.getPassword(), "pass");
}
Also used : IServer(org.eclipse.wst.server.core.IServer) CDKOpenshiftUtility(org.jboss.tools.openshift.cdk.server.core.internal.listeners.CDKOpenshiftUtility) ServiceManagerEnvironment(org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment) IConnection(org.jboss.tools.openshift.common.core.connection.IConnection) Test(org.junit.Test)

Example 13 with ServiceManagerEnvironment

use of org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment in project jbosstools-openshift by jbosstools.

the class ServiceManagerParsingTest method testServiceManager102Linux.

@Test
public void testServiceManager102Linux() throws Exception {
    String[] lines = serviceManager102Linux();
    HashMap<String, String> map = ServiceManagerUtility.parseLines(lines);
    ServiceManagerEnvironment env = new ServiceManagerEnvironment(map);
    serviceManager102(env, LIN_CERT_PATH);
}
Also used : ServiceManagerEnvironment(org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment) Test(org.junit.Test)

Example 14 with ServiceManagerEnvironment

use of org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment in project jbosstools-openshift by jbosstools.

the class ServiceManagerParsingTest method testServiceManager110Win.

@Test
public void testServiceManager110Win() throws Exception {
    String[] lines = serviceManager110Win();
    HashMap<String, String> map = ServiceManagerUtility.parseLines(lines);
    ServiceManagerEnvironment env = new ServiceManagerEnvironment(map);
    serviceManager110(env, WIN_CERT_PATH);
}
Also used : ServiceManagerEnvironment(org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment) Test(org.junit.Test)

Example 15 with ServiceManagerEnvironment

use of org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment in project jbosstools-openshift by jbosstools.

the class CDKOpenshiftUtilityTest method testOpenshiftRegistry.

@Test
public void testOpenshiftRegistry() throws Exception {
    CDKOpenshiftUtility util = new CDKOpenshiftUtility();
    IServer s = mockServer("openshift35");
    createCDKFile("Basic", null, null);
    ServiceManagerEnvironment adb = createLoader(s, "10.1.2.2", "2376", "https://custom.url");
    ConnectionsRegistry registry = (ConnectionsRegistry) mock(ConnectionsRegistry.class);
    IConnection con = util.createOpenshiftConnection(adb, registry);
    assertNotNull(con);
    Object o = ((Connection) con).getExtendedProperties().get(ICommonAttributes.IMAGE_REGISTRY_URL_KEY);
    assertEquals(o, "https://custom.url");
}
Also used : IServer(org.eclipse.wst.server.core.IServer) ConnectionsRegistry(org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry) CDKOpenshiftUtility(org.jboss.tools.openshift.cdk.server.core.internal.listeners.CDKOpenshiftUtility) ServiceManagerEnvironment(org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment) IConnection(org.jboss.tools.openshift.common.core.connection.IConnection) Test(org.junit.Test)

Aggregations

ServiceManagerEnvironment (org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironment)16 Test (org.junit.Test)13 IServer (org.eclipse.wst.server.core.IServer)7 CDKOpenshiftUtility (org.jboss.tools.openshift.cdk.server.core.internal.listeners.CDKOpenshiftUtility)6 IConnection (org.jboss.tools.openshift.common.core.connection.IConnection)5 ConnectionsRegistry (org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry)3 IStatus (org.eclipse.core.runtime.IStatus)2 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 CoreException (org.eclipse.core.runtime.CoreException)1 MultiStatus (org.eclipse.core.runtime.MultiStatus)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Status (org.eclipse.core.runtime.Status)1 IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)1 ControllableServerBehavior (org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior)1 ConfigureDependentFrameworksListener (org.jboss.tools.openshift.cdk.server.core.internal.listeners.ConfigureDependentFrameworksListener)1 ServiceManagerEnvironmentLoader (org.jboss.tools.openshift.cdk.server.core.internal.listeners.ServiceManagerEnvironmentLoader)1 CDKRegistryProvider (org.jboss.tools.openshift.cdk.server.core.internal.registry.CDKRegistryProvider)1