use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeUseImageDebugPortValueToTrueIfKeyIsNotPresent.
@Test
public void shouldInitializeUseImageDebugPortValueToTrueIfKeyIsNotPresent() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn(null).when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEBUG_PORT_VALUE), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.isUseImageDebugPortValue()).isTrue();
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeUseImageDevmodeKeyToTrueIfKeyIsNotPresent.
@Test
public void shouldInitializeUseImageDevmodeKeyToTrueIfKeyIsNotPresent() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn(null).when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEVMODE_KEY), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.isUseImageDevmodeKey()).isTrue();
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldInitializeDebugPortValue.
@Test
public void shouldInitializeDebugPortValue() throws Exception {
// given
IServerWorkingCopy server = spy(OpenShiftServerTestUtils.createOpenshift3ServerWorkingCopy("aServer", null, null, null));
doReturn("4242").when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_DEBUG_PORT_VALUE), anyString());
// when
ServerSettingsWizardPageModel model = createModel(null, null, null, null, null, server);
// then
assertThat(model.getDebugPortValue()).isEqualTo("4242");
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method should_return_valid_route_if_initialized_with_invalid_route.
@Test
public void should_return_valid_route_if_initialized_with_invalid_route() {
// given
ServerSettingsWizardPageModel model = createModel(ResourceMocks.PROJECT2_SERVICES[1], ResourceMocks.PROJECT3_ROUTES[0], null, Arrays.asList(project1, project3, project4), connection);
// when
IRoute route = model.getRoute();
// then
assertThat(route).isEqualTo(ResourceMocks.PROJECT2_ROUTES[1]);
}
use of org.jboss.tools.openshift.internal.ui.server.ServerSettingsWizardPageModel in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPageModelTest method shouldReturn1stAvailableProjectIfModelInitializingProjectIsNotContainedInAvailableProjects.
@Test
public void shouldReturn1stAvailableProjectIfModelInitializingProjectIsNotContainedInAvailableProjects() {
// given
ServerSettingsWizardPageModel model = createModel(null, null, project2, Arrays.asList(project1, project3, project4), connection);
// when
IProject deployProject = model.getDeployProject();
// then
assertThat(deployProject).isEqualTo(project1);
}
Aggregations