updates.
This commit is contained in:
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
@@ -1,6 +1,13 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "TestAccountLoad",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "lodge.TestAccountLoad",
|
||||||
|
"projectName": "reservationsystem"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "java",
|
"type": "java",
|
||||||
"name": "TestReservations",
|
"name": "TestReservations",
|
||||||
@@ -14,7 +21,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"mainClass": "lodge.TestMainFx",
|
"mainClass": "lodge.TestMainFx",
|
||||||
"projectName": "reservationsystem",
|
"projectName": "reservationsystem",
|
||||||
"vmArgs": " --module-path ./libs:. --add-modules ALL-MODULE-PATH --enable-native-access=javafx.web,javafx.controls,javafx.graphics -Dcom.sun.management.jmxremote=false -Djava.awt.headless=true -XX:+DisableAttachMechanism",
|
"vmArgs": " --module-path .;${workspaceFolder}/libs;${workspaceFolder}/libs/win32 --add-modules ALL-MODULE-PATH --enable-native-access=javafx.web,javafx.controls,javafx.graphics -Dcom.sun.management.jmxremote=false -Djava.awt.headless=true -XX:+DisableAttachMechanism",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"console": "integratedTerminal"
|
"console": "integratedTerminal"
|
||||||
},
|
},
|
||||||
|
|||||||
BIN
libs/win32/javafx-base-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-base-24.0.1-win.jar
Normal file
Binary file not shown.
BIN
libs/win32/javafx-controls-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-controls-24.0.1-win.jar
Normal file
Binary file not shown.
BIN
libs/win32/javafx-fxml-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-fxml-24.0.1-win.jar
Normal file
Binary file not shown.
BIN
libs/win32/javafx-graphics-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-graphics-24.0.1-win.jar
Normal file
Binary file not shown.
BIN
libs/win32/javafx-media-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-media-24.0.1-win.jar
Normal file
Binary file not shown.
BIN
libs/win32/javafx-web-24.0.1-win.jar
Normal file
BIN
libs/win32/javafx-web-24.0.1-win.jar
Normal file
Binary file not shown.
@@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
package lodge;
|
package lodge;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import lodge.datamodel.Account;
|
import lodge.datamodel.Account;
|
||||||
import lodge.datamodel.Address;
|
import lodge.datamodel.Address;
|
||||||
import lodge.datamodel.EmailAddress;
|
import lodge.datamodel.EmailAddress;
|
||||||
@@ -30,23 +33,42 @@ public final class TestAccountLoad {
|
|||||||
// memory
|
// memory
|
||||||
mgr.UpdateAccount(acct);
|
mgr.UpdateAccount(acct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final static Address findIventory(List<Address> propertyIventory, String street) {
|
||||||
|
Address inventory = propertyIventory
|
||||||
|
.stream()
|
||||||
|
.filter((Address inv) -> {
|
||||||
|
return inv.getStreet().equals("10 wilco ave");
|
||||||
|
}).findFirst().orElse(null);
|
||||||
|
return inventory;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// Configure data repository
|
// Configure data repository
|
||||||
AccomodationManager mgr = new AccomodationManager(AccomodationManager.getRepositoryConfig.getPath());
|
AccomodationManager mgr = new AccomodationManager(AccomodationManager.getRepositoryConfig.getPath());
|
||||||
|
|
||||||
|
List<Address> propertyIventory = new ArrayList<Address>();
|
||||||
|
|
||||||
|
propertyIventory.add(new Address("10 wilco ave", "wilco", "WY", "82801"));
|
||||||
|
propertyIventory.add(new Address("30 Amstadam ave", "New York", "NY", "12010"));
|
||||||
|
propertyIventory.add(new Address("400 hotel ave", "Maryland City", "MD", "20723"));
|
||||||
|
|
||||||
// 3. Add new account object to the list managed by Manager (if account object
|
// 3. Add new account object to the list managed by Manager (if account object
|
||||||
// already exists on add action with the same account number, it is considered
|
// already exists on add action with the same account number, it is considered
|
||||||
// an error)
|
// an error)
|
||||||
Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
|
|
||||||
new Address("10 wilco ave", "wilco", "WY", "82801"),
|
|
||||||
new EmailAddress("wilco@wyommin.net")));
|
|
||||||
|
|
||||||
Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
|
Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
|
||||||
new Address("10 wilco ave", "wilco", "WY", "82801"),
|
findIventory(propertyIventory, "10 wilco ave"),
|
||||||
new EmailAddress("wilco@wyommin.net")));
|
new EmailAddress("wilco@wyommin.net")));
|
||||||
|
|
||||||
|
System.out.println("Account already exists in list, so add attempt should fail:");
|
||||||
mgr.showAccountList();
|
mgr.showAccountList();
|
||||||
|
|
||||||
|
Test_AddAccount(mgr, mgr.newAccount("701-456-7890",
|
||||||
|
findIventory(propertyIventory, "10 wilco ave"),
|
||||||
|
new EmailAddress("wilco@wyommin.net")));
|
||||||
|
|
||||||
System.out.println("Program Completed.");
|
System.out.println("Program Completed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "Account":{"account_number": "A45098176","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservations":[{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}}]}}
|
{ "Account":{"account_number": "A45098176","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservations":[]}}
|
||||||
Reference in New Issue
Block a user