Search in sources :

Example 6 with Before

use of cucumber.api.java.Before in project alien4cloud by alien4cloud.

the class EditorStepDefs method init.

@Before
public void init() throws IOException {
    thrownException = null;
    GetMultipleDataResult<Application> apps = alienDAO.search(Application.class, "", null, 100);
    for (Application application : apps.getData()) {
        applicationService.delete(application.getId());
    }
    FacetedSearchResult<Topology> searchResult = catalogService.search(Topology.class, "", 100, null);
    Topology[] topologies = searchResult.getData();
    for (Topology topology : topologies) {
        try {
            csarService.forceDeleteCsar(topology.getId());
        } catch (NotFoundException e) {
            // Some previous tests may create topology without creating any archive, if so catch the exception
            alienDAO.delete(Topology.class, topology.getId());
        }
    }
    topologyIds.clear();
    editionContextManager.clearCache();
}
Also used : NotFoundException(alien4cloud.exception.NotFoundException) Topology(org.alien4cloud.tosca.model.templates.Topology) Application(alien4cloud.model.application.Application) Before(cucumber.api.java.Before)

Example 7 with Before

use of cucumber.api.java.Before in project hippo by NHS-digital-website.

the class TestDataSteps method clearTestData.

/**
 * Resets the test data repository before every scenario to prevent data leaking between scenarios, unless given
 * scenario is tagged with {@code @NeedsExistingTestData}.
 */
@Before(value = "~@NeedsExistingTestData")
public void clearTestData() {
    log.debug("Disposing of test data.");
    testDataRepo.clear();
    try {
        FileUtils.deleteDirectory(acceptanceTestProperties.getDownloadDir().toFile());
    } catch (IOException ioe) {
        throw new UncheckedIOException(ioe);
    }
}
Also used : UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) Before(cucumber.api.java.Before)

Example 8 with Before

use of cucumber.api.java.Before in project cucumber-jvm by cucumber.

the class JavaHookTest method hook_with_no_order_is_last.

@Test
public void hook_with_no_order_is_last() {
    objectFactory.setInstance(new HasHooks());
    backend.buildWorld();
    backend.addHook(BEFORE.getAnnotation(Before.class), BEFORE);
    HookDefinition hookDef = glue.getBeforeHooks().get(0);
    assertEquals(10000, hookDef.getOrder());
}
Also used : Before(cucumber.api.java.Before) HookDefinition(cucumber.runtime.HookDefinition) Test(org.junit.Test)

Example 9 with Before

use of cucumber.api.java.Before in project cucumber-jvm by cucumber.

the class JavaHookTest method does_not_match_non_matching_tags.

@Test
public void does_not_match_non_matching_tags() {
    objectFactory.setInstance(new HasHooks());
    backend.buildWorld();
    backend.addHook(BEFORE.getAnnotation(Before.class), BEFORE);
    HookDefinition before = glue.getBeforeHooks().get(0);
    assertFalse(before.matches(asList(new Tag("@bar", 0))));
}
Also used : Before(cucumber.api.java.Before) Tag(gherkin.formatter.model.Tag) HookDefinition(cucumber.runtime.HookDefinition) Test(org.junit.Test)

Example 10 with Before

use of cucumber.api.java.Before in project azure-tools-for-java by Microsoft.

the class RedisCacheCreatorScenario method setUp.

@Before
public void setUp() throws Exception {
    RedisCaches redisCaches = mock(RedisCaches.class);
    redisCacheCreator = new RedisCacheCreator(redisCaches, DNS_NAME, REGION_NAME, GROUP_NAME);
    creatorMap = redisCacheCreator.CreatorMap();
}
Also used : RedisCaches(com.microsoft.azure.management.redis.RedisCaches) Before(cucumber.api.java.Before)

Aggregations

Before (cucumber.api.java.Before)13 HookDefinition (cucumber.runtime.HookDefinition)3 Test (org.junit.Test)3 Tag (gherkin.formatter.model.Tag)2 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)2 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)2 NotFoundException (alien4cloud.exception.NotFoundException)1 AuthenticationStepDefinitions (alien4cloud.it.security.AuthenticationStepDefinitions)1 Application (alien4cloud.model.application.Application)1 Instrumentation (android.app.Instrumentation)1 NgWebDriver (com.jprotractor.NgWebDriver)1 RedisCaches (com.microsoft.azure.management.redis.RedisCaches)1 ProtractorDriver (com.mycompany.app.ProtractorDriver)1 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 URL (java.net.URL)1 Topology (org.alien4cloud.tosca.model.templates.Topology)1 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 MBeanContainer (org.eclipse.jetty.jmx.MBeanContainer)1