Search in sources :

Example 71 with Before

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

the class JpaPollingConsumerLockEntityTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    Customer customer = new Customer();
    customer.setName("Donald Duck");
    saveEntityInDB(customer);
    Customer customer2 = new Customer();
    customer2.setName("Goofy");
    saveEntityInDB(customer2);
    assertEntityInDB(2, Customer.class);
}
Also used : Customer(org.apache.camel.examples.Customer) Before(org.junit.Before)

Example 72 with Before

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

the class LdapRouteTest method setup.

@Before
public void setup() throws Exception {
    // you can assign port number in the @CreateTransport annotation
    port = super.getLdapServer().getPort();
    LdapContext ctx = getWiredContext(ldapServer);
    SimpleRegistry reg = new SimpleRegistry();
    reg.put("localhost:" + port, ctx);
    camel = new DefaultCamelContext(reg);
    template = camel.createProducerTemplate();
}
Also used : SimpleRegistry(org.apache.camel.impl.SimpleRegistry) LdapContext(javax.naming.ldap.LdapContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 73 with Before

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

the class MailSplitAttachmentsTest method setup.

@Before
public void setup() {
    // create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
    endpoint = context.getEndpoint("smtp://james@mymailserver.com?password=secret");
    exchange = endpoint.createExchange();
    Message in = exchange.getIn();
    in.setBody("Hello World");
    in.addAttachment("logo.jpeg", new DataHandler(new FileDataSource("src/test/data/logo.jpeg")));
    in.addAttachment("license.txt", new DataHandler(new FileDataSource("src/main/resources/META-INF/LICENSE.txt")));
}
Also used : Message(org.apache.camel.Message) FileDataSource(javax.activation.FileDataSource) DataHandler(javax.activation.DataHandler) Before(org.junit.Before)

Example 74 with Before

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

the class MultipleDestinationConsumeTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    Properties properties = new Properties();
    properties.put("mail.smtp.host", "localhost");
    mailSession = Session.getInstance(properties, null);
    super.setUp();
}
Also used : Properties(java.util.Properties) Before(org.junit.Before)

Example 75 with Before

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

the class MailMessageTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    Mailbox.clearAll();
    endpoint = resolveMandatoryEndpoint("pop3://someone@myhost:30/subject");
    Properties properties = new Properties();
    properties.put("mail.smtp.host", "localhost");
    mailSession = Session.getInstance(properties, null);
    mimeMessage = new MimeMessage(mailSession);
    mimeMessage.setText(body);
}
Also used : MimeMessage(javax.mail.internet.MimeMessage) Properties(java.util.Properties) 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