Search in sources :

Example 1 with Violation

use of org.eclipse.che.ide.api.dialogs.InputValidator.Violation in project che by eclipse.

the class SshKeyManagerPresenterTest method shouldReturnNullOnHostNameWithSeveralDotsAndDashesValidation.

@Test
public void shouldReturnNullOnHostNameWithSeveralDotsAndDashesValidation() throws OperationException {
    String validHostname = "ho-st.na-me.com";
    Violation violation = ((InputValidator) presenter.hostNameValidator).validate(validHostname);
    assertNull(violation);
}
Also used : Violation(org.eclipse.che.ide.api.dialogs.InputValidator.Violation) InputValidator(org.eclipse.che.ide.api.dialogs.InputValidator) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Example 2 with Violation

use of org.eclipse.che.ide.api.dialogs.InputValidator.Violation in project che by eclipse.

the class SshKeyManagerPresenterTest method shouldReturnNullOnHostNameWithDotAndDashValidation.

@Test
public void shouldReturnNullOnHostNameWithDotAndDashValidation() throws OperationException {
    String validHostname = "host-name.com";
    Violation violation = ((InputValidator) presenter.hostNameValidator).validate(validHostname);
    assertNull(violation);
}
Also used : Violation(org.eclipse.che.ide.api.dialogs.InputValidator.Violation) InputValidator(org.eclipse.che.ide.api.dialogs.InputValidator) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Example 3 with Violation

use of org.eclipse.che.ide.api.dialogs.InputValidator.Violation in project che by eclipse.

the class SshKeyManagerPresenterTest method shouldReturnNullOnValidHostNameValidation.

@Test
public void shouldReturnNullOnValidHostNameValidation() throws OperationException {
    String validHostname = "hostname.com";
    Violation violation = ((InputValidator) presenter.hostNameValidator).validate(validHostname);
    assertNull(violation);
}
Also used : Violation(org.eclipse.che.ide.api.dialogs.InputValidator.Violation) InputValidator(org.eclipse.che.ide.api.dialogs.InputValidator) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

InputValidator (org.eclipse.che.ide.api.dialogs.InputValidator)3 Violation (org.eclipse.che.ide.api.dialogs.InputValidator.Violation)3 Test (org.junit.Test)3 Matchers.anyString (org.mockito.Matchers.anyString)3