diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..7dffa91 Binary files /dev/null and b/.DS_Store differ diff --git a/.idea/.gitignore b/.idea/.gitignore index eb516de..b64434e 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -8,6 +8,7 @@ /dataSources.local.xml /target target/ +target pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java b/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java new file mode 100644 index 0000000..50c3b08 --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java @@ -0,0 +1,36 @@ +package hs.fulda.de.ci.exam.project; + +import java.util.HashSet; + +public class Aircraft { + private String name; + private String model; + private int manYear; + private HashSet flights = new HashSet(); + + public Aircraft(String name, String model, int manufacturingYear) { + this.name = name; + this.model = model; + this.manYear = manufacturingYear; + } + + public String getName() { + return this.name; + } + + public String getModel() { + return this.model; + } + + public int getManYear() { + return this.manYear; + } + + public HashSet getFlights() { + return this.flights; + } + + public void addFlight(Flight flight) { + flights.add(flight); + } +} diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java new file mode 100644 index 0000000..bb126b9 --- /dev/null +++ b/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java @@ -0,0 +1,59 @@ +package hs.fulda.de.ci.exam.project; + +import org.junit.Test; + +import java.util.HashSet; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + +public class AircraftTest { + + Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); + HashSet flights = new HashSet<>(); + Flight flight1 = mock(Flight.class); + Flight flight2 = mock(Flight.class); + + @Test + public void testClassAircraftConstructorName() { + assertThat(testAircraft.getName()) + .describedAs("get the name of aircraft") + .isEqualTo("Airbus"); + } + + @Test + public void testClassAircraftConstructorModel() { + assertThat(testAircraft.getModel()) + .describedAs("get the model of aircraft") + .isEqualTo("Neo"); + } + + @Test + public void testClassAircraftConstructorManifacturingYear() { + assertThat(testAircraft.getManYear()) + .describedAs("get the manifacturing year of aircraft") + .isEqualTo(1990); + } + + @Test + public void test_getFlightsEmptyList() { + assertThat(testAircraft.getFlights()) + .describedAs("get the manifacturing year of aircraft") + .isEqualTo(flights); + } + + @Test + public void test_getFlights_wiht_2_flights() { + flights.add(flight1); + flights.add(flight2); + + testAircraft.addFlight(flight1); + testAircraft.addFlight(flight2); + + assertThat(testAircraft.getFlights()) + .describedAs("get flights of aircraft") + .isEqualTo(flights); + } + + +} diff --git a/target/classes/hs/fulda/de/ci/exam/project/Aircraft.class b/target/classes/hs/fulda/de/ci/exam/project/Aircraft.class new file mode 100644 index 0000000..1491f29 Binary files /dev/null and b/target/classes/hs/fulda/de/ci/exam/project/Aircraft.class differ diff --git a/target/classes/hs/fulda/de/ci/exam/project/Airline.class b/target/classes/hs/fulda/de/ci/exam/project/Airline.class new file mode 100644 index 0000000..3b3cb68 Binary files /dev/null and b/target/classes/hs/fulda/de/ci/exam/project/Airline.class differ diff --git a/target/classes/hs/fulda/de/ci/exam/project/Customer.class b/target/classes/hs/fulda/de/ci/exam/project/Customer.class new file mode 100644 index 0000000..f6e1080 Binary files /dev/null and b/target/classes/hs/fulda/de/ci/exam/project/Customer.class differ diff --git a/target/classes/hs/fulda/de/ci/exam/project/Itinerary.class b/target/classes/hs/fulda/de/ci/exam/project/Itinerary.class new file mode 100644 index 0000000..b5fe1ba Binary files /dev/null and b/target/classes/hs/fulda/de/ci/exam/project/Itinerary.class differ diff --git a/target/classes/hs/fulda/de/ci/exam/project/ItineraryRepository.class b/target/classes/hs/fulda/de/ci/exam/project/ItineraryRepository.class new file mode 100644 index 0000000..23fbe66 Binary files /dev/null and b/target/classes/hs/fulda/de/ci/exam/project/ItineraryRepository.class differ diff --git a/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AddressTest.xml b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AddressTest.xml new file mode 100644 index 0000000..b461a41 --- /dev/null +++ b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AddressTest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirlineTest.xml b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirlineTest.xml new file mode 100644 index 0000000..3bfd7d0 --- /dev/null +++ b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirlineTest.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirportTest.xml b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirportTest.xml new file mode 100644 index 0000000..3705dfa --- /dev/null +++ b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.AirportTest.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.FlightTest.xml b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.FlightTest.xml new file mode 100644 index 0000000..62bc8f6 --- /dev/null +++ b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.FlightTest.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.PersonTest.xml b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.PersonTest.xml new file mode 100644 index 0000000..28902a0 --- /dev/null +++ b/target/surefire-reports/TEST-hs.fulda.de.ci.exam.project.PersonTest.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/hs.fulda.de.ci.exam.project.AddressTest.txt b/target/surefire-reports/hs.fulda.de.ci.exam.project.AddressTest.txt new file mode 100644 index 0000000..bd33bb8 --- /dev/null +++ b/target/surefire-reports/hs.fulda.de.ci.exam.project.AddressTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: hs.fulda.de.ci.exam.project.AddressTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in hs.fulda.de.ci.exam.project.AddressTest diff --git a/target/surefire-reports/hs.fulda.de.ci.exam.project.AirlineTest.txt b/target/surefire-reports/hs.fulda.de.ci.exam.project.AirlineTest.txt new file mode 100644 index 0000000..f768d7c --- /dev/null +++ b/target/surefire-reports/hs.fulda.de.ci.exam.project.AirlineTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: hs.fulda.de.ci.exam.project.AirlineTest +------------------------------------------------------------------------------- +Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.096 s - in hs.fulda.de.ci.exam.project.AirlineTest diff --git a/target/surefire-reports/hs.fulda.de.ci.exam.project.AirportTest.txt b/target/surefire-reports/hs.fulda.de.ci.exam.project.AirportTest.txt new file mode 100644 index 0000000..8cf5feb --- /dev/null +++ b/target/surefire-reports/hs.fulda.de.ci.exam.project.AirportTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: hs.fulda.de.ci.exam.project.AirportTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.253 s - in hs.fulda.de.ci.exam.project.AirportTest diff --git a/target/surefire-reports/hs.fulda.de.ci.exam.project.FlightTest.txt b/target/surefire-reports/hs.fulda.de.ci.exam.project.FlightTest.txt new file mode 100644 index 0000000..e30fffb --- /dev/null +++ b/target/surefire-reports/hs.fulda.de.ci.exam.project.FlightTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: hs.fulda.de.ci.exam.project.FlightTest +------------------------------------------------------------------------------- +Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 s - in hs.fulda.de.ci.exam.project.FlightTest diff --git a/target/surefire-reports/hs.fulda.de.ci.exam.project.PersonTest.txt b/target/surefire-reports/hs.fulda.de.ci.exam.project.PersonTest.txt new file mode 100644 index 0000000..d2b010e --- /dev/null +++ b/target/surefire-reports/hs.fulda.de.ci.exam.project.PersonTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: hs.fulda.de.ci.exam.project.PersonTest +------------------------------------------------------------------------------- +Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in hs.fulda.de.ci.exam.project.PersonTest diff --git a/target/test-classes/hs/fulda/de/ci/exam/project/AircraftTest.class b/target/test-classes/hs/fulda/de/ci/exam/project/AircraftTest.class new file mode 100644 index 0000000..d7b5cb8 Binary files /dev/null and b/target/test-classes/hs/fulda/de/ci/exam/project/AircraftTest.class differ diff --git a/target/test-classes/hs/fulda/de/ci/exam/project/AirlineTest.class b/target/test-classes/hs/fulda/de/ci/exam/project/AirlineTest.class new file mode 100644 index 0000000..73baddb Binary files /dev/null and b/target/test-classes/hs/fulda/de/ci/exam/project/AirlineTest.class differ diff --git a/target/test-classes/hs/fulda/de/ci/exam/project/CustomerTest.class b/target/test-classes/hs/fulda/de/ci/exam/project/CustomerTest.class new file mode 100644 index 0000000..2193c80 Binary files /dev/null and b/target/test-classes/hs/fulda/de/ci/exam/project/CustomerTest.class differ