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