Search in sources :

Example 1 with ConnectionsFactory

use of org.jboss.tools.openshift.common.core.connection.ConnectionsFactory in project jbosstools-openshift by jbosstools.

the class ConnectionsFactoryTest method setUp.

@Before
public void setUp() {
    this.connectionsFactory = new ConnectionsFactory();
    ((ConnectionsFactory) connectionsFactory).addConnectionFactory(createConnectionFactory(A_CONNECTION_FACTORY_ID, AConnection.class, A_CONNECTION_SERVER));
    ((ConnectionsFactory) connectionsFactory).addConnectionFactory(createConnectionFactory(OTHER_CONNECTION_FACTORY_ID, OtherConnection.class, OTHER_CONNECTION_SERVER));
}
Also used : ConnectionsFactory(org.jboss.tools.openshift.common.core.connection.ConnectionsFactory) IConnectionsFactory(org.jboss.tools.openshift.common.core.connection.IConnectionsFactory) Before(org.junit.Before)

Example 2 with ConnectionsFactory

use of org.jboss.tools.openshift.common.core.connection.ConnectionsFactory in project jbosstools-openshift by jbosstools.

the class ConnectionsFactoryTest method addShouldAddAFactory.

@Test
public void addShouldAddAFactory() {
    // pre-condition
    ConnectionsFactory connectionsFactory = new ConnectionsFactory();
    Collection<IConnectionFactory> allFactories = connectionsFactory.getAll();
    assertThat(allFactories).isEmpty();
    // operation
    ((ConnectionsFactory) connectionsFactory).addConnectionFactory(createConnectionFactory(A_CONNECTION_FACTORY_ID, AConnection.class, "http://localhost"));
    // verification
    assertThat(connectionsFactory.getAll()).hasSize(1);
}
Also used : ConnectionsFactory(org.jboss.tools.openshift.common.core.connection.ConnectionsFactory) IConnectionsFactory(org.jboss.tools.openshift.common.core.connection.IConnectionsFactory) IConnectionFactory(org.jboss.tools.openshift.common.core.connection.IConnectionFactory) Test(org.junit.Test)

Aggregations

ConnectionsFactory (org.jboss.tools.openshift.common.core.connection.ConnectionsFactory)2 IConnectionsFactory (org.jboss.tools.openshift.common.core.connection.IConnectionsFactory)2 IConnectionFactory (org.jboss.tools.openshift.common.core.connection.IConnectionFactory)1 Before (org.junit.Before)1 Test (org.junit.Test)1