Clean up code

This commit is contained in:
Mike Cifelli 2017-03-24 09:36:44 -04:00
parent eb82a25f64
commit a8620307c9
7 changed files with 8 additions and 14 deletions

View File

@ -31,7 +31,7 @@ public class FilePositionTrackerTest {
} }
@Before @Before
public void setUp() throws Exception { public void setUp() {
trackerUnderTest = new FilePositionTracker(FILE_NAME); trackerUnderTest = new FilePositionTracker(FILE_NAME);
} }

View File

@ -24,7 +24,7 @@ public class ArgumentValidatorTest {
} }
@Before @Before
public void setUp() throws Exception { public void setUp() {
validator = new ArgumentValidator("TEST"); validator = new ArgumentValidator("TEST");
} }

View File

@ -52,7 +52,7 @@ public class LispInterpreterTest {
} }
@Before @Before
public void setUp() throws Exception { public void setUp() {
indicatorSet = new HashSet<>(); indicatorSet = new HashSet<>();
outputStream = new ByteArrayOutputStream(); outputStream = new ByteArrayOutputStream();
errorOutputStream = new ByteArrayOutputStream(); errorOutputStream = new ByteArrayOutputStream();
@ -61,7 +61,7 @@ public class LispInterpreterTest {
} }
@After @After
public void tearDown() throws Exception { public void tearDown() {
builder.reset(); builder.reset();
environment.reset(); environment.reset();
} }

View File

@ -7,7 +7,7 @@ import static testutil.TestUtilities.*;
import java.math.BigInteger; import java.math.BigInteger;
import org.junit.*; import org.junit.Test;
import function.UserDefinedFunction; import function.UserDefinedFunction;
import sexpression.LispNumber.InvalidNumberException; import sexpression.LispNumber.InvalidNumberException;
@ -18,9 +18,6 @@ public class SExpressionTest {
assertEquals(expected, sExpression.toString()); assertEquals(expected, sExpression.toString());
} }
@Before
public void setUp() throws Exception {}
@Test @Test
public void nil_ToString() { public void nil_ToString() {
String input = "NIL"; String input = "NIL";

View File

@ -11,14 +11,11 @@ public class SafeInputStreamTest {
SafeInputStream safeWithException; SafeInputStream safeWithException;
@Before @Before
public void setUp() throws Exception { public void setUp() {
safe = new SafeInputStream(createInputStreamFromString("a")); safe = new SafeInputStream(createInputStreamFromString("a"));
safeWithException = new SafeInputStream(createIOExceptionThrowingInputStream()); safeWithException = new SafeInputStream(createIOExceptionThrowingInputStream());
} }
@After
public void tearDown() throws Exception {}
@Test @Test
public void readWorks() { public void readWorks() {
assertEquals('a', (char) safe.read()); assertEquals('a', (char) safe.read());

View File

@ -14,7 +14,7 @@ public class SafeOutputStreamTest {
ByteArrayOutputStream output; ByteArrayOutputStream output;
@Before @Before
public void setUp() throws Exception { public void setUp() {
output = new ByteArrayOutputStream(); output = new ByteArrayOutputStream();
safe = new SafeOutputStream(output); safe = new SafeOutputStream(output);
safeWithException = new SafeOutputStream(createIOExceptionThrowingOutputStream()); safeWithException = new SafeOutputStream(createIOExceptionThrowingOutputStream());

View File

@ -14,7 +14,7 @@ public class TokenFactoryTest {
private FilePosition testPosition; private FilePosition testPosition;
@Before @Before
public void setUp() throws Exception { public void setUp() {
tokenFactory = new TokenFactoryImpl(); tokenFactory = new TokenFactoryImpl();
testPosition = new FilePosition("testFile"); testPosition = new FilePosition("testFile");
testPosition.setLineNumber(0); testPosition.setLineNumber(0);