diff --git a/bundle/pom.xml b/bundle/pom.xml index 11ee2cd9b..dfb4c1f96 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -159,6 +159,27 @@ + + org.apache.maven.plugins + maven-resources-plugin + + + copy-defaults-xml + validate + + copy-resources + + + ${project.basedir}/target/classes/etc + + + ${project.parent.basedir}/rti/mosaic-starter/etc + + + + + + maven-remote-resources-plugin diff --git a/bundle/src/assembly/bundle-resources.xml b/bundle/src/assembly/bundle-resources.xml index 7971628c0..fb0ca8409 100644 --- a/bundle/src/assembly/bundle-resources.xml +++ b/bundle/src/assembly/bundle-resources.xml @@ -28,6 +28,9 @@ ** + + etc/** + diff --git a/bundle/src/assembly/mosaic-bundle.xml b/bundle/src/assembly/mosaic-bundle.xml index e2ea83099..0fb75cf06 100644 --- a/bundle/src/assembly/mosaic-bundle.xml +++ b/bundle/src/assembly/mosaic-bundle.xml @@ -16,7 +16,7 @@ 0755 - src/assembly/resources/etc + ${project.build.directory}/classes/etc etc ** diff --git a/bundle/src/assembly/resources/etc/xsd/runtime.xsd b/bundle/src/assembly/resources/etc/xsd/runtime.xsd deleted file mode 100644 index 3f9c33b61..000000000 --- a/bundle/src/assembly/resources/etc/xsd/runtime.xsd +++ /dev/null @@ -1,536 +0,0 @@ - - - - - - For example see etc/runtime.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MOSAIC tries to instantiate the given federate ambassador implementation. - - - - - - - Sets the priority for the federate, with the smaller - number being the higher priority. - - - - - - - - - If deploy is set to true, - the federate - binaries, located in - bin/fed/federate-id - will be copied to the - specified location - tmp/fed/federation-id - for local deployment, - remote directory for remote hosts. - - - - - - - Specifing a unique - identifier as well as the - configuration folder - name. - MOSAIC is - looking for the federates - configuration in the folder - path/to/scenario/federate-id - . - - - - - - - true will fetch a - startcommand from the - federate and creates a new - process running the - federate. - - - - - - - The hosts are specified - in - etc/hosts.json - ,insert the host, where - this - federate runs on using the host id here. - - - - - - - Give the name of the - configuration for your - federate here, a - reference to this file will - be forwarded to the ambassador implementation. - - - - - - - Give the path to a - subdirectory to which the - configuration files for the - federates are deploy to. - - - - - - - Define a name of an docker image on which the federate is - installed. This - image will be used to create and run a docker container. - - - - - - - - - The port, which is used - for communication - between federate and - ambassador. - - - - - - - - Subscriptions contains the - list of MOSAIC - interactions, which will be - received by the ambassador. - Only interactions specified here will be forwarded. - - - - - - - - - - - - [S] - V2xMessageReception - Notifies the affected vehicle and delivers the - payload message when a - receive-event for that simulated node happens - in the simulated - network. - - [R] - VehicleRegistration - Used to add/remove new - vehicles as network nodes. - - [R] RsuRegistration - Used to add new RSUs as - network - nodes. - - [R] TrafficLightRegistration - Used to add new TrafficLights as - network nodes. - - [R] VehicleUpdates - Used to - update the positions of - the simulated network nodes. - - [R] V2xMessageTransmission - Emits a new V2X - message according to - the applications implementation. - - [R] - VehicleTileMigration - TODO: Add description here. - - == OMNeT++ == - - [S] - V2xMessageReception - Notifies the affected - vehicle and delivers the - payload message when a - receive-event for that simulated node happens - in the - simulated - network. - - [R] VehicleRegistration - Used to add/remove new - vehicles as network nodes. - - [R] RsuRegistration - Used to add - new RSUs as - network nodes. - - [R] TrafficLightRegistration - Used to add new TrafficLights as - network nodes. - - [R] - VehicleUpdates - Used to update the positions of - the simulated network nodes. - - [R] V2xMessageTransmission - Emits a new - V2X - message according to the applications implementation. - - == SUMO == - class: - org.eclipse.mosaic.fed.sumo.ambassador.SumoAmbassador - - [S] - VehicleUpdates - Is sent in the defined - update-interval and notifies - listeners about - added, updated and removed vehicles in the - simulation. - - [S] - TrafficLightUpdates - Is sent to update traffic light groups in - application container after the - changes - of traffic - lights' state. - - [R] - VehicleTypesInitialization - Causes SUMO to initialize the vehicle types. - - [R] VehicleRegistration - Used to add/remove new vehicles as network nodes. - - [R] VehicleRouteChange - Causes SUMO to re-route the affected - vehicle in a static way. - - [R] - VehicleLaneChange - Causes SUMO to change the road - lane of the affected vehicle. - - [R] VehicleSlowDown - Sets the vehicles - current - speed to the given value. - - [R] - TrafficLightStateChange - Changes the - states of traffic lights, e.g. current phase remaining - time, program, - etc.. - - == V2X-Application == - - [S] - V2xMessageTransmission - Emits a new V2X message according to the applications - implementation. - - [S] - TrafficLightStateChange - Is sent to change the - state of traffic light. - - [R] V2xMessageReception - Delivers the - payload of - the V2X Message to the underlying simulated - application. - - [R] - EnvironmentSensorUpdates - Adds a traffic light with - the local traffic light - information - (e.g. position, program, etc.). - - [R] VehicleUpdates - Updates the local - vehicle information - (e.g. position, speed, etc.). - - [R] TrafficLightRegistration - Adds a traffic light with the local - traffic - light information - (e.g. position, program, etc.). - - [R] RsuRegistration - Adds an - RSU with the local RSU - information - (e.g. position). - - [R] VehicleRegistration - Adds a vehicle with the local vehicle information. - - [R] - VehicleNavigationUpdate - Updates the local Navigation information, - such as street, road length etc. - - [R] - VehicleTypesInitialization - Causes - the application simulator to initialize the vehicle's types. - - [R] - TrafficLightUpdates - Causes the application simulator to update simulation units - responsible for changed traffic light groups. - - [R] ReceiveCellMessage - TODO: Add description here. - - [R] - SumoTraciResponse - TODO: Add description - here. - - == - Navigation == - - [S] - VehicleRouteChange - Used to - inform a traffic simulator e.g. Vissim - about a new route. - This route was pre-calculated in advance, - therefore only - the new path and vehicle id is supplied. - - [S] - VehicleRoutesInitialization - This interaction is emitted, - when the ambassador - completed its path - generation. - The interaction contains all generated path - and its ids. - - [S] - VehicleNavigationUpdate - Sent to the application - simulator to inform it about the - new route, street length, - max speed - etc.. - - [R] VehicleUpdates - Is used to react on every movement by - sending a NavigationUpdate. - - [R] - VehicleRegistration - Used to distinguish - between virtual and classic vehicles. - - == Environment == - - [S] EnvironmentSensorUpdates - Informs - any - vehicle that is affected of an environmental event - that it has - new EnvironmentSensorUpdates available. - - [R] - EnvironmentSensorActivation - New vehicles sent - this to register for environment events. - - [R] VehicleUpdates - Triggers - the check if new positions are affected of environmental - events. - - == Mapping/Application == - - [R] - VehicleTypesInitialization - VehicleTypesInitialization. - - [R] - VehicleRoutesInitialization - Used for update of vehicle infos. - - [R] - VehicleRegistration - Used for update of vehicle - mappings. - This interaction is used - by the visualization - ambassador itself for state keeping of current - mapping - of vehicles in simulation. - - [R] RsuRegistration - Used for update of RSU - mappings. - - [R] TrafficLightRegistration - Used for - update of TrafficLight - mappings. - - [R] VehicleUpdates - Used to visualize traffic simulation. - - [R] EnvironmentSensorUpdates - Used to visualize environment simulation. - - [R] - VehicleNavigationUpdate - Used to visualize traffic simulation. - - [R] - V2xMessageTransmission - Used to visualize network communication. - - [R] - V2xMessageReception - Used to visualize network - communication. - - [R] - TrafficLightUpdates - Used to visualize traffic simulation. - - [R] VehicleSlowDown - Used to - visualize traffic simulation. - - [R] VehicleRouteChange - Used to visualize traffic - simulation. - - [R] VehicleLaneChange - Used to - visualize traffic simulation. - - [R] - TrafficLightStateChange - Used to visualize traffic simulation. - - - - - - - - - - - - - - - List of paths which will be appended to the classpath of the - Java process the federate is executed in. - - - - - - - - - - - - - - Path which will be appended to the classpath of the - Java process the federate is executed in. - - - - - - - - - - - - - - - Custom arguments which will be passed to the - Java Process if the federate is ecexuted - in a JVM. - - - - diff --git a/bundle/src/assembly/resources/etc/hosts.json b/rti/mosaic-starter/etc/hosts.json similarity index 100% rename from bundle/src/assembly/resources/etc/hosts.json rename to rti/mosaic-starter/etc/hosts.json diff --git a/bundle/src/assembly/resources/etc/logback.xml b/rti/mosaic-starter/etc/logback.xml similarity index 100% rename from bundle/src/assembly/resources/etc/logback.xml rename to rti/mosaic-starter/etc/logback.xml diff --git a/bundle/src/assembly/resources/etc/runtime.json b/rti/mosaic-starter/etc/runtime.json similarity index 100% rename from bundle/src/assembly/resources/etc/runtime.json rename to rti/mosaic-starter/etc/runtime.json diff --git a/rti/mosaic-starter/pom.xml b/rti/mosaic-starter/pom.xml index 749d9397a..5c7b93917 100644 --- a/rti/mosaic-starter/pom.xml +++ b/rti/mosaic-starter/pom.xml @@ -162,22 +162,6 @@ org.apache.maven.plugins maven-resources-plugin - - copy-defaults-xml-for-test - process-test-sources - - copy-resources - - - ${project.basedir}/target/test-classes/etc - - - ${project.parent.basedir}/bundle/src/assembly/resources/etc - false - - - - copy-resources-web-visualizer @@ -194,27 +178,6 @@ - - - copy-resources-etc - validate - - copy-resources - - - ${project.build.directory}/classes/etc - - - ${project.parent.basedir}/bundle/src/assembly/resources/etc - true - - *.xml - *.json - - - - - diff --git a/rti/mosaic-starter/src/test/java/org/eclipse/mosaic/starter/CRuntimeTest.java b/rti/mosaic-starter/src/test/java/org/eclipse/mosaic/starter/CRuntimeTest.java index 4696571dd..fcf1b882a 100644 --- a/rti/mosaic-starter/src/test/java/org/eclipse/mosaic/starter/CRuntimeTest.java +++ b/rti/mosaic-starter/src/test/java/org/eclipse/mosaic/starter/CRuntimeTest.java @@ -25,6 +25,7 @@ import org.junit.Test; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Map; @@ -32,14 +33,14 @@ public class CRuntimeTest { /** - * Checks if the runtime.xml which is bundled with Eclipse MOSAIC has only valid subscriptions. + * Checks if the runtime.json which is bundled with Eclipse MOSAIC has only valid subscriptions. * This test requires the maven call {@code mvn process-test-resources} or {@code mvn install} each * time the runtime.xml has been changed in the {@code bundle} project. */ @Test public void validSubscriptionsInRuntimeConfiguration() throws IOException, InstantiationException { CRuntime runtimeConfiguration; - try (InputStream resource = getClass().getResourceAsStream("/etc/runtime.json")) { + try (InputStream resource = new FileInputStream("etc/runtime.json")) { assertNotNull(resource); runtimeConfiguration = new ObjectInstantiation<>(CRuntime.class).read(resource); } @@ -59,4 +60,5 @@ public void validSubscriptionsInRuntimeConfiguration() throws IOException, Insta } } } + } diff --git a/test/mosaic-integration-tests/pom.xml b/test/mosaic-integration-tests/pom.xml index 414d37b6a..50b6d99a5 100644 --- a/test/mosaic-integration-tests/pom.xml +++ b/test/mosaic-integration-tests/pom.xml @@ -107,7 +107,7 @@ ${project.basedir}/target/test-classes - ${project.parent.basedir}/bundle/src/assembly/resources/etc + ${project.parent.basedir}/rti/mosaic-starter/etc false