General code tidy up

- access modifiers adjusted
- unused declarations removed
- spelling fixes
- removed redundant code
This commit is contained in:
Jessica McAuslin
2017-05-08 20:21:20 +12:00
parent e1ba2ae5b6
commit 2d983eccfd
44 changed files with 242 additions and 406 deletions
@@ -7,13 +7,12 @@ import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Created by jjg64 on 21/04/17.
*/
public class BoatsXMLTest {
BoatXMLReader boatXMLReader;
private BoatXMLReader boatXMLReader;
@Before
public void setup() {
@@ -1,25 +1,17 @@
package seng302.Mock;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Created by jjg64 on 1/05/17.
*/
public class FailBoatXMLTest {
String path = "mockXML/boatXML/";
private final String path = "mockXML/boatXML/";
@Test(expected = NumberFormatException.class)
public void invalidSourceID() throws SAXException, ParserConfigurationException, ParseException, IOException {
@@ -3,7 +3,8 @@ package seng302.Mock;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
/**
* Created by jjg64 on 19/04/17.
@@ -11,25 +11,22 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Tests only work on the current version of mockXML/raceXML/raceTest.xml
*/
public class StreamedRaceTest {
StreamedCourseXMLReader streamedCourseXMLReader;
List<GPSCoordinate> boundary;
private StreamedCourseXMLReader streamedCourseXMLReader;
private List<GPSCoordinate> boundary;
@Before
public void setup() {
try {
streamedCourseXMLReader = new StreamedCourseXMLReader("mockXML/raceXML/raceTest.xml", true);
boundary = streamedCourseXMLReader.getBoundary();
} catch (Exception e) {
} catch (Exception | StreamedCourseXMLException e) {
e.printStackTrace();
//fail("Cannot find mockXML/raceXML/raceTest.xml in the resources folder");
} catch (StreamedCourseXMLException e) {
e.printStackTrace();
}
}
@@ -12,8 +12,8 @@ import static junit.framework.TestCase.*;
public class BoatInRaceTest {
private GPSCoordinate ORIGIN_COORDS = new GPSCoordinate(0, 0);
private BoatInRace TEST_BOAT = new BoatInRace("Test", 1, Color.ALICEBLUE, "tt");
private final GPSCoordinate ORIGIN_COORDS = new GPSCoordinate(0, 0);
private final BoatInRace TEST_BOAT = new BoatInRace("Test", 1, Color.ALICEBLUE, "tt");
@Test
@@ -14,7 +14,7 @@ import static junit.framework.TestCase.assertEquals;
*/
public class LegTest {
private Marker ORIGIN_MARKER = new Marker(new GPSCoordinate(0, 0));
private final Marker ORIGIN_MARKER = new Marker(new GPSCoordinate(0, 0));
@Test
public void calculateDistanceHandles5nmNorth() {
@@ -10,7 +10,7 @@ import static org.junit.Assert.assertTrue;
*/
public class MarkerTest {
GPSCoordinate ORIGIN_COORD = new GPSCoordinate(0, 0);
private final GPSCoordinate ORIGIN_COORD = new GPSCoordinate(0, 0);
@Test
public void averageOfSingleMarkAtOriginIsSingleMark() {
@@ -1,4 +1,5 @@
package seng302.Model;/**
package seng302.Model;
/**
* Created by Gondr on 26/03/2017.
*/