5 // Set testing mode (no starter.php will be loaded!)
6 define('TEST_MODE', true);
9 require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
11 // Load all include files
12 require(PATH . "inc/includes.php");
14 // Load all game classes
15 require(PATH . "inc/classes.php");
17 // Load file I/O handler
18 require(PATH . "inc/file_io.php");
20 // Load database layer
21 require(PATH . "inc/database.php");
23 // Set default application
24 FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
25 $application = "ship-simu";
28 require(PATH . "application/ship-simu/loader.php");
30 // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
31 // jetzt die Personalliste wiederherstellen
33 $personell = SimulatorPersonell::createSimulatorPersonellByID("SimulatorPersonell@829292aeca3f6bf78c16e25fc4f75c98");
34 } catch (InvalidIDFormatException $e) {
35 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
38 } catch (InvalidArrayCountException $e) {
39 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
42 } catch (NullPointerException $e) {
43 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
46 } catch (NoObjectException $e) {
47 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
50 } catch (MissingMethodException $e) {
51 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
54 } catch (FileIsEmptyException $e) {
55 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
58 } catch (FilePointerNotOpenedException $e) {
59 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
62 } catch (InvalidArrayCountException $e) {
63 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
66 } catch (InvalidMD5ChecksumException $e) {
67 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
70 } catch (InvalidDataLengthException $e) {
71 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
74 } catch (InvalidSimulatorIDException $e) {
75 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
78 } catch (MismatchingCompressorsException $e) {
79 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
82 } catch (ContainerItemIsNullException $e) {
83 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
86 } catch (ContainerItemIsNoArrayException $e) {
87 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
90 } catch (ContainerMaybeDamagedException $e) {
91 die(sprintf("[Main:] Could not create personal list for follwing reason: <strong>%s</strong><br />\n",
96 // Personal-Objekt debuggen
97 if (defined('DEBUG_PERSONELL_OBJ')) {
98 DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:<br />
100 print_r($personell, true)
104 // Erstmal bis hier hin
107 // Etwas zum Testen...
109 $personell = SimulatorPersonell::createSimulatorPersonell(20);
110 } catch (NullPointerException $e) {
111 die(sprintf("[Main:] Personal list not created for following reason: <strong>%s</strong><br />\n",
114 } catch (NoObjectException $e) {
115 die(sprintf("[Main:] Personal list not created for following reason: <strong>%s</strong><br />\n",
118 } catch (MissingMethodException $e) {
119 die(sprintf("[Main:] Personal list not created for following reason: <strong>%s</strong><br />\n",
124 // Personal-Objekt debuggen
125 if (defined('DEBUG_PERSONELL_OBJ')) {
126 DebugMiddleware::getInstance()->output(sprintf("The personal object looks like this:<br />
128 print_r($personell, true)
132 // Try to save the object (for testing purposes)
134 $personell->saveObjectToDatabase();
135 } catch (NullPointerException $e) {
136 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
139 } catch (NoObjectException $e) {
140 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
143 } catch (InvalidObjectException $e) {
144 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
147 } catch (MissingMethodException $e) {
148 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
151 } catch (UnsupportedLimitationPartException $e) {
152 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
155 } catch (GetterNotFoundException $e) {
156 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
159 } catch (NoArrayCreatedException $e) {
160 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",
163 } catch (InvalidArrayCountException $e) {
164 die(sprintf("[Main:] Object not saved for following reason: <strong>%s</strong><br />\n",