use of org.junit.rules.TemporaryFolder in project dkpro-tc by dkpro.
the class TestFoldUtil method createSequenceCas.
private void createSequenceCas() throws IOException, UIMAException {
tmpFoldSeq = new TemporaryFolder();
tmpFoldSeq.create();
jcasSequence = JCasFactory.createJCas();
jcasSequence.setDocumentText("One A Two B Three C Four D Five E Six F Seven G Eight H Nine I Ten J");
setSeq(jcasSequence, 0, 5);
setSeq(jcasSequence, 6, 11);
setSeq(jcasSequence, 12, 19);
setSeq(jcasSequence, 20, 26);
setSeq(jcasSequence, 27, 33);
setSeq(jcasSequence, 34, 39);
setSeq(jcasSequence, 40, 47);
setSeq(jcasSequence, 48, 55);
setSeq(jcasSequence, 56, 62);
setSeq(jcasSequence, 63, 68);
DocumentMetaData dmd = new DocumentMetaData(jcasSequence);
dmd.setDocumentId("id");
dmd.addToIndexes();
createJCasIdAnnotation(jcasSequence);
AnalysisEngine xmiWriter = AnalysisEngineFactory.createEngine(BinaryCasWriter.class, BinaryCasWriter.PARAM_TARGET_LOCATION, tmpFoldSeq.getRoot(), BinaryCasWriter.PARAM_FORMAT, "6+");
xmiWriter.process(jcasSequence);
}
use of org.junit.rules.TemporaryFolder in project spring-integration by spring-projects.
the class FileMessageHistoryTests method testMessageHistory.
@Test
public void testMessageHistory() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("file-message-history-context.xml", getClass());
TemporaryFolder input = context.getBean(TemporaryFolder.class);
File file = input.newFile("FileMessageHistoryTest.txt");
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write("hello");
out.close();
PollableChannel outChannel = context.getBean("outChannel", PollableChannel.class);
Message<?> message = outChannel.receive(10000);
assertThat(message, is(notNullValue()));
MessageHistory history = MessageHistory.read(message);
assertThat(history, is(notNullValue()));
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "fileAdapter", 0);
assertNotNull(componentHistoryRecord);
assertEquals("file:inbound-channel-adapter", componentHistoryRecord.get("type"));
context.close();
}
use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.
the class JMHEnvTokyoCabinetBenchmarkBase method setup.
public void setup() throws IOException {
Log.invalidateSharedCache();
TokyoCabinetBenchmark.shuffleKeys(randomKeys);
temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
final File testsDirectory = temporaryFolder.newFolder("data");
env = Environments.newInstance(testsDirectory, new EnvironmentConfig().setLogFileSize(32768));
store = env.computeInTransaction(new TransactionalComputable<Store>() {
@Override
public Store compute(@NotNull Transaction txn) {
return env.openStore("TokyoCabinetBenchmarkStore", getConfig(), txn);
}
});
}
use of org.junit.rules.TemporaryFolder in project blueocean-plugin by jenkinsci.
the class GitRepositoryRule method before.
@Override
protected void before() throws Throwable {
temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
gitDirectory = temporaryFolder.newFolder();
client = Git.init().setDirectory(gitDirectory).call();
logger.info("Created git repository at " + gitDirectory.getAbsolutePath());
}
use of org.junit.rules.TemporaryFolder in project pentaho-kettle by pentaho.
the class MessagesSourceCrawlerTest method setup.
@Before
public void setup() throws Exception {
temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
}
Aggregations