Search in sources :

Example 51 with Before

use of org.junit.Before in project camel by apache.

the class HttpProducerExplicitConnectionCloseTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/myget", new BasicValidationHandler("GET", null, null, getExpectedContent())).create();
    localServer.start();
    super.setUp();
}
Also used : BasicValidationHandler(org.apache.camel.component.http4.handler.BasicValidationHandler) Before(org.junit.Before)

Example 52 with Before

use of org.junit.Before in project camel by apache.

the class HttpAuthenticationTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/search", new AuthenticationValidationHandler("GET", null, null, getExpectedContent(), user, password)).create();
    localServer.start();
    super.setUp();
}
Also used : AuthenticationValidationHandler(org.apache.camel.component.http4.handler.AuthenticationValidationHandler) Before(org.junit.Before)

Example 53 with Before

use of org.junit.Before in project camel by apache.

the class HttpBodyTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    Map<String, String> expectedHeaders = new HashMap<String, String>();
    expectedHeaders.put("Content-Type", "image/jpeg");
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/post", new BasicValidationHandler("POST", null, getBody(), getExpectedContent())).registerHandler("/post1", new HeaderValidationHandler("POST", null, null, getExpectedContent(), expectedHeaders)).create();
    localServer.start();
    super.setUp();
}
Also used : HashMap(java.util.HashMap) HeaderValidationHandler(org.apache.camel.component.http4.handler.HeaderValidationHandler) BasicValidationHandler(org.apache.camel.component.http4.handler.BasicValidationHandler) Before(org.junit.Before)

Example 54 with Before

use of org.junit.Before in project camel by apache.

the class HttpNoConnectionTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    localServer = ServerBootstrap.bootstrap().setHttpProcessor(getBasicHttpProcessor()).setConnectionReuseStrategy(getConnectionReuseStrategy()).setResponseFactory(getHttpResponseFactory()).setExpectationVerifier(getHttpExpectationVerifier()).setSslContext(getSSLContext()).registerHandler("/search", new BasicValidationHandler("GET", null, null, getExpectedContent())).create();
    localServer.start();
    super.setUp();
}
Also used : BasicValidationHandler(org.apache.camel.component.http4.handler.BasicValidationHandler) Before(org.junit.Before)

Example 55 with Before

use of org.junit.Before in project camel by apache.

the class IBatisTestSupport method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    // lets create the database...
    Connection connection = createConnection();
    Statement statement = connection.createStatement();
    statement.execute(getStatement());
    connection.commit();
    connection.close();
    if (createTestData()) {
        Account account1 = new Account();
        account1.setId(123);
        account1.setFirstName("James");
        account1.setLastName("Strachan");
        account1.setEmailAddress("TryGuessing@gmail.com");
        Account account2 = new Account();
        account2.setId(456);
        account2.setFirstName("Claus");
        account2.setLastName("Ibsen");
        account2.setEmailAddress("Noname@gmail.com");
        template.sendBody("ibatis:insertAccount?statementType=Insert", new Account[] { account1, account2 });
    }
}
Also used : Statement(java.sql.Statement) Connection(java.sql.Connection) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)8594 File (java.io.File)733 Properties (java.util.Properties)270 Configuration (org.apache.hadoop.conf.Configuration)266 TreeMap (java.util.TreeMap)247 ArrayList (java.util.ArrayList)228 HashMap (java.util.HashMap)162 IOException (java.io.IOException)159 URL (java.net.URL)137 Path (org.apache.hadoop.fs.Path)130 Config (com.hazelcast.config.Config)115 HazelcastInstance (com.hazelcast.core.HazelcastInstance)111 InputStream (java.io.InputStream)109 Date (java.util.Date)96 InvocationOnMock (org.mockito.invocation.InvocationOnMock)96 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)92 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)90 ByteArrayOutputStream (java.io.ByteArrayOutputStream)83 Connection (java.sql.Connection)78 Random (java.util.Random)75