Search in sources :

Example 1 with OpenshiftUIModel

use of org.jboss.tools.openshift.internal.ui.models.OpenshiftUIModel 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();
}
Also used : ConnectionsRegistry(org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry) OpenshiftUIModel(org.jboss.tools.openshift.internal.ui.models.OpenshiftUIModel) Before(org.junit.Before)

Example 2 with OpenshiftUIModel

use of org.jboss.tools.openshift.internal.ui.models.OpenshiftUIModel in project jbosstools-openshift by jbosstools.

the class OpenShiftExplorerContentProviderTest method setup.

@Before
public void setup() throws Exception {
    this.connection = spy(ConnectionTestUtils.createConnection("auser", "atoken", OPENSHIFT_SERVER_URL));
    doReturn(true).when(connection).ownsResource(any(IResource.class));
    this.registry = ConnectionsRegistrySingleton.getInstance();
    registry.clear();
    registry.add(connection);
    this.model = new OpenshiftUIModel(registry) {
    };
    this.connectionWrapper = model.getConnections().iterator().next();
    this.provider = new OpenShiftExplorerContentProvider(model) {
    };
}
Also used : OpenShiftExplorerContentProvider(org.jboss.tools.openshift.internal.ui.explorer.OpenShiftExplorerContentProvider) OpenshiftUIModel(org.jboss.tools.openshift.internal.ui.models.OpenshiftUIModel) IResource(com.openshift.restclient.model.IResource) Before(org.junit.Before)

Aggregations

OpenshiftUIModel (org.jboss.tools.openshift.internal.ui.models.OpenshiftUIModel)2 Before (org.junit.Before)2 IResource (com.openshift.restclient.model.IResource)1 ConnectionsRegistry (org.jboss.tools.openshift.common.core.connection.ConnectionsRegistry)1 OpenShiftExplorerContentProvider (org.jboss.tools.openshift.internal.ui.explorer.OpenShiftExplorerContentProvider)1