From c086cf18a4a5aac9fbe819d9aca18adaaf92c220 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 19:41:20 +0200 Subject: [PATCH 1/9] test game --- .../ch/zhaw/projekt2/turnierverwaltung/Factory.java | 1 - .../zhaw/projekt2/turnierverwaltung/GameTest.java | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java index 46b08bd..f93c403 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java @@ -8,7 +8,6 @@ import javafx.scene.control.Label; import javafx.scene.layout.*; import javafx.scene.paint.Color; import javafx.scene.text.Font; - import java.io.IOException; public class Factory { diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java new file mode 100644 index 0000000..edcddd2 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java @@ -0,0 +1,13 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.BeforeEach; + +public class GameTest { + + private Game game; + + @BeforeEach + void setup() { + + } +} -- 2.40.1 From 135ec7e8d56d35841eff7ba8f65846154e12cf65 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 21:11:33 +0200 Subject: [PATCH 2/9] sync TournamentTest with new changes create GameTest --- .../projekt2/turnierverwaltung/GameTest.java | 34 ++++++++++++-- .../turnierverwaltung/TournamentTest.java | 46 +++++++++++-------- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java index edcddd2..a72332a 100644 --- a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/GameTest.java @@ -1,13 +1,41 @@ package ch.zhaw.projekt2.turnierverwaltung; -import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; public class GameTest { private Game game; - @BeforeEach - void setup() { + @Test + @DisplayName("TestWinner") + void testWinnerFunction() { + Participant one = Mockito.mock(Player.class); + Participant two = Mockito.mock(Player.class); + game = new Game(one,two); + game.setPoints1(1); + Assertions.assertEquals(one,game.getWinner()); + game.setPoints2(2); + Assertions.assertEquals(two,game.getWinner()); + } + + @Test + @DisplayName("Test refresh Participant") + void refreshTest() { + Participant one = Mockito.mock(Player.class); + Participant two = Mockito.mock(Player.class); + Game game1 = new Game(one,two); + Game game2 = new Game(one,two); + game = new Game(game1,game2); + game1.setPoints1(2); + game2.setPoints2(2); + Assertions.assertNull(game.getParticipant1()); + Assertions.assertNull(game.getParticipant2()); + game.refreshParticipants(); + Assertions.assertEquals(one,game.getParticipant1()); + Assertions.assertEquals(two,game.getParticipant2()); } } diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TournamentTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TournamentTest.java index 3acc30c..75e98d4 100644 --- a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TournamentTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TournamentTest.java @@ -44,20 +44,21 @@ public class TournamentTest { //Checks if one Participant gets added Participant participantOne = Mockito.mock(Player.class); when(participantOne.equals(any(Participant.class))).thenReturn(false); - - assertEquals(0, tournament.getParticipants().size()); - tournament.saveParticipant(participantOne); - assertEquals(1, tournament.getParticipants().size()); - - //Checks if a second Participant gets added - Participant participantTwo = Mockito.mock(Player.class); - tournament.saveParticipant(participantTwo); - assertEquals(2, tournament.getParticipants().size()); - - //Checks if a allready added Particpant does not get added - when(participantOne.equals(any(Participant.class))).thenReturn(true); - tournament.saveParticipant(participantTwo); - assertEquals(2, tournament.getParticipants().size()); + try { + assertEquals(0, tournament.getParticipants().size()); + tournament.saveParticipant(participantOne); + assertEquals(1, tournament.getParticipants().size()); + //Checks if a second Participant gets added + Participant participantTwo = Mockito.mock(Player.class); + tournament.saveParticipant(participantTwo); + assertEquals(2, tournament.getParticipants().size()); + //Checks if a allready added Particpant does not get added + when(participantOne.equals(any(Participant.class))).thenReturn(true); + tournament.saveParticipant(participantTwo); + assertEquals(2, tournament.getParticipants().size()); + } catch (Person.InvalidPhoneNumberException e) { + fail(); + } } @@ -69,13 +70,13 @@ public class TournamentTest { //Checks if Error is thrown if Participant not in list assertThrows(Tournament.ParticipantNotExistsException.class, () -> tournament.removeParticipant(participant)); - //Checks if participant gets removed - tournament.saveParticipant(participant); - assertEquals(1, tournament.getParticipants().size()); try { + //Checks if participant gets removed + tournament.saveParticipant(participant); + assertEquals(1, tournament.getParticipants().size()); tournament.removeParticipant(participant); assertEquals(0, tournament.getParticipants().size()); - } catch (Tournament.ParticipantNotExistsException e) { + } catch (Tournament.ParticipantNotExistsException | Person.InvalidPhoneNumberException e) { fail(); } } @@ -126,13 +127,18 @@ public class TournamentTest { tournament.createGameSchedule(); assertEquals(2, tournament.getGameList().size()); tournament.saveParticipant(participant); - } catch (Tournament.NumberOfParticipantInvalidException e) { + } catch (Tournament.NumberOfParticipantInvalidException | Person.InvalidPhoneNumberException e) { fail(); } } else { + assertThrows(Tournament.NumberOfParticipantInvalidException.class, () -> tournament.createGameSchedule()); - tournament.saveParticipant(participant); + try { + tournament.saveParticipant(participant); + } catch (Person.InvalidPhoneNumberException e) { + e.printStackTrace(); + } } } try { -- 2.40.1 From 2ef4c3f5844032d72cae5804e3e1660e1e1cd671 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 21:46:31 +0200 Subject: [PATCH 3/9] create PlayerTest --- .../LanguageConfigurator.java | 3 -- app/src/test/java/PlayerTest.java | 40 +++++++++++++++++++ .../turnierverwaltung/LanguageTest.java | 18 +++++++++ 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 app/src/test/java/PlayerTest.java create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/LanguageTest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java index 396fa7c..a97b044 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java @@ -103,11 +103,9 @@ public class LanguageConfigurator { englishDictionary.put("participantNotExist","Participant does not exist"); germanDictionary.put("placeNotExist","Teilnehmer existiert nicht"); englishDictionary.put("placeNotExist","Participant does not exist"); - //SaveMsg germanDictionary.put("save","Zuletzt gespeichert: "); englishDictionary.put("save","Last saved: "); - //Alert germanDictionary.put("yes","Ja"); englishDictionary.put("yes","Yes"); @@ -119,7 +117,6 @@ public class LanguageConfigurator { englishDictionary.put("headerDelete","Delete Tournament?"); germanDictionary.put("contentDelete","Sind Sie sicher, dass sie das Turnier entfernen wollen?\nNach diesem Vorgang kann es nicht wiederhergestellt werden."); englishDictionary.put("contentDelete","Are you shure you want to delete the tournament?\nAfter that there is no way to restore."); - germanDictionary.put("titleSchedule","Neu erstellen"); englishDictionary.put("titleSchedule","Create new"); germanDictionary.put("headerSchedule","Spielplan neu erstellen?"); diff --git a/app/src/test/java/PlayerTest.java b/app/src/test/java/PlayerTest.java new file mode 100644 index 0000000..3003af4 --- /dev/null +++ b/app/src/test/java/PlayerTest.java @@ -0,0 +1,40 @@ +import ch.zhaw.projekt2.turnierverwaltung.InvalidNameException; +import ch.zhaw.projekt2.turnierverwaltung.Person; +import ch.zhaw.projekt2.turnierverwaltung.Player; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class PlayerTest { + private Player player; + + @Test + @DisplayName("Test invalid Parameter") + void invalidParams() { + try { + assertThrows(Person.InvalidPhoneNumberException.class,()->new Player("A","a",".sad","")); + assertThrows(Player.InvalidDateException.class,()->new Player("A","a","","a")); + player = new Player("A","A","",""); + assertEquals("A",player.getFirstName()); + assertEquals("A",player.getName()); + assertEquals("",player.getPhoneNumber()); + assertNull(player.getDateOfBirth()); + } catch (InvalidNameException | Person.InvalidPhoneNumberException | Player.InvalidDateException e) { + fail(); + } + } + + @Test + @DisplayName("Test equals") + void equalsTest() { + try { + player = new Player("A","A","",""); + assertTrue(player.equals(player)); + assertFalse(player.equals(new Player("B", "D", "", ""))); + assertTrue(player.equals(new Player("A", "A", "", ""))); + } catch (InvalidNameException | Person.InvalidPhoneNumberException | Player.InvalidDateException e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/LanguageTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/LanguageTest.java new file mode 100644 index 0000000..e5dfdb8 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/LanguageTest.java @@ -0,0 +1,18 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +public class LanguageTest { + + @Test + @DisplayName("Test Dictionary") + void test() { + LanguageConfigurator languageConfigurator = new LanguageConfigurator(); + Assertions.assertEquals("Ja",languageConfigurator.getSelectedLanguage("yes")); + languageConfigurator.changeLanguage(LanguageConfigurator.Language.ENGLISH); + Assertions.assertEquals("Yes",languageConfigurator.getSelectedLanguage("yes")); + + } +} -- 2.40.1 From fd06e24e2126dded5fc53099f71f2b2cd642b7b5 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 21:54:21 +0200 Subject: [PATCH 4/9] create PersonTest --- .../turnierverwaltung/PersonTest.java | 25 +++++++++++++++++++ .../turnierverwaltung}/PlayerTest.java | 5 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java rename app/src/test/java/{ => ch/zhaw/projekt2/turnierverwaltung}/PlayerTest.java (89%) diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java new file mode 100644 index 0000000..4a462db --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java @@ -0,0 +1,25 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class PersonTest { + private Person person; + + @Test + @DisplayName("Test invalid Parameter") + void invalidParams() { + try { + assertThrows(Person.InvalidPhoneNumberException.class,()->new Person("A","a",".sad")); + person = new Person("A","A",""); + assertEquals("A", person.getFirstName()); + assertEquals("A", person.getName()); + assertEquals("", person.getPhoneNumber()); + } catch (InvalidNameException | Person.InvalidPhoneNumberException e) { + fail(); + } + } + +} diff --git a/app/src/test/java/PlayerTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java similarity index 89% rename from app/src/test/java/PlayerTest.java rename to app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java index 3003af4..9b22d6d 100644 --- a/app/src/test/java/PlayerTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java @@ -1,6 +1,5 @@ -import ch.zhaw.projekt2.turnierverwaltung.InvalidNameException; -import ch.zhaw.projekt2.turnierverwaltung.Person; -import ch.zhaw.projekt2.turnierverwaltung.Player; +package ch.zhaw.projekt2.turnierverwaltung; + import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -- 2.40.1 From 2e314497db859919a5e9f3df73dafd53e61a0e50 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 22:06:58 +0200 Subject: [PATCH 5/9] create PlaceTest --- .../LanguageConfigurator.java | 1 - .../projekt2/turnierverwaltung/PlaceTest.java | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java index a97b044..beb00c7 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java @@ -2,7 +2,6 @@ package ch.zhaw.projekt2.turnierverwaltung; import javafx.scene.control.Labeled; import javafx.scene.control.MenuItem; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java new file mode 100644 index 0000000..81e6ba6 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java @@ -0,0 +1,36 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class PlaceTest { + private Place place; + + @Test + @DisplayName("Test Params") + void paramTest() { + Assertions.assertThrows(InvalidNameException.class, () -> new Place("*")); + try { + place = new Place("placeA"); + assertEquals("placeA", place.getName()); + } catch (InvalidNameException e) { + fail(); + } + } + + @Test + @DisplayName("Place Equals Test") + void testEqual() { + try { + place = new Place("placeA"); + assertTrue(place.equals(place)); + assertTrue(place.equals(new Place("placeA"))); + assertFalse(place.equals(new Place("nads"))); + } catch (InvalidNameException e) { + fail(); + } + } +} -- 2.40.1 From df3fc5df2d7d35befae6b530fd68029fea613af5 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 22:22:39 +0200 Subject: [PATCH 6/9] create TeamTest --- .../turnierverwaltung/LogConfiguration.java | 2 -- .../zhaw/projekt2/turnierverwaltung/Team.java | 3 +- .../projekt2/turnierverwaltung/TeamTest.java | 31 +++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TeamTest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LogConfiguration.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LogConfiguration.java index b15c578..6968dbb 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LogConfiguration.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LogConfiguration.java @@ -34,8 +34,6 @@ public class LogConfiguration { logger.fine("Getting and reading logconfig file from " + propertiesPath); InputStream logConfig = this.getClass().getClassLoader().getResourceAsStream(propertiesPath); LogManager.getLogManager().readConfiguration(logConfig); - - Logger.getLogger(LogConfiguration.class.getPackageName()); } } diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java index 105562d..c67eedb 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Team.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; - /** * Class Team represents a team that can be added to a tournament * (in the prototype there is no functionality for the team) @@ -22,7 +21,7 @@ public class Team implements Participant { * @param name the new name to be set */ public Team(String name) { - logger.fine("Setting the new name of the team as: " + name); + logger.fine("Setting the new name of the team as: " + name); setName(name); players = new ArrayList<>(); } diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TeamTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TeamTest.java new file mode 100644 index 0000000..2e53a38 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/TeamTest.java @@ -0,0 +1,31 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +public class TeamTest { + + private Team team; + + @Test + @DisplayName("Team Params") + void testParams() { + Player player = Mockito.mock(Player.class); + team = new Team("Team1"); + for (int i = 0; i < 3; i++) { + Assertions.assertEquals(i,team.getPlayers().size()); + team.addPlayer(player); + } + } + + @Test + @DisplayName("Team Equals") + void equalTeam() { + team = new Team("A"); + Assertions.assertTrue(team.equals(team)); + Assertions.assertTrue(team.equals(new Team("A"))); + Assertions.assertFalse(team.equals(new Team("B"))); + } +} -- 2.40.1 From 7f8de3e8f14b6233693c975fa5e6f1774ba5eb56 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 22:35:01 +0200 Subject: [PATCH 7/9] create FactoryTest --- .../projekt2/turnierverwaltung/Factory.java | 2 -- .../turnierverwaltung/FactoryTest.java | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java index b3b22f1..29e644c 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/Factory.java @@ -117,8 +117,6 @@ public class Factory { innerVbox.getChildren().add(label); } - - } public void resetFooter(BorderPane pane,boolean error) { diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java new file mode 100644 index 0000000..c3b9763 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java @@ -0,0 +1,28 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Pane; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.mockito.InOrder; +import org.mockito.Mockito; + +import static org.mockito.Mockito.inOrder; + +public class FactoryTest { + private Factory factory; + + @Test + @DisplayName("Test method calls") + void checkMethodCalls() { + FileIO fileIO = Mockito.mock(FileIO.class); + TournamentDecorator td = Mockito.mock(TournamentDecorator.class); + LanguageConfigurator lc = Mockito.mock(LanguageConfigurator.class); + BorderPane pane = Mockito.mock(BorderPane.class); + factory = new Factory(fileIO,td,lc); + InOrder order = inOrder(fileIO,td,lc); + + factory.showTournamentList(pane); + + } +} -- 2.40.1 From a8a2a0a4637b88bc907bf5164707019dc015d5b5 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 22:56:24 +0200 Subject: [PATCH 8/9] create FactoryTest merged --- .../ch/zhaw/projekt2/turnierverwaltung/main/MainWindow.java | 5 +---- .../main/gameScheduleView/AlertNewSchedule.java | 5 ----- .../java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java | 3 +-- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindow.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindow.java index b335404..e4500b6 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindow.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindow.java @@ -1,9 +1,6 @@ package ch.zhaw.projekt2.turnierverwaltung.main; -import ch.zhaw.projekt2.turnierverwaltung.Factory; -import ch.zhaw.projekt2.turnierverwaltung.FactoryDecorator; -import ch.zhaw.projekt2.turnierverwaltung.FileIO; -import ch.zhaw.projekt2.turnierverwaltung.TournamentDecorator; +import ch.zhaw.projekt2.turnierverwaltung.*; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/AlertNewSchedule.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/AlertNewSchedule.java index 3827a9a..afbf08d 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/AlertNewSchedule.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/gameScheduleView/AlertNewSchedule.java @@ -1,10 +1,5 @@ package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView; -import ch.zhaw.projekt2.turnierverwaltung.LanguageConfigurator; -import javafx.scene.control.Alert; -import javafx.scene.control.ButtonBar; -package ch.zhaw.projekt2.turnierverwaltung.main.gameScheduleView; - import ch.zhaw.projekt2.turnierverwaltung.LanguageConfigurator; import javafx.scene.control.Alert; import javafx.scene.control.ButtonBar; diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java index c3b9763..8da1478 100644 --- a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FactoryTest.java @@ -1,7 +1,6 @@ package ch.zhaw.projekt2.turnierverwaltung; import javafx.scene.layout.BorderPane; -import javafx.scene.layout.Pane; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.mockito.InOrder; @@ -22,7 +21,7 @@ public class FactoryTest { factory = new Factory(fileIO,td,lc); InOrder order = inOrder(fileIO,td,lc); - factory.showTournamentList(pane); + //factory.showTournamentList(pane); } } -- 2.40.1 From 4db2c582e2358cc6fd026b46cca5c2e8728d7cd9 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 13 May 2022 23:03:15 +0200 Subject: [PATCH 9/9] merge conflict --- .../ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java | 3 +-- .../turnierverwaltung/main/MainWindowController.java | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java index d9a2b85..0c4baac 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/FactoryDecorator.java @@ -119,8 +119,7 @@ public class FactoryDecorator implements IsObservable { */ public void openTournamentList() { logger.fine("Showing TournamentList view"); - factory.showTournamentList((BorderPane) pane, this); - + factory.showTournamentList((BorderPane) pane); informListener(); } diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java index e31c94b..2a9c96c 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/main/MainWindowController.java @@ -31,10 +31,7 @@ public class MainWindowController extends FXController { @FXML private Menu menuItemLanguage; - - private static final Logger logger = Logger.getLogger(MainWindowController.class.getCanonicalName()); - - + /** * Method changes the language Setting to german */ @FXML -- 2.40.1