Skip to content
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
6 changes: 6 additions & 0 deletions quickfixj-core/src/test/java/quickfix/FileLogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Date;
import org.junit.After;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -39,6 +40,11 @@ public void setUp() throws Exception {
SystemTime.setTimeSource(new MockSystemTimeSource(System.currentTimeMillis()));
}

@After
public void tearDown() throws Exception {
SystemTime.setTimeSource(null);
}

@Test
public void testLog() throws Exception {
long systemTime = System.currentTimeMillis();
Expand Down
18 changes: 13 additions & 5 deletions quickfixj-core/src/test/java/quickfix/LogUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,28 @@

package quickfix;

import junit.framework.TestCase;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import org.junit.After;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;

public class LogUtilTest extends TestCase {
public class LogUtilTest {

protected void setUp() throws Exception {
super.setUp();
@Before
public void setUp() throws Exception {
SystemTime.setTimeSource(new MockSystemTimeSource(System.currentTimeMillis()));
}

@After
public void tearDown() throws Exception {
SystemTime.setTimeSource(null);
}

@Test
public void testLogThrowable() throws ConfigError, FieldConvertError {
ByteArrayOutputStream data = new ByteArrayOutputStream();
LogFactory mockLogFactory = createLogFactory(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import quickfix.SystemTime;

public class AcceptanceTestSuite extends TestSuite {
private static final String ATEST_TIMEOUT_KEY = "atest.timeout";
Expand Down Expand Up @@ -153,6 +154,8 @@ public AcceptanceTestSuite(String testDirectory, boolean multithreaded) {
public AcceptanceTestSuite(String testDirectory, boolean multithreaded, Map<Object, Object> overridenProperties) {
this.multithreaded = multithreaded;
this.overridenProperties = overridenProperties;
SystemTime.setTimeSource(null);

String name = testDirectory.substring(testDirectory.lastIndexOf(File.separatorChar) + 1);
this.setName(name + (multithreaded ? "-threaded" : ""));
Long timeout = Long.getLong(ATEST_TIMEOUT_KEY);
Expand Down