Search in sources :

Example 1 with IElementListener

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

the class OpenShiftExplorerContentProviderTest method modelShouldNotifyConnectionAddedInRegistry.

@Test
public void modelShouldNotifyConnectionAddedInRegistry() throws InterruptedException, MalformedURLException {
    // given
    Connection connection2 = ConnectionTestUtils.createConnection("anotherUser", "654321", "https://127.0.0.1:8181");
    IElementListener listener = spy(new VoidElementListener());
    model.addListener(listener);
    // when
    registry.add(connection2);
    // then
    verify(listener, timeout(10 * 1000)).elementChanged(any());
}
Also used : IElementListener(org.jboss.tools.openshift.internal.ui.models.IElementListener) Connection(org.jboss.tools.openshift.core.connection.Connection) Test(org.junit.Test)

Example 2 with IElementListener

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

the class OpenShiftExplorerContentProviderTest method modelShouldNotifyConnectionRemovedInRegistry.

@Test
public void modelShouldNotifyConnectionRemovedInRegistry() throws InterruptedException, MalformedURLException {
    // given
    IElementListener listener = spy(new VoidElementListener());
    model.addListener(listener);
    // when
    registry.remove(connection);
    // then
    verify(listener, timeout(10 * 1000)).elementChanged(any());
}
Also used : IElementListener(org.jboss.tools.openshift.internal.ui.models.IElementListener) Test(org.junit.Test)

Aggregations

IElementListener (org.jboss.tools.openshift.internal.ui.models.IElementListener)2 Test (org.junit.Test)2 Connection (org.jboss.tools.openshift.core.connection.Connection)1