Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests to extend UnitTest #608

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.junit.jupiter.api.Test;

import java.io.IOException;
Expand All @@ -13,7 +15,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class AbstractSeekableByteChannelTest {
class AbstractSeekableByteChannelTest extends UnitTest {
private static class TestSeekableByteChannel extends AbstractSeekableByteChannel {
private final long size;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.Random;

import static org.junit.jupiter.api.Assertions.assertThrows;

class BufferedChannelFactoryTest {
class BufferedChannelFactoryTest extends UnitTest {
@Test
void testCache() throws IOException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import com.google.common.io.Files;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand All @@ -17,7 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class FileChannelFactoryTest {
class FileChannelFactoryTest extends UnitTest {
private static final String TEST_STRING = "test data";
private static final byte[] TEST_BYTES = TEST_STRING.getBytes(StandardCharsets.US_ASCII);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;

Expand All @@ -12,7 +14,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class FillChannelFactoryTest {
class FillChannelFactoryTest extends UnitTest {
@Test
void testCreate() {
assertThrows(IllegalArgumentException.class, () -> FillChannelFactory.create(-1, (byte) 0));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.apache.commons.compress.utils.SeekableInMemoryByteChannel;
import org.junit.jupiter.api.Test;

Expand All @@ -13,7 +15,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class ImmutableChannelFactoryTest {
class ImmutableChannelFactoryTest extends UnitTest {
private static final String TEST_STRING = "Test data";

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.apache.commons.compress.utils.SeekableInMemoryByteChannel;
import org.junit.jupiter.api.Test;

Expand All @@ -11,7 +13,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

class InMemoryChannelFactoryTest {
class InMemoryChannelFactoryTest extends UnitTest {

@Test
void testCannotCreateFactoryWithNullByteArray() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;

Expand All @@ -15,7 +17,7 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;

class InputStreamChannelFactoryTest {
class InputStreamChannelFactoryTest extends UnitTest {
private static class TestInputStreamFactory implements InputStreamFactory {
private final byte[] bytes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.IThrowableProxy;
Expand All @@ -22,7 +24,7 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

class LoggingChannelFactoryTest {
class LoggingChannelFactoryTest extends UnitTest {
private ListAppender<ILoggingEvent> appender;
private final Logger logger = (Logger) LoggerFactory.getLogger(LoggingChannelFactoryTest.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.IThrowableProxy;
Expand All @@ -20,7 +22,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class LoggingInputStreamFactoryTest {
class LoggingInputStreamFactoryTest extends UnitTest {
private ListAppender<ILoggingEvent> appender = null;
private final Logger logger = (Logger) LoggerFactory.getLogger(LoggingInputStreamFactoryTest.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package emissary.core.channels;

import emissary.core.BaseDataObject;
import emissary.test.core.junit5.UnitTest;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
Expand All @@ -27,7 +28,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

class SeekableByteChannelHelperTest {
class SeekableByteChannelHelperTest extends UnitTest {

private static final String TEST_STRING = "test data";
private static final byte[] TEST_BYTES = TEST_STRING.getBytes(StandardCharsets.US_ASCII);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package emissary.core.channels;

import emissary.test.core.junit5.UnitTest;

import org.junit.jupiter.api.Test;

import java.io.IOException;
Expand All @@ -10,7 +12,7 @@

import static org.junit.jupiter.api.Assertions.assertThrows;

class SegmentChannelFactoryTest {
class SegmentChannelFactoryTest extends UnitTest {
@Test
void testCreate() throws IOException {
final byte[] bytes = new byte[10];
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/emissary/util/DisposeHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void setup() {
}

@AfterEach
void tearDown() {
void detach() {
logger.detachAppender(appender);
rLogger.detachAppender(appender);
}
Expand Down