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();
}
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();
}
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();
}
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();
}
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 });
}
}
Aggregations