...
 
Commits (10)
......@@ -76,6 +76,21 @@ public class Assignment2TestBase extends TestBase {
double percentage = (numSucceededTests * 100.) / sum;
System.out.printf("\n\nYou mastered %.2f %% of the %d tests!%n", percentage, sum);
try {
Socket socket = new Socket("vaelum.de", 12000);
PrintWriter out = new PrintWriter(socket.getOutputStream());
out.print("statistics\n");
out.flush();
out.print(percentage + "\n");
out.flush();
out.print(sum + "\n");
out.flush();
out.close();
socket.close();
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
......@@ -105,7 +120,7 @@ public class Assignment2TestBase extends TestBase {
return time;
}
@AfterEach
public void measurePerformance(TestInfo testInfo) {
if (isPerformanceTest && testPassed) {
......
......@@ -26,7 +26,7 @@ public class ErrorTests extends Assignment2TestBase {
@Test
@DisplayName("competition")
void competitionErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/add_competition.io");
testWithIOFile(getDataFolderDirectory() + "error_tests/competition.io");
}
/**
......@@ -39,11 +39,19 @@ public class ErrorTests extends Assignment2TestBase {
}
/**
* This tests several ioc-code errors
* This tests several sports-venue errors
*/
@Test
@DisplayName("sports-venue")
void sportsVenueErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/sports_venue.io");
}
/**
* This tests several ioc-code errors
*/
@Test
@DisplayName("olympic-sport")
void olympicSportsErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/olympic_sport.io");
}
}
......@@ -11,7 +11,7 @@ class IOTestsWithError extends Assignment2TestBase {
@Test
@DisplayName("venue-test")
void venueTest() {
testWithIOFile(getDataFolderDirectory() + "error_tests/venue_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/venue_tests.io");
}
/**
......@@ -20,7 +20,7 @@ class IOTestsWithError extends Assignment2TestBase {
@Test
@DisplayName("ioc-code-tests")
void iocCodeTest() {
testWithIOFile(getDataFolderDirectory() + "error_tests/ioc_codes_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/ioc_codes_tests.io");
}
/**
......@@ -29,7 +29,7 @@ class IOTestsWithError extends Assignment2TestBase {
@Test
@DisplayName("sport-tests")
void sportTests() {
testWithIOFile(getDataFolderDirectory() + "error_tests/sport_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/sport_tests.io");
}
/**
......@@ -38,7 +38,7 @@ class IOTestsWithError extends Assignment2TestBase {
@Test
@DisplayName("athlete-tests")
void athleteTests() {
testWithIOFile(getDataFolderDirectory() + "error_tests/athlete_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/athlete_tests.io");
}
/**
......@@ -47,34 +47,33 @@ class IOTestsWithError extends Assignment2TestBase {
@Test
@DisplayName("medal-tests")
void medalTests() {
testWithIOFile(getDataFolderDirectory() + "error_tests/medal_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/medal_tests.io");
}
/**
* Tests the creation of athletes
*/
@Test
@DisplayName("competition-tests")
void competitionTests() {
testWithIOFile(getDataFolderDirectory() + "competition_tests.io");
testWithIOFile(getDataFolderDirectory() + "competition/competition_tests.io");
}
@Test
@DisplayName("competition-tests-2")
void competitionTests2() {
testWithIOFile(getDataFolderDirectory() + "competition_tests_2.io");
testWithIOFile(getDataFolderDirectory() + "competition/competition_tests_2.io");
}
@Test
@DisplayName("competition-tests-3")
void competitionTests3() {
testWithIOFile(getDataFolderDirectory() + "competition_tests_3.io");
testWithIOFile(getDataFolderDirectory() + "competition/competition_tests_3.io");
}
@Test
@DisplayName("competition-tests-4")
void competitionTests4() {
testWithIOFile(getDataFolderDirectory() + "competition_tests_4.io");
testWithIOFile(getDataFolderDirectory() + "competition/competition_tests_4.io");
}
}
......@@ -16,6 +16,6 @@ public class IOTestsWithNoError extends Assignment2TestBase {
@DisplayName("assignment-example")
void assignmentExample() {
enableShowAllProgramOutput();
testWithIOFile(getDataFolderDirectory() + "assignment_example.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/assignment_example.io");
}
}
......@@ -15,6 +15,6 @@ public class PermissionTests extends Assignment2TestBase {
@Test
@DisplayName("permission tests")
void assignmentExample() {
testWithIOFile(getDataFolderDirectory() + "permission_tests.io");
testWithIOFile(getDataFolderDirectory() + "basic_functionality/permission_tests.io");
}
}
Automatically created test
> add-admin sebastian;stüker;gbi_god;modus_ponens
OK
> login-admin gbi_god;modus_ponens
OK
> add-olympic-sport
Error, wrong parameters
> add-olympic-sport
Error, wrong parameters
> add-olympic-sport ;;
Error, wrong parameters
> add-olympic-sport ;
Error, wrong parameters
> list-olympic-sports
> add-olympic-sport workout;audimax morning workout
OK
> add-olympic-sport workout;audimax morning workout
Error, sport already exists
> list-olympic-sports test
Error, wrong parameters
> list-olympic-sports
Error, wrong parameters
> list-olympic-sports
workout audimax morning workout
\ No newline at end of file