Search in sources :

Example 1 with EmptyFileNameCreator

use of com.adaptris.core.EmptyFileNameCreator in project interlok by adaptris.

the class WriteMetadataToFilesystemTest method testFilenameCreator.

@Test
public void testFilenameCreator() throws Exception {
    WriteMetadataToFilesystem service = new WriteMetadataToFilesystem();
    assertEquals(FormattedFilenameCreator.class, service.filenameCreator().getClass());
    service.setFilenameCreator(new EmptyFileNameCreator());
    assertEquals(EmptyFileNameCreator.class, service.getFilenameCreator().getClass());
    service.setFilenameCreator(null);
    assertEquals(FormattedFilenameCreator.class, service.filenameCreator().getClass());
}
Also used : EmptyFileNameCreator(com.adaptris.core.EmptyFileNameCreator) Test(org.junit.Test)

Example 2 with EmptyFileNameCreator

use of com.adaptris.core.EmptyFileNameCreator in project interlok by adaptris.

the class FsMessageProducerTest method testSetFilenameCreator.

@Test
public void testSetFilenameCreator() throws Exception {
    String subdir = new GuidGenerator().safeUUID();
    FsProducer producer = createProducer(subdir);
    try {
        producer.setFilenameCreator(null);
        fail();
    } catch (IllegalArgumentException | NullPointerException expected) {
    }
    producer.setFilenameCreator(new EmptyFileNameCreator());
    assertEquals(EmptyFileNameCreator.class, producer.getFilenameCreator().getClass());
}
Also used : EmptyFileNameCreator(com.adaptris.core.EmptyFileNameCreator) GuidGenerator(com.adaptris.util.GuidGenerator) Test(org.junit.Test)

Example 3 with EmptyFileNameCreator

use of com.adaptris.core.EmptyFileNameCreator in project interlok by adaptris.

the class ReadMetadataFromFilesystemTest method testFilenameCreator.

@Test
public void testFilenameCreator() throws Exception {
    ReadMetadataFromFilesystem service = new ReadMetadataFromFilesystem();
    assertEquals(FormattedFilenameCreator.class, service.filenameCreator().getClass());
    service.setFilenameCreator(new EmptyFileNameCreator());
    assertEquals(EmptyFileNameCreator.class, service.getFilenameCreator().getClass());
    service.setFilenameCreator(null);
    assertEquals(FormattedFilenameCreator.class, service.filenameCreator().getClass());
}
Also used : EmptyFileNameCreator(com.adaptris.core.EmptyFileNameCreator) Test(org.junit.Test)

Aggregations

EmptyFileNameCreator (com.adaptris.core.EmptyFileNameCreator)3 Test (org.junit.Test)3 GuidGenerator (com.adaptris.util.GuidGenerator)1