Compare commits
60 Commits
destinatio
...
main
Author | SHA1 | Date |
---|---|---|
Selim Eser | 11797b9b73 | |
Selim Eser | af6e9669b4 | |
David Groys | b92c488768 | |
Selim Eser | 7acdaf97a4 | |
Selim Eser | c6a209e27e | |
Selim Eser | 10fb4ac11c | |
Selim Eser | 5215d9b4f7 | |
Selim Eser | e0cd0c376f | |
Selim Eser | 0060368e0a | |
Selim Eser | 9dc98f62e7 | |
Selim Eser | 00a96494e6 | |
David Groys | f9fb48a3f4 | |
David Groys | 606708c904 | |
David Groys | b34b0c82bc | |
David Groys | 5ce975c334 | |
David Groys | 991e0f1d8d | |
David Groys | d08992eba2 | |
David Groys | b670cc38dc | |
David Groys | 1a45bc23ec | |
David Groys | 5eaff1161b | |
David Groys | ed04821220 | |
David Groys | d45465c1ad | |
David Groys | 47e613d109 | |
David Groys | 89961cfca9 | |
David Groys | 109489f0ad | |
David Groys | c182602dfa | |
David Groys | 1028a91a47 | |
David Groys | 0d76243379 | |
David Groys | 89c767f5c9 | |
David Groys | 11db856157 | |
David Groys | 9bdae273d8 | |
David Groys | 316222e8b5 | |
David Groys | d803f6df2a | |
David Groys | 1e7bb5cdfe | |
David Groys | f8c35aca98 | |
David Groys | 8f5211a5ef | |
David Groys | 6090029284 | |
David Groys | 8d83fc784c | |
David Groys | 4a3c4dbcea | |
David Groys | 30d805e17d | |
selim | 751a3c7117 | |
selim | 592a22fbd8 | |
selim | 0f1dea7bec | |
selim | d3a7b96213 | |
selim | c0ac21148f | |
selim | a5d53ac895 | |
Selim Eser | 0c1b1fbe76 | |
Selim Eser | 3bde666802 | |
Selim Eser | a78f0bd47e | |
Selim Eser | c8344e3bf2 | |
Selim Eser | 5da483b279 | |
Selim Eser | 8abc7bda1b | |
Selim Eser | b66b2314d8 | |
Selim Eser | a2e432119e | |
Selim Eser | 7df63b10ed | |
Selim Eser | b71f9c090a | |
Selim Eser | ed2acc0065 | |
Selim Eser | f90eeb6841 | |
Selim Eser | a38c77533a | |
Selim Eser | 31a24b8c9a |
|
@ -0,0 +1,3 @@
|
||||||
|
Selim Eser 2211482: Selim Eser, Selim
|
||||||
|
David Groys 3012642: David Groys
|
||||||
|
Daniel Zdravkovic 3012893: Daniel Zdravkovic
|
3
pom.xml
3
pom.xml
|
@ -100,6 +100,9 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
<artifactId>maven-pmd-plugin</artifactId>
|
||||||
<version>3.22.0</version>
|
<version>3.22.0</version>
|
||||||
|
<configuration>
|
||||||
|
<failOnViolation>false</failOnViolation>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>verify</phase>
|
<phase>verify</phase>
|
||||||
|
|
|
@ -81,6 +81,7 @@ public class System {
|
||||||
Double.parseDouble(fileString[7])));
|
Double.parseDouble(fileString[7])));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +111,8 @@ public class System {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sign_up_user(String username, String password, String hometown, String zip,
|
public boolean sign_up_user(String username, String password, String password_authentication, String hometown,
|
||||||
|
String zip,
|
||||||
String car_name, String car_l_100kmS, String car_avg_kmhS, String bike_avg_kmhS) {
|
String car_name, String car_l_100kmS, String car_avg_kmhS, String bike_avg_kmhS) {
|
||||||
|
|
||||||
double car_l_100km;
|
double car_l_100km;
|
||||||
|
@ -128,6 +130,9 @@ public class System {
|
||||||
if (username.equals("") || password.equals("") || hometown.equals("") || zip.equals(""))
|
if (username.equals("") || password.equals("") || hometown.equals("") || zip.equals(""))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!password.equals(password_authentication))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (User user : this.all_user)
|
for (User user : this.all_user)
|
||||||
if (user.getUsername().equals(username))
|
if (user.getUsername().equals(username))
|
||||||
return false;
|
return false;
|
||||||
|
@ -170,12 +175,17 @@ public class System {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(username.equals("")||password.equals("")||hometown.equals("")||zip.equals(""))
|
if (!current_user.getPassword().equals(password))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (username.equals("") || hometown.equals("") || zip.equals(""))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!current_user.getUsername().equals(username)) {
|
||||||
for (User user : this.all_user)
|
for (User user : this.all_user)
|
||||||
if (user.getUsername().equals(username))
|
if (user.getUsername().equals(username))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<String> mem = search(zip);
|
ArrayList<String> mem = search(zip);
|
||||||
boolean bool = false;
|
boolean bool = false;
|
||||||
|
@ -189,6 +199,34 @@ public class System {
|
||||||
if (!bool)
|
if (!bool)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
for (int i = 0; i < this.all_user.size(); i++)
|
||||||
|
if (this.all_user.get(i).getUsername().equals(current_user.getUsername()))
|
||||||
|
this.all_user.remove(i);
|
||||||
|
|
||||||
|
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
||||||
|
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
||||||
|
|
||||||
|
this.current_user = new User(username, password, hometown, zip, car_name, car_l_100km, car_avg_kmh,
|
||||||
|
bike_avg_kmh);
|
||||||
|
this.all_user.add(current_user);
|
||||||
|
|
||||||
|
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
||||||
|
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
||||||
|
|
||||||
|
all_distances();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean change_user_password(String old_password, String new_password, String new_password_authentication) {
|
||||||
|
if (!this.current_user.getPassword().equals(old_password))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!new_password.equals(new_password_authentication))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(old_password.equals(new_password))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (int i = 0; i < this.all_user.size(); i++)
|
for (int i = 0; i < this.all_user.size(); i++)
|
||||||
if (this.all_user.get(i).getUsername().equals(current_user.getUsername()))
|
if (this.all_user.get(i).getUsername().equals(current_user.getUsername()))
|
||||||
|
@ -197,13 +235,12 @@ public class System {
|
||||||
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
||||||
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
||||||
|
|
||||||
this.current_user = new User(username, password, hometown, zip, car_name, car_l_100km, car_avg_kmh, bike_avg_kmh);
|
this.current_user.setPassword(new_password);
|
||||||
this.all_user.add(current_user);
|
this.all_user.add(current_user);
|
||||||
|
|
||||||
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
write_to_file(all_user_toString(), "src/main/resources/user_data.csv");
|
||||||
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
write_to_file(all_user_toString(), "src/test/resources/user_data.csv");
|
||||||
|
|
||||||
all_distances();
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -215,7 +252,9 @@ public class System {
|
||||||
writer.newLine();
|
writer.newLine();
|
||||||
}
|
}
|
||||||
writer.write(lines.getLast());
|
writer.write(lines.getLast());
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sign_out_user() {
|
public void sign_out_user() {
|
||||||
|
@ -223,8 +262,8 @@ public class System {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getDetails() {
|
public String[] getDetails() {
|
||||||
return new String[]{current_user.getUsername(), current_user.getPassword(),
|
return new String[] { current_user.getUsername(), current_user.getHometown(),
|
||||||
current_user.getHometown(), current_user.getZip(), current_user.getCar_name(),
|
current_user.getZip(), current_user.getCar_name(),
|
||||||
current_user.getCar_l_100km() == 0 ? "" : String.valueOf(current_user.getCar_l_100km()),
|
current_user.getCar_l_100km() == 0 ? "" : String.valueOf(current_user.getCar_l_100km()),
|
||||||
current_user.getCar_avg_kmh() == 0 ? "" : String.valueOf(current_user.getCar_avg_kmh()),
|
current_user.getCar_avg_kmh() == 0 ? "" : String.valueOf(current_user.getCar_avg_kmh()),
|
||||||
current_user.getBike_avg_kmh() == 0 ? "" : String.valueOf(current_user.getBike_avg_kmh()) };
|
current_user.getBike_avg_kmh() == 0 ? "" : String.valueOf(current_user.getBike_avg_kmh()) };
|
||||||
|
@ -240,10 +279,12 @@ public class System {
|
||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null && zip_set.size() < 200) {
|
while ((line = reader.readLine()) != null && zip_set.size() < 200) {
|
||||||
line = line.replace("\"", "");
|
line = line.replace("\"", "");
|
||||||
if (line.split(";")[0].contains(hometown_or_zip)||line.split(";")[1].contains(hometown_or_zip))
|
if (line.split(";")[0].toUpperCase().startsWith(hometown_or_zip.toUpperCase())
|
||||||
|
|| line.split(";")[1].toUpperCase().startsWith(hometown_or_zip.toUpperCase()))
|
||||||
zip_set.add(line);
|
zip_set.add(line);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayList<>(zip_set);
|
return new ArrayList<>(zip_set);
|
||||||
|
@ -286,13 +327,15 @@ public class System {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] destination_details(String destination_zip) {
|
public String[] destination_details(String destination_zip) {
|
||||||
String[] result = new String[5];
|
String[] result = new String[7];
|
||||||
|
|
||||||
result[0] = distance(destination_zip); // Entfernung
|
result[0] = weather_forecast(destination_zip)[0]; // Wettervorhersage für die nächsten 3 Tage
|
||||||
result[1] = travel_time(destination_zip)[0]; // Reisedauer Auto
|
result[1] = weather_forecast(destination_zip)[1];
|
||||||
result[2] = travel_time(destination_zip)[1]; // Reisedauer Fahrrad
|
result[2] = weather_forecast(destination_zip)[2];
|
||||||
result[3] = calc_l_consumption(destination_zip); // Kraftstoffverbrauch Auto
|
result[3] = distance(destination_zip); // Entfernung
|
||||||
result[4] = weather_forecast(destination_zip); // Wettervorhersage für die nächsten 3 Tage
|
result[4] = travel_time(destination_zip)[0]; // Reisedauer Auto
|
||||||
|
result[5] = calc_l_consumption(destination_zip); // Kraftstoffverbrauch Auto
|
||||||
|
result[6] = travel_time(destination_zip)[1]; // Reisedauer Fahrrad
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -304,37 +347,52 @@ public class System {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HttpClient http_client = HttpClient.newHttpClient();
|
HttpClient http_client = HttpClient.newHttpClient();
|
||||||
|
HttpRequest get_request;
|
||||||
|
|
||||||
HttpRequest get_request = HttpRequest.newBuilder()
|
if(current_user.getZip().length()<5){
|
||||||
.uri(new URI("https://api.openweathermap.org/data/2.5/weather?zip=" + current_user.getZip() + ",de&appid=" + api_key + "&units=metric&lang=de"))
|
get_request = HttpRequest.newBuilder()
|
||||||
|
.uri(new URI("https://api.openweathermap.org/data/2.5/weather?q=" + current_user.getHometown()
|
||||||
|
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
|
||||||
.GET()
|
.GET()
|
||||||
.build();
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
get_request = HttpRequest.newBuilder()
|
||||||
|
.uri(new URI("https://api.openweathermap.org/data/2.5/weather?zip=" + current_user.getZip()
|
||||||
|
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
|
||||||
|
.GET()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
|
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
|
||||||
|
|
||||||
JSONObject json = new JSONObject(((String) get_response.body()).substring(0, ((String) get_response.body()).length()));
|
JSONObject json = new JSONObject(get_response.body());
|
||||||
weather = json.getJSONArray("weather").getJSONObject(0).getString("description");
|
weather = json.getJSONArray("weather").getJSONObject(0).getString("description");
|
||||||
temperature = json.getJSONObject("main").getDouble("temp");
|
temperature = json.getJSONObject("main").getDouble("temp");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weather.equals(""))
|
if (weather.equals(""))
|
||||||
return "Es ist ein Fehler aufgetreten!";
|
return "Es ist ein Fehler aufgetreten!";
|
||||||
else
|
else
|
||||||
return weather + ": " + temperature + " °C";
|
return weather + " " + temperature + "°C";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String weather_forecast(String destination_zip) {
|
public String[] weather_forecast(String destination_zip) {
|
||||||
|
|
||||||
String weather_day_1 = "";
|
String weather_day_1 = "";
|
||||||
String weather_day_2 = "";
|
String weather_day_2 = "";
|
||||||
String weather_day_3 = "";
|
String weather_day_3 = "";
|
||||||
|
String[] result = new String[3];
|
||||||
|
|
||||||
double temperature_day_1_1 = 1;
|
double temperature_day_1_1 = 1;
|
||||||
double temperature_day_1_2 = 1;
|
double temperature_day_1_2 = 1;
|
||||||
double temperature_day_1_3 = 1;
|
double temperature_day_1_3 = 1;
|
||||||
double temperature_day_1_4 = 1;
|
double temperature_day_1_4 = 1;
|
||||||
|
double temperature_day_1_5 = 1;
|
||||||
|
|
||||||
TreeSet<Double> temperature_day_1 = new TreeSet<>();
|
TreeSet<Double> temperature_day_1 = new TreeSet<>();
|
||||||
double temperature_day_1_high = 1;
|
double temperature_day_1_high = 1;
|
||||||
|
@ -344,6 +402,7 @@ public class System {
|
||||||
double temperature_day_2_2 = 1;
|
double temperature_day_2_2 = 1;
|
||||||
double temperature_day_2_3 = 1;
|
double temperature_day_2_3 = 1;
|
||||||
double temperature_day_2_4 = 1;
|
double temperature_day_2_4 = 1;
|
||||||
|
double temperature_day_2_5 = 1;
|
||||||
|
|
||||||
TreeSet<Double> temperature_day_2 = new TreeSet<>();
|
TreeSet<Double> temperature_day_2 = new TreeSet<>();
|
||||||
double temperature_day_2_high = 1;
|
double temperature_day_2_high = 1;
|
||||||
|
@ -353,49 +412,147 @@ public class System {
|
||||||
double temperature_day_3_2 = 1;
|
double temperature_day_3_2 = 1;
|
||||||
double temperature_day_3_3 = 1;
|
double temperature_day_3_3 = 1;
|
||||||
double temperature_day_3_4 = 1;
|
double temperature_day_3_4 = 1;
|
||||||
|
double temperature_day_3_5 = 1;
|
||||||
|
|
||||||
TreeSet<Double> temperature_day_3 = new TreeSet<>();
|
TreeSet<Double> temperature_day_3 = new TreeSet<>();
|
||||||
double temperature_day_3_high = 1;
|
double temperature_day_3_high = 1;
|
||||||
double temperature_day_3_low = 1;
|
double temperature_day_3_low = 1;
|
||||||
|
|
||||||
|
String day1date = "";
|
||||||
|
String day2date = "";
|
||||||
|
String day3date = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HttpClient http_client = HttpClient.newHttpClient();
|
HttpClient http_client = HttpClient.newHttpClient();
|
||||||
|
HttpRequest get_request;
|
||||||
|
|
||||||
HttpRequest get_request = HttpRequest.newBuilder()
|
if(destination_zip.length()<5){
|
||||||
.uri(new URI("https://api.openweathermap.org/data/2.5/forecast?zip=" + destination_zip + ",de&appid=" + api_key + "&units=metric&lang=de"))
|
get_request = HttpRequest.newBuilder()
|
||||||
|
.uri(new URI("https://api.openweathermap.org/data/2.5/forecast?q=" + search(destination_zip).get(0).split(";")[1]
|
||||||
|
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
|
||||||
.GET()
|
.GET()
|
||||||
.build();
|
.build();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
get_request = HttpRequest.newBuilder()
|
||||||
|
.uri(new URI("https://api.openweathermap.org/data/2.5/forecast?zip=" + destination_zip
|
||||||
|
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
|
||||||
|
.GET()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
|
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
|
||||||
|
|
||||||
JSONObject json = new JSONObject(((String) get_response.body()).substring(0, ((String) get_response.body()).length()));
|
JSONObject json = new JSONObject(get_response.body());
|
||||||
weather_day_1 = json.getJSONArray("list").getJSONObject(11).getJSONArray("weather").getJSONObject(0).getString("description");
|
|
||||||
weather_day_2 = json.getJSONArray("list").getJSONObject(19).getJSONArray("weather").getJSONObject(0).getString("description");
|
|
||||||
weather_day_3 = json.getJSONArray("list").getJSONObject(27).getJSONArray("weather").getJSONObject(0).getString("description");
|
|
||||||
|
|
||||||
temperature_day_1_1 = json.getJSONArray("list").getJSONObject(8).getJSONObject("main").getDouble("temp");
|
int day1_1 = 0;
|
||||||
temperature_day_1_2 = json.getJSONArray("list").getJSONObject(10).getJSONObject("main").getDouble("temp");
|
int day1_2 = 0;
|
||||||
temperature_day_1_3 = json.getJSONArray("list").getJSONObject(12).getJSONObject("main").getDouble("temp");
|
int day1_3 = 0;
|
||||||
temperature_day_1_4 = json.getJSONArray("list").getJSONObject(14).getJSONObject("main").getDouble("temp");
|
int day1_4 = 0;
|
||||||
|
int day1_5 = 0;
|
||||||
|
int day2_1 = 0;
|
||||||
|
int day2_2 = 0;
|
||||||
|
int day2_3 = 0;
|
||||||
|
int day2_4 = 0;
|
||||||
|
int day2_5 = 0;
|
||||||
|
int day3_1 = 0;
|
||||||
|
int day3_2 = 0;
|
||||||
|
int day3_3 = 0;
|
||||||
|
int day3_4 = 0;
|
||||||
|
int day3_5 = 0;
|
||||||
|
|
||||||
temperature_day_2_1 = json.getJSONArray("list").getJSONObject(16).getJSONObject("main").getDouble("temp");
|
for (int i = 0; i < 40; i++) {
|
||||||
temperature_day_2_2 = json.getJSONArray("list").getJSONObject(18).getJSONObject("main").getDouble("temp");
|
|
||||||
temperature_day_2_3 = json.getJSONArray("list").getJSONObject(20).getJSONObject("main").getDouble("temp");
|
|
||||||
temperature_day_2_4 = json.getJSONArray("list").getJSONObject(22).getJSONObject("main").getDouble("temp");
|
|
||||||
|
|
||||||
temperature_day_3_1 = json.getJSONArray("list").getJSONObject(24).getJSONObject("main").getDouble("temp");
|
if (json.getJSONArray("list").getJSONObject(i).getString("dt_txt").split(" ")[1].startsWith("00")) {
|
||||||
temperature_day_3_2 = json.getJSONArray("list").getJSONObject(26).getJSONObject("main").getDouble("temp");
|
day1_1 = i + 3; // 9 Uhr
|
||||||
temperature_day_3_3 = json.getJSONArray("list").getJSONObject(28).getJSONObject("main").getDouble("temp");
|
day1_2 = day1_1 + 1; // 12 Uhr
|
||||||
temperature_day_3_4 = json.getJSONArray("list").getJSONObject(30).getJSONObject("main").getDouble("temp");
|
day1_3 = day1_2 + 1; // 15 Uhr
|
||||||
|
day1_4 = day1_3 + 1; // 18 Uhr
|
||||||
|
day1_5 = day1_4 + 1; // 21 Uhr
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = day1_5; i < 40; i++) {
|
||||||
|
|
||||||
|
if (json.getJSONArray("list").getJSONObject(i).getString("dt_txt").split(" ")[1].startsWith("00")) {
|
||||||
|
day2_1 = i + 3; // 9 Uhr
|
||||||
|
day2_2 = day2_1 + 1; // 12 Uhr
|
||||||
|
day2_3 = day2_2 + 1; // 15 Uhr
|
||||||
|
day2_4 = day2_3 + 1; // 18 Uhr
|
||||||
|
day2_5 = day2_4 + 1; // 21 Uhr
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = day2_5 + 1; i < 40; i++) {
|
||||||
|
|
||||||
|
if (json.getJSONArray("list").getJSONObject(i).getString("dt_txt").split(" ")[1].startsWith("00")) {
|
||||||
|
day3_1 = i + 3; // 9 Uhr
|
||||||
|
day3_2 = day3_1 + 1; // 12 Uhr
|
||||||
|
day3_3 = day3_2 + 1; // 15 Uhr
|
||||||
|
day3_4 = day3_3 + 1; // 18 Uhr
|
||||||
|
day3_5 = day3_4 + 1; // 21 Uhr
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
day1date = json.getJSONArray("list").getJSONObject(day1_1).getString("dt_txt").split(" ")[0];
|
||||||
|
day1date = day1date.split("-")[2] + "." + day1date.split("-")[1] + "." + day1date.split("-")[0];
|
||||||
|
day2date = json.getJSONArray("list").getJSONObject(day2_1).getString("dt_txt").split(" ")[0];
|
||||||
|
day2date = day2date.split("-")[2] + "." + day2date.split("-")[1] + "." + day2date.split("-")[0];
|
||||||
|
day3date = json.getJSONArray("list").getJSONObject(day3_1).getString("dt_txt").split(" ")[0];
|
||||||
|
day3date = day3date.split("-")[2] + "." + day3date.split("-")[1] + "." + day3date.split("-")[0];
|
||||||
|
|
||||||
|
weather_day_1 = json.getJSONArray("list").getJSONObject(day1_3).getJSONArray("weather").getJSONObject(0)
|
||||||
|
.getString("description");
|
||||||
|
weather_day_2 = json.getJSONArray("list").getJSONObject(day2_3).getJSONArray("weather").getJSONObject(0)
|
||||||
|
.getString("description");
|
||||||
|
weather_day_3 = json.getJSONArray("list").getJSONObject(day3_3).getJSONArray("weather").getJSONObject(0)
|
||||||
|
.getString("description");
|
||||||
|
|
||||||
|
temperature_day_1_1 = json.getJSONArray("list").getJSONObject(day1_1).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_1_2 = json.getJSONArray("list").getJSONObject(day1_2).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_1_3 = json.getJSONArray("list").getJSONObject(day1_3).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_1_4 = json.getJSONArray("list").getJSONObject(day1_4).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_1_5 = json.getJSONArray("list").getJSONObject(day1_5).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
|
||||||
|
temperature_day_2_1 = json.getJSONArray("list").getJSONObject(day2_1).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_2_2 = json.getJSONArray("list").getJSONObject(day2_2).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_2_3 = json.getJSONArray("list").getJSONObject(day2_3).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_2_4 = json.getJSONArray("list").getJSONObject(day2_4).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_2_5 = json.getJSONArray("list").getJSONObject(day2_5).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
|
||||||
|
temperature_day_3_1 = json.getJSONArray("list").getJSONObject(day3_1).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_3_2 = json.getJSONArray("list").getJSONObject(day3_2).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_3_3 = json.getJSONArray("list").getJSONObject(day3_3).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_3_4 = json.getJSONArray("list").getJSONObject(day3_4).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
temperature_day_3_5 = json.getJSONArray("list").getJSONObject(day3_5).getJSONObject("main")
|
||||||
|
.getDouble("temp");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
temperature_day_1.add(temperature_day_1_1);
|
temperature_day_1.add(temperature_day_1_1);
|
||||||
temperature_day_1.add(temperature_day_1_2);
|
temperature_day_1.add(temperature_day_1_2);
|
||||||
temperature_day_1.add(temperature_day_1_3);
|
temperature_day_1.add(temperature_day_1_3);
|
||||||
temperature_day_1.add(temperature_day_1_4);
|
temperature_day_1.add(temperature_day_1_4);
|
||||||
|
temperature_day_1.add(temperature_day_1_5);
|
||||||
|
|
||||||
temperature_day_1_high = (double) temperature_day_1.toArray()[temperature_day_1.size() - 1];
|
temperature_day_1_high = (double) temperature_day_1.toArray()[temperature_day_1.size() - 1];
|
||||||
temperature_day_1_low = (double) temperature_day_1.toArray()[0];
|
temperature_day_1_low = (double) temperature_day_1.toArray()[0];
|
||||||
|
@ -404,24 +561,34 @@ public class System {
|
||||||
temperature_day_2.add(temperature_day_2_2);
|
temperature_day_2.add(temperature_day_2_2);
|
||||||
temperature_day_2.add(temperature_day_2_3);
|
temperature_day_2.add(temperature_day_2_3);
|
||||||
temperature_day_2.add(temperature_day_2_4);
|
temperature_day_2.add(temperature_day_2_4);
|
||||||
|
temperature_day_2.add(temperature_day_2_5);
|
||||||
|
|
||||||
temperature_day_2_high = (double) temperature_day_2.toArray()[temperature_day_1.size() - 1];
|
temperature_day_2_high = (double) temperature_day_2.toArray()[temperature_day_2.size() - 1];
|
||||||
temperature_day_2_low = (double) temperature_day_2.toArray()[0];
|
temperature_day_2_low = (double) temperature_day_2.toArray()[0];
|
||||||
|
|
||||||
temperature_day_3.add(temperature_day_3_1);
|
temperature_day_3.add(temperature_day_3_1);
|
||||||
temperature_day_3.add(temperature_day_3_2);
|
temperature_day_3.add(temperature_day_3_2);
|
||||||
temperature_day_3.add(temperature_day_3_3);
|
temperature_day_3.add(temperature_day_3_3);
|
||||||
temperature_day_3.add(temperature_day_3_4);
|
temperature_day_3.add(temperature_day_3_4);
|
||||||
|
temperature_day_3.add(temperature_day_3_5);
|
||||||
|
|
||||||
temperature_day_3_high = (double) temperature_day_3.toArray()[temperature_day_1.size() - 1];
|
temperature_day_3_high = (double) temperature_day_3.toArray()[temperature_day_2.size() - 1];
|
||||||
temperature_day_3_low = (double) temperature_day_3.toArray()[0];
|
temperature_day_3_low = (double) temperature_day_3.toArray()[0];
|
||||||
|
|
||||||
if (weather_day_1.equals("") || weather_day_2.equals("") || weather_day_3.equals(""))
|
if (weather_day_1.equals("") || weather_day_2.equals("") || weather_day_3.equals("")) {
|
||||||
return "Es ist ein Fehler aufgetreten!";
|
result[0] = "Es ist ein Fehler aufgetreten!";
|
||||||
else
|
result[1] = "Es ist ein Fehler aufgetreten!";
|
||||||
return "Morgen: " + weather_day_1 + ": Minimum: " + temperature_day_1_low + " °C" + "; Maximum: " + temperature_day_1_high + " °C\n"
|
result[2] = "Es ist ein Fehler aufgetreten!";
|
||||||
+ "Übermorgen: " + weather_day_2 + ": Minimum: " + temperature_day_2_low + " °C" + "; Maximum: " + temperature_day_2_high + " °C\n"
|
} else {
|
||||||
+ "Überübermorgen: " + weather_day_3 + ": Minimum: " + temperature_day_3_low + " °C" + "; Maximum: " + temperature_day_3_high + " °C";
|
result[0] = day1date + ": " + weather_day_1 + " H: " + temperature_day_1_high + "°C" + " T: "
|
||||||
|
+ temperature_day_1_low + "°C";
|
||||||
|
result[1] = day2date + ": " + weather_day_2 + " H: " + temperature_day_2_high + "°C" + " T: "
|
||||||
|
+ temperature_day_2_low + "°C";
|
||||||
|
result[2] = day3date + ": " + weather_day_3 + " H: " + temperature_day_3_high + "°C" + " T: "
|
||||||
|
+ temperature_day_3_low + "°C";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean all_distances() {
|
public boolean all_distances() {
|
||||||
|
@ -449,6 +616,7 @@ public class System {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
InputStream inputStream2 = System.class.getResourceAsStream("/zip.csv");
|
InputStream inputStream2 = System.class.getResourceAsStream("/zip.csv");
|
||||||
|
@ -467,16 +635,20 @@ public class System {
|
||||||
dLat = lat2 - lat1;
|
dLat = lat2 - lat1;
|
||||||
dLon = lon2 - lon1;
|
dLon = lon2 - lon1;
|
||||||
|
|
||||||
a = Math.pow(Math.sin(Math.toRadians(dLat / 2.0)), 2) + Math.pow(Math.sin(Math.toRadians(dLon / 2.0)), 2) * Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2));
|
a = Math.pow(Math.sin(Math.toRadians(dLat / 2.0)), 2)
|
||||||
|
+ Math.pow(Math.sin(Math.toRadians(dLon / 2.0)), 2) * Math.cos(Math.toRadians(lat1))
|
||||||
|
* Math.cos(Math.toRadians(lat2));
|
||||||
|
|
||||||
distance = 6378.388 * 2.0 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0 - a));
|
distance = 6378.388 * 2.0 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0 - a));
|
||||||
|
|
||||||
result = Math.round((distance * 1.25) * 1000) / 1000.0;
|
result = Math.round(distance * 1.25 * 100) / 100.0;
|
||||||
|
|
||||||
this.all_destinations.put(line.split(";")[0],new Destination(line.split(";")[1],line.split(";")[0], result));
|
this.all_destinations.put(line.split(";")[0],
|
||||||
|
new Destination(line.split(";")[1], line.split(";")[0], result));
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -492,16 +664,27 @@ public class System {
|
||||||
|
|
||||||
String[] result = new String[2];
|
String[] result = new String[2];
|
||||||
|
|
||||||
result[0] = "" + (Math.round(((Double.parseDouble(distance(destination_zip).replace(" km", "")) / current_user.getCar_avg_kmh())) * 1000) / 1000.0) + " h";
|
if (current_user.getCar_avg_kmh() == 0)
|
||||||
result[1] = "" + (Math.round(((Double.parseDouble(distance(destination_zip).replace(" km", "")) / current_user.getBike_avg_kmh())) * 1000) / 1000.0) + " h";
|
result[0] = "";
|
||||||
|
else
|
||||||
|
result[0] = "" + (Math.round(Double.parseDouble(distance(destination_zip).replace(" km", ""))
|
||||||
|
/ current_user.getCar_avg_kmh() * 100) / 100.0) + " h";
|
||||||
|
|
||||||
|
if (current_user.getBike_avg_kmh() == 0)
|
||||||
|
result[1] = "";
|
||||||
|
else
|
||||||
|
result[1] = "" + (Math.round(Double.parseDouble(distance(destination_zip).replace(" km", ""))
|
||||||
|
/ current_user.getBike_avg_kmh() * 100) / 100.0) + " h";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String calc_l_consumption(String destination_zip) {
|
public String calc_l_consumption(String destination_zip) {
|
||||||
|
|
||||||
return "" + (Math.round((Double.parseDouble(distance(destination_zip).replace(" km", "")) * (current_user.getCar_l_100km() / 100.0)) * 1000) / 1000.0) + " l";
|
if (current_user.getCar_l_100km() == 0)
|
||||||
|
return "";
|
||||||
|
return "" + (Math.round(Double.parseDouble(distance(destination_zip).replace(" km", ""))
|
||||||
|
* current_user.getCar_l_100km() / 100.0 * 100) / 100.0) + " l";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ public class Application {
|
||||||
return running_system.sign_in_user(username, password);
|
return running_system.sign_in_user(username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sign_up_user(String username, String password, String hometown, String zip,
|
public boolean sign_up_user(String username, String password, String password_authentication, String hometown, String zip,
|
||||||
String car_name, String car_co2_km, String car_avg_kmh, String bike_avg_kmh){
|
String car_name, String car_co2_km, String car_avg_kmh, String bike_avg_kmh){
|
||||||
return running_system.sign_up_user(username, password, hometown, zip, car_name, car_co2_km, car_avg_kmh, bike_avg_kmh);
|
return running_system.sign_up_user(username, password, password_authentication, hometown, zip, car_name, car_co2_km, car_avg_kmh, bike_avg_kmh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sign_out_user(){
|
public void sign_out_user(){
|
||||||
|
@ -30,6 +30,10 @@ public class Application {
|
||||||
return running_system.change_user_details(username, password, hometown, zip, car_name, car_co2_km, car_avg_kmh, bike_avg_kmh);
|
return running_system.change_user_details(username, password, hometown, zip, car_name, car_co2_km, car_avg_kmh, bike_avg_kmh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean change_user_password(String old_password, String new_password, String new_password_authentication){
|
||||||
|
return running_system.change_user_password(old_password, new_password, new_password_authentication);
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<String> search(String hometown_or_zip){
|
public ArrayList<String> search(String hometown_or_zip){
|
||||||
return running_system.search(hometown_or_zip);
|
return running_system.search(hometown_or_zip);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -1,2 +1,2 @@
|
||||||
Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
||||||
David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;300.0;20.0
|
David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;100.0;20.0
|
|
|
@ -14,7 +14,9 @@ public class SystemTest {
|
||||||
@Test
|
@Test
|
||||||
public void weather_forecast() {
|
public void weather_forecast() {
|
||||||
|
|
||||||
assertNotEquals("Es ist ein Fehler aufgetreten!",current_system.weather_forecast("68161"));
|
current_system.sign_in_user("David", "123Esel");
|
||||||
|
|
||||||
|
assertNotEquals("Es ist ein Fehler aufgetreten!", current_system.weather_forecast("68161")[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -41,8 +43,8 @@ public class SystemTest {
|
||||||
current_system.sign_in_user("David", "123Esel");
|
current_system.sign_in_user("David", "123Esel");
|
||||||
|
|
||||||
assertEquals("88.46 km", current_system.distance("60306")); // Frankfurt
|
assertEquals("88.46 km", current_system.distance("60306")); // Frankfurt
|
||||||
assertEquals("581.109 km", current_system.distance("20095")); // Hamburg
|
assertEquals("581.11 km", current_system.distance("20095")); // Hamburg
|
||||||
assertEquals("603.608 km", current_system.distance("10115")); // Berlin
|
assertEquals("603.61 km", current_system.distance("10115")); // Berlin
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,13 +53,10 @@ public class SystemTest {
|
||||||
|
|
||||||
current_system.sign_in_user("David", "123Esel");
|
current_system.sign_in_user("David", "123Esel");
|
||||||
|
|
||||||
current_system.set_current_user_car_avg_kmh(100);
|
assertEquals("0.88 h", current_system.travel_time("60306")[0]); // Frankfurt mit Auto
|
||||||
current_system.set_current_user_bike_avg_kmh(20);
|
assertEquals("4.42 h", current_system.travel_time("60306")[1]); // Frankfurt mit Fahrrad
|
||||||
|
|
||||||
assertEquals("0.885 h", current_system.travel_time("60306")[0]); // Frankfurt mit Auto
|
assertEquals("6.04 h", current_system.travel_time("10115")[0]); // Berlin mit Auto
|
||||||
assertEquals("4.423 h", current_system.travel_time("60306")[1]); // Frankfurt mit Fahrrad
|
|
||||||
|
|
||||||
assertEquals("6.036 h", current_system.travel_time("10115")[0]); // Berlin mit Auto
|
|
||||||
assertEquals("30.18 h", current_system.travel_time("10115")[1]); // Berlin mit Fahrrad
|
assertEquals("30.18 h", current_system.travel_time("10115")[1]); // Berlin mit Fahrrad
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +65,9 @@ public class SystemTest {
|
||||||
|
|
||||||
current_system.sign_in_user("David", "123Esel");
|
current_system.sign_in_user("David", "123Esel");
|
||||||
|
|
||||||
current_system.set_current_user_car_avg_kmh(100);
|
assertEquals("8.85 l", current_system.calc_l_consumption("60306")); // Kraftstoffverbrauch nach Frankfurt
|
||||||
current_system.set_current_user_car_l_100km(10);
|
assertEquals("58.11 l", current_system.calc_l_consumption("20095")); // Kraftstoffverbrauch nach Hamburg
|
||||||
|
assertEquals("60.36 l", current_system.calc_l_consumption("10115")); // Kraftstoffverbrauch nach Berlin
|
||||||
assertEquals("8.846 l", current_system.calc_l_consumption("60306")); // Kraftstoffverbrauch nach Frankfurt
|
|
||||||
assertEquals("58.111 l", current_system.calc_l_consumption("20095")); // Kraftstoffverbrauch nach Hamburg
|
|
||||||
assertEquals("60.361 l", current_system.calc_l_consumption("10115")); // Kraftstoffverbrauch nach Berlin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -84,10 +80,14 @@ public class SystemTest {
|
||||||
assertEquals(3, random_destination_car.size()); // random_destinations_car gibt genau 3 destinations zurück
|
assertEquals(3, random_destination_car.size()); // random_destinations_car gibt genau 3 destinations zurück
|
||||||
assertEquals(3, random_destination_bike.size()); // random destinations_bike gibt genau 3 destinations zurück
|
assertEquals(3, random_destination_bike.size()); // random destinations_bike gibt genau 3 destinations zurück
|
||||||
|
|
||||||
// random_destinations_car gibt nur destinations mit mindestens 150 km Entfernung zurück
|
// random_destinations_car gibt nur destinations mit mindestens 150 km
|
||||||
assertEquals(true, Double.parseDouble(current_system.distance(random_destination_car.get(0).split(";")[0]).replace(" km", "")) > 150);
|
// Entfernung zurück
|
||||||
// random_destinations_bike gibt nur destinations mit maximal 100 km Entfernung zurück
|
assertEquals(true, Double.parseDouble(
|
||||||
assertEquals(true, Double.parseDouble(current_system.distance(random_destination_bike.get(0).split(";")[0]).replace(" km", "")) < 100);
|
current_system.distance(random_destination_car.get(0).split(";")[0]).replace(" km", "")) > 150);
|
||||||
|
// random_destinations_bike gibt nur destinations mit maximal 100 km Entfernung
|
||||||
|
// zurück
|
||||||
|
assertEquals(true, Double.parseDouble(
|
||||||
|
current_system.distance(random_destination_bike.get(0).split(";")[0]).replace(" km", "")) < 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -129,30 +129,48 @@ public class SystemTest {
|
||||||
@Test
|
@Test
|
||||||
public void sign_up_user() {
|
public void sign_up_user() {
|
||||||
// Username darf nicht doppelt vorkommen!
|
// Username darf nicht doppelt vorkommen!
|
||||||
assertEquals(false, current_system.sign_up_user("David","123Esel","Mannheim","68161","AMG","10","300","20"));
|
assertEquals(false, current_system.sign_up_user("David", "123Esel", "123Esel", "Mannheim", "68161", "AMG", "10",
|
||||||
assertEquals(true, current_system.sign_up_user("Selim","Penis69","Mannheim","68161","AMG","10","300","20"));
|
"300", "20"));
|
||||||
|
assertEquals(true, current_system.sign_up_user("Selim", "Penis69", "Penis69", "Mannheim", "68161", "AMG", "10",
|
||||||
|
"300", "20"));
|
||||||
// PLZ muss mit Stadt übereinstimmen
|
// PLZ muss mit Stadt übereinstimmen
|
||||||
assertEquals(false, current_system.sign_up_user("Lukas","123Esel","Mannheim","11105","AMG","10","300","20"));
|
assertEquals(false, current_system.sign_up_user("Lukas", "123Esel", "123Esel", "Mannheim", "11105", "AMG", "10",
|
||||||
assertEquals(true, current_system.sign_up_user("Lukas","123Esel","Mannheim","68305","AMG","10","300","20"));
|
"300", "20"));
|
||||||
|
assertEquals(true, current_system.sign_up_user("Lukas", "123Esel", "123Esel", "Mannheim", "68305", "AMG", "10",
|
||||||
|
"300", "20"));
|
||||||
|
|
||||||
assertEquals("Lukas", current_system.getDetails()[0]);
|
assertEquals("Lukas", current_system.getDetails()[0]);
|
||||||
current_system.sign_out_user();
|
current_system.sign_out_user();
|
||||||
assertEquals("", current_system.getDetails()[0]);
|
assertEquals("", current_system.getDetails()[0]);
|
||||||
|
assertEquals(true, current_system.sign_in_user("Lukas", "123Esel"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void change_user_details() {
|
public void change_user_details() {
|
||||||
|
|
||||||
current_system.sign_in_user("David", "123Esel");
|
current_system.sign_in_user("David", "123Esel");
|
||||||
current_system.change_user_details("Enes", "Penis123", "Mannheim", "68161", "", "", "", "");
|
current_system.change_user_details("Enes", "123Esel", "Mannheim", "68161", "", "", "", "");
|
||||||
assertEquals("Enes", current_system.getDetails()[0]);
|
assertEquals("Enes", current_system.getDetails()[0]);
|
||||||
|
current_system.change_user_details("David", "123Esel", "Mannheim", "68161", "AMG", "10", "100", "20");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void change_user_password() {
|
||||||
|
|
||||||
|
current_system.sign_in_user("David", "123Esel");
|
||||||
|
assertEquals(true, current_system.change_user_password("123Esel", "Pizza69", "Pizza69"));
|
||||||
|
assertEquals(true, current_system.change_user_password("Pizza69", "123Esel", "123Esel"));
|
||||||
|
assertEquals(true, current_system.change_user_details("Enes", "123Esel", "Mannheim", "68161", "", "", "", ""));
|
||||||
|
current_system.change_user_details("David", "123Esel", "Mannheim", "68161", "AMG", "10", "100", "20");
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Tests auf Basis von user_data.csv:
|
* Tests auf Basis von user_data.csv:
|
||||||
Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
* Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
||||||
David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;300.0;20.0
|
* David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;100.0;20.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,2 +1,2 @@
|
||||||
Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
Daniel;MTQwMURhbmllbA==;Mannheim;68305;BMW;1.5;50.4;40.2
|
||||||
David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;300.0;20.0
|
David;MTIzRXNlbA==;Mannheim;68161;AMG;10.0;100.0;20.0
|
|
Loading…
Reference in New Issue