Search in sources :

Example 1 with StringStartsWith

use of org.hamcrest.core.StringStartsWith in project jbosstools-openshift by jbosstools.

the class DeleteResourceTest method testDeletePod.

@Test
public void testDeletePod() {
    OpenShiftResource applicationPod = OpenShiftUtils.getOpenShiftPod(projectReq.getProjectName(), new StringStartsWith("eap-app-"), connectionReq.getConnection());
    String podName = applicationPod.getName();
    applicationPod.delete();
    try {
        OpenShiftResourceExists openShiftResourceExists = new OpenShiftResourceExists(Resource.POD, podName, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection());
        new WaitWhile(openShiftResourceExists, TimePeriod.getCustom(15));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Application pod should be deleted at this point, but it it still present.");
    }
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 2 with StringStartsWith

use of org.hamcrest.core.StringStartsWith in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromTemplateTest method importApplicationAndVerify.

public static void importApplicationAndVerify(String projectName) {
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
    try {
        new CheckBox(new WithTextMatcher(new StringStartsWith("Do not clone"))).toggle(true);
    } catch (CoreLayerException ex) {
    // git directory is not in use
    } catch (WaitTimeoutExpiredException ex) {
    // swallow, checkbox is disabled
    }
    new FinishButton().click();
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    OpenShiftUtils.handleCheatSheetCreateServerAdapter();
    new WaitUntil(new ProjectExists(projectName, new ProjectExplorer()), TimePeriod.LONG, false);
    assertTrue("Project Explorer should contain imported project " + projectName, projectExplorer.containsProject(projectName));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) StringStartsWith(org.hamcrest.core.StringStartsWith) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ProjectExists(org.eclipse.reddeer.eclipse.condition.ProjectExists) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 3 with StringStartsWith

use of org.hamcrest.core.StringStartsWith in project nextprot-api by calipho-sib.

the class SitemapXMLIntegrationTest method shouldReturnCorrectValuesForSitemap.

@Test
public void shouldReturnCorrectValuesForSitemap() throws Exception {
    ResultActions actions = this.mockMvc.perform(get("/seo/sitemap"));
    actions.andExpect(xpath("/ns:urlset/ns:url/ns:changefreq", NS).string("weekly"));
    actions.andExpect(xpath("/ns:urlset/ns:url/ns:loc", NS).string(new StringStartsWith("https://www.nextprot.org")));
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) ResultActions(org.springframework.test.web.servlet.ResultActions) WebIntegrationBaseTest(org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest) Test(org.junit.Test)

Example 4 with StringStartsWith

use of org.hamcrest.core.StringStartsWith in project alluxio by Alluxio.

the class GrpcSecurityTest method testServerUnsupportedAuthentication.

@Test
public void testServerUnsupportedAuthentication() {
    mThrown.expect(RuntimeException.class);
    mThrown.expectMessage(new StringStartsWith(false, "No factory could create a UserState with authType: " + AuthType.KERBEROS.name()));
    createServer(AuthType.KERBEROS);
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) Test(org.junit.Test)

Example 5 with StringStartsWith

use of org.hamcrest.core.StringStartsWith in project flink by apache.

the class DataStreamTest method testPOJOWithNestedArrayNoHashCodeKeyRejection.

// //////////////			Composite Key Tests : POJOs			////////////////
@Test
public void testPOJOWithNestedArrayNoHashCodeKeyRejection() {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    DataStream<POJOWithHashCode> input = env.fromElements(new POJOWithHashCode(new int[] { 1, 2 }));
    TypeInformation<?> expectedTypeInfo = new TupleTypeInfo<Tuple1<int[]>>(PrimitiveArrayTypeInfo.INT_PRIMITIVE_ARRAY_TYPE_INFO);
    // adjust the rule
    expectedException.expect(InvalidProgramException.class);
    expectedException.expectMessage(new StringStartsWith("Type " + expectedTypeInfo + " cannot be used as key."));
    input.keyBy("id");
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) TupleTypeInfo(org.apache.flink.api.java.typeutils.TupleTypeInfo) Test(org.junit.Test)

Aggregations

StringStartsWith (org.hamcrest.core.StringStartsWith)11 Test (org.junit.Test)8 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)5 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)4 TupleTypeInfo (org.apache.flink.api.java.typeutils.TupleTypeInfo)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)3 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 InvalidProgramException (org.apache.flink.api.common.InvalidProgramException)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)2 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)2 ConsoleHasText (org.eclipse.reddeer.eclipse.condition.ConsoleHasText)2 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 ExpectedException (org.junit.rules.ExpectedException)2 Method (java.lang.reflect.Method)1 Duration (java.time.Duration)1 List (java.util.List)1 Nullable (javax.annotation.Nullable)1