implement TournamentTest
This commit is contained in:
@@ -31,6 +31,6 @@ public class Place implements Serializable {
|
||||
}
|
||||
|
||||
public void change(Place place) {
|
||||
//TODO: If Place gets more developt in future releases
|
||||
//TODO: If Place gets more developed in future releases
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,9 +108,8 @@ public class Tournament implements Serializable {
|
||||
* Method to add a new Place, also checks if place does already exist.
|
||||
*
|
||||
* @param newPlace to be added in the list of all places
|
||||
* @throws PlaceExistsException if the place already exists
|
||||
*/
|
||||
public void addPlace(Place newPlace) {
|
||||
public void savePlace(Place newPlace) {
|
||||
for (Place place : places) {
|
||||
if (place.equals(newPlace)) {
|
||||
place.change(newPlace);
|
||||
@@ -301,20 +300,6 @@ public class Tournament implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Exception thrown when a Place does already exist
|
||||
*/
|
||||
public class PlaceExistsException extends Exception {
|
||||
public PlaceExistsException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PlaceExistsException(String errorMessage) {
|
||||
super(errorMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom Exception thrown when a Place does not exist
|
||||
*/
|
||||
|
||||
@@ -148,7 +148,7 @@ public class TournamentDecorator implements IsObservable{
|
||||
|
||||
public void savePlace(String name){
|
||||
try {
|
||||
tournament.addPlace(new Place(name));
|
||||
tournament.savePlace(new Place(name));
|
||||
factoryDecorator.clearMessage(true);
|
||||
informListener();
|
||||
} catch (InvalidNameException e) {
|
||||
|
||||
Reference in New Issue
Block a user