Don't mix JUnit 4 annotations with JUnit3 TestCase.

This commit is contained in:
akwizgran
2015-12-08 14:53:50 +00:00
parent 9158514abf
commit 123dff3a3d
66 changed files with 440 additions and 338 deletions

View File

@@ -1,11 +1,5 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.MAX_CLOCK_DIFFERENCE;
import static org.junit.Assert.assertArrayEquals;
import java.util.Arrays;
import java.util.Collections;
import org.briarproject.BriarTestCase;
import org.briarproject.api.ContactId;
import org.briarproject.api.TransportId;
@@ -23,6 +17,15 @@ import org.jmock.Expectations;
import org.jmock.Mockery;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
import static org.briarproject.api.transport.TransportConstants.MAX_CLOCK_DIFFERENCE;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class KeyManagerImplTest extends BriarTestCase {
private static final long EPOCH = 1000L * 1000L * 1000L * 1000L;

View File

@@ -1,12 +1,5 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.MAX_CLOCK_DIFFERENCE;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import java.util.Arrays;
import java.util.Collections;
import org.briarproject.BriarTestCase;
import org.briarproject.api.ContactId;
import org.briarproject.api.TransportId;
@@ -29,6 +22,16 @@ import org.jmock.api.Action;
import org.jmock.api.Invocation;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
import static org.briarproject.api.transport.TransportConstants.MAX_CLOCK_DIFFERENCE;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class KeyRotationIntegrationTest extends BriarTestCase {
private static final long EPOCH = 1000L * 1000L * 1000L * 1000L;

View File

@@ -1,13 +1,17 @@
package org.briarproject.transport;
import org.briarproject.BriarTestCase;
import org.junit.Test;
import java.util.Collection;
import static org.briarproject.api.transport.TransportConstants.REORDERING_WINDOW_SIZE;
import static org.briarproject.util.ByteUtils.MAX_32_BIT_UNSIGNED;
import static org.junit.Assert.assertArrayEquals;
import java.util.Collection;
import org.briarproject.BriarTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class ReorderingWindowTest extends BriarTestCase {

View File

@@ -1,13 +1,14 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.MAX_PAYLOAD_LENGTH;
import org.briarproject.BriarTestCase;
import org.briarproject.api.crypto.StreamDecrypter;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.junit.Test;
import static org.briarproject.api.transport.TransportConstants.MAX_PAYLOAD_LENGTH;
import static org.junit.Assert.assertEquals;
public class StreamReaderImplTest extends BriarTestCase {
@Test

View File

@@ -1,13 +1,14 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.MAX_PAYLOAD_LENGTH;
import org.briarproject.BriarTestCase;
import org.briarproject.api.crypto.StreamEncrypter;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.junit.Test;
import static org.briarproject.api.transport.TransportConstants.MAX_PAYLOAD_LENGTH;
import static org.junit.Assert.assertEquals;
public class StreamWriterImplTest extends BriarTestCase {
@Test

View File

@@ -1,16 +1,16 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.HEADER_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAC_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
import org.briarproject.api.FormatException;
import org.briarproject.api.crypto.StreamDecrypter;
import org.briarproject.util.ByteUtils;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import org.briarproject.api.FormatException;
import org.briarproject.api.crypto.StreamDecrypter;
import org.briarproject.util.ByteUtils;
import static org.briarproject.api.transport.TransportConstants.HEADER_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAC_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
class TestStreamDecrypter implements StreamDecrypter {

View File

@@ -1,14 +1,14 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.HEADER_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAC_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
import org.briarproject.api.crypto.StreamEncrypter;
import org.briarproject.util.ByteUtils;
import java.io.IOException;
import java.io.OutputStream;
import org.briarproject.api.crypto.StreamEncrypter;
import org.briarproject.util.ByteUtils;
import static org.briarproject.api.transport.TransportConstants.HEADER_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAC_LENGTH;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
class TestStreamEncrypter implements StreamEncrypter {

View File

@@ -1,8 +1,9 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import org.briarproject.BriarTestCase;
import org.briarproject.api.crypto.StreamDecrypter;
import org.briarproject.api.crypto.StreamEncrypter;
import org.junit.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -11,10 +12,10 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.Random;
import org.briarproject.BriarTestCase;
import org.briarproject.api.crypto.StreamDecrypter;
import org.briarproject.api.crypto.StreamEncrypter;
import org.junit.Test;
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
public class TransportIntegrationTest extends BriarTestCase {

View File

@@ -1,10 +1,5 @@
package org.briarproject.transport;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import java.util.Random;
import org.briarproject.BriarTestCase;
import org.briarproject.api.ContactId;
import org.briarproject.api.TransportId;
@@ -21,6 +16,14 @@ import org.jmock.api.Action;
import org.jmock.api.Invocation;
import org.junit.Test;
import java.util.Random;
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
public class TransportTagRecogniserTest extends BriarTestCase {
private final ContactId contactId = new ContactId(234);