Search in sources :

Example 31 with Before

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

the class BarcodeDataFormatCamelTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    // clean directory
    File directory = new File(PATH);
    if (!directory.isDirectory() || !directory.exists()) {
        LOG.error(String.format("cannot delete files from directory '%s', because path is not a directory, or it doesn't exist.", PATH));
    } else {
        LOG.info("deleting files from " + PATH + "...");
        File[] files = directory.listFiles();
        for (File file : files) {
            LOG.info(String.format("deleting %s", file.getName()));
            file.delete();
        }
    }
}
Also used : File(java.io.File) Before(org.junit.Before)

Example 32 with Before

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

the class BeanstalkCamelTestSupport method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    ConnectionSettings conn = connFactory.parseUri(tubeName);
    writer = conn.newWritingClient();
    reader = conn.newReadingClient(false);
}
Also used : ConnectionSettings(org.apache.camel.component.beanstalk.ConnectionSettings) Before(org.junit.Before)

Example 33 with Before

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

the class EndpointTest method setUp.

@Before
public void setUp() throws Exception {
    context = new DefaultCamelContext();
    context.disableJMX();
    context.start();
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Example 34 with Before

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

the class LogCustomLoggerTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    sw1 = new StringWriter();
    sw2 = new StringWriter();
    ConsumingAppender.newAppender(LogCustomLoggerTest.class.getCanonicalName(), "LogCustomLoggerTest", Level.TRACE, event -> sw1.append(event.getLoggerName()));
    ConsumingAppender.newAppender("provided.logger1.name", "logger1", Level.TRACE, event -> sw1.append(event.getLoggerName()));
    ConsumingAppender.newAppender("provided.logger2.name", "logger2", Level.TRACE, event -> sw1.append(event.getLoggerName()));
    ConsumingAppender.newAppender("irrelevant.logger.name", "irrelevant", Level.TRACE, event -> sw1.append(event.getLoggerName()));
    ConsumingAppender.newAppender(LogComponent.class.getCanonicalName(), "LogComponent", Level.TRACE, event -> sw2.append(event.getLoggerName()));
}
Also used : StringWriter(java.io.StringWriter) Before(org.junit.Before)

Example 35 with Before

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

the class LogProcessorWithProvidedLoggerTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    sw = new StringWriter();
    ConsumingAppender.newAppender("org.apache.camel.customlogger", "customlogger", Level.TRACE, event -> sw.append(event.getLoggerName() + " " + event.getLevel().toString() + " " + event.getMessage().getFormattedMessage()));
}
Also used : StringWriter(java.io.StringWriter) 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