use of org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry in project jbosstools-openshift by jbosstools.
the class CDKOpenshiftUtilityTest method testOpenshiftConnectionAdded.
@Test
public void testOpenshiftConnectionAdded() throws Exception {
CDKOpenshiftUtility util = new CDKOpenshiftUtility();
IServer s = mockServer("openshift33");
createCDKFile("Basic", null, null);
ServiceManagerEnvironment adb = createLoader(s);
ConnectionsRegistry registry = (ConnectionsRegistry) mock(ConnectionsRegistry.class);
IConnection con = util.createOpenshiftConnection(adb, registry);
assertNotNull(con);
verify(registry).add(con);
}
use of org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry in project jbosstools-openshift by jbosstools.
the class ConnectionRegistryTest method setUp.
@Before
public void setUp() {
this.registry = new ConnectionsRegistry();
this.change = new ConnectionsChange(registry);
this.connection = new OneConnectionImpl("http://localhost:8081");
}
use of org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry in project jbosstools-openshift by jbosstools.
the class OpenShiftProjectCacheTest method setUp.
@Before
public void setUp() throws Exception {
this.conn = spy(createConnection("spacecat", "42", "https://localhost:8880"));
doReturn(Arrays.asList(project)).when(conn).getResources(ResourceKind.PROJECT);
ConnectionsRegistry registry = ConnectionsRegistrySingleton.getInstance();
registry.clear();
registry.add(conn);
this.model = new OpenshiftUIModel(registry) {
};
this.connectionWrapper = model.getConnections().iterator().next();
}
use of org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry 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);
}
use of org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry 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");
}
Aggregations