Search in sources :

Example 11 with ConnectionWizardPageModel

use of org.jboss.tools.openshift.internal.common.ui.connection.ConnectionWizardPageModel in project jbosstools-openshift by jbosstools.

the class ConnectionWizardPageModelTest method getAllConnections_should_return_only_edited_connection_and_NewConnectionMarker_if_connection_change_is_disallowed.

@Test
public void getAllConnections_should_return_only_edited_connection_and_NewConnectionMarker_if_connection_change_is_disallowed() {
    // pre-condition
    ConnectionWizardPageModel model = new TestableConnectionWizardPageModel(editedConnection, allConnections, null, false, wizardModel);
    // operation
    // verification
    assertThat(model.getAllConnections()).containsExactlyElementsOf(Arrays.asList(NewConnectionMarker.getInstance(), editedConnection));
}
Also used : ConnectionWizardPageModel(org.jboss.tools.openshift.internal.common.ui.connection.ConnectionWizardPageModel) Test(org.junit.Test)

Example 12 with ConnectionWizardPageModel

use of org.jboss.tools.openshift.internal.common.ui.connection.ConnectionWizardPageModel in project jbosstools-openshift by jbosstools.

the class ConnectionWizardPageModelTest method getAllHosts_should_return_all_hosts_within_all_connections.

@Test
public void getAllHosts_should_return_all_hosts_within_all_connections() {
    // pre-condition
    ConnectionWizardPageModel model = new TestableConnectionWizardPageModel(editedConnection, allConnections, null, false, wizardModel);
    // operation
    Collection<String> allHosts = model.getAllHosts();
    // verification
    assertThat(allHosts).containsOnly(this.allHosts);
}
Also used : ConnectionWizardPageModel(org.jboss.tools.openshift.internal.common.ui.connection.ConnectionWizardPageModel) Test(org.junit.Test)

Aggregations

ConnectionWizardPageModel (org.jboss.tools.openshift.internal.common.ui.connection.ConnectionWizardPageModel)12 Test (org.junit.Test)11 Connection (org.jboss.tools.openshift.core.connection.Connection)6 MultiValidator (org.eclipse.core.databinding.validation.MultiValidator)4 DataBindingContext (org.eclipse.core.databinding.DataBindingContext)2 IValueChangeListener (org.eclipse.core.databinding.observable.value.IValueChangeListener)2 ValueChangeEvent (org.eclipse.core.databinding.observable.value.ValueChangeEvent)2 WritableValue (org.eclipse.core.databinding.observable.value.WritableValue)2 Composite (org.eclipse.swt.widgets.Composite)2 Shell (org.eclipse.swt.widgets.Shell)2 IConnection (org.jboss.tools.openshift.common.core.connection.IConnection)2 BasicAuthenticationDetailView (org.jboss.tools.openshift.internal.ui.wizard.connection.BasicAuthenticationDetailView)1 OAuthDetailView (org.jboss.tools.openshift.internal.ui.wizard.connection.OAuthDetailView)1