Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
EMAM2Middleware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
434a145a
Commit
434a145a
authored
Jun 23, 2018
by
Evgeny Kusmenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'RosAndAdaptable' into 'master'
CLI, Model updates, assembly of jar with dependencies See merge request
!4
parents
158b1fd9
2186a834
Pipeline
#57458
passed with stage
in 2 minutes and 35 seconds
Changes
136
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
136 changed files
with
4616 additions
and
338 deletions
+4616
-338
README.md
README.md
+2
-48
pom.xml
pom.xml
+25
-1
src/main/java/de/monticore/lang/monticar/generator/middleware/DistributedTargetGeneratorCli.java
...r/generator/middleware/DistributedTargetGeneratorCli.java
+159
-0
src/main/java/de/monticore/lang/monticar/generator/middleware/MiddlewareGenerator.java
...ng/monticar/generator/middleware/MiddlewareGenerator.java
+3
-0
src/main/java/de/monticore/lang/monticar/generator/middleware/helpers/TemplateHelper.java
...monticar/generator/middleware/helpers/TemplateHelper.java
+5
-5
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/CPPGenImpl.java
.../lang/monticar/generator/middleware/impls/CPPGenImpl.java
+24
-0
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/RosCppGenImpl.java
...ng/monticar/generator/middleware/impls/RosCppGenImpl.java
+7
-1
src/test/java/de/monticore/lang/monticar/generator/middleware/CliTest.java
...monticore/lang/monticar/generator/middleware/CliTest.java
+158
-0
src/test/java/de/monticore/lang/monticar/generator/middleware/GenerationTest.java
...re/lang/monticar/generator/middleware/GenerationTest.java
+34
-73
src/test/resources/CliUsage.sh
src/test/resources/CliUsage.sh
+7
-0
src/test/resources/StartComponents.sh
src/test/resources/StartComponents.sh
+10
-0
src/test/resources/TargetCompilation.sh
src/test/resources/TargetCompilation.sh
+2
-2
src/test/resources/ba/RosConnections.tag
src/test/resources/ba/RosConnections.tag
+52
-0
src/test/resources/ba/System.emam
src/test/resources/ba/System.emam
+51
-0
src/test/resources/ba/collision/CollisionDetection.emam
src/test/resources/ba/collision/CollisionDetection.emam
+20
-0
src/test/resources/ba/collision/PointsToLine.emam
src/test/resources/ba/collision/PointsToLine.emam
+15
-0
src/test/resources/ba/collision/RectIntersection.emam
src/test/resources/ba/collision/RectIntersection.emam
+33
-0
src/test/resources/ba/collision/RectToLines.emam
src/test/resources/ba/collision/RectToLines.emam
+26
-0
src/test/resources/ba/intersection/CollisionToStop.emam
src/test/resources/ba/intersection/CollisionToStop.emam
+50
-0
src/test/resources/ba/intersection/ConflictComputer.emam
src/test/resources/ba/intersection/ConflictComputer.emam
+0
-48
src/test/resources/ba/intersection/ConflictToStopConverter.emam
...st/resources/ba/intersection/ConflictToStopConverter.emam
+0
-23
src/test/resources/ba/intersection/DeltaTrajectoryComputer.emam
...st/resources/ba/intersection/DeltaTrajectoryComputer.emam
+0
-23
src/test/resources/ba/intersection/FirstLineIntersection.emam
...test/resources/ba/intersection/FirstLineIntersection.emam
+36
-0
src/test/resources/ba/intersection/Intersection.tag
src/test/resources/ba/intersection/Intersection.tag
+0
-12
src/test/resources/ba/intersection/IntersectionController.emam
...est/resources/ba/intersection/IntersectionController.emam
+23
-24
src/test/resources/ba/intersection/TimeCutoffFilter.emam
src/test/resources/ba/intersection/TimeCutoffFilter.emam
+47
-0
src/test/resources/ba/intersection/TrajectoryCollision.emam
src/test/resources/ba/intersection/TrajectoryCollision.emam
+43
-0
src/test/resources/ba/intersection/TrajectoryToStop.emam
src/test/resources/ba/intersection/TrajectoryToStop.emam
+0
-22
src/test/resources/ba/struct/Point.struct
src/test/resources/ba/struct/Point.struct
+6
-0
src/test/resources/ba/struct/RectToPoints.emam
src/test/resources/ba/struct/RectToPoints.emam
+13
-0
src/test/resources/ba/struct/Rectangle.struct
src/test/resources/ba/struct/Rectangle.struct
+8
-0
src/test/resources/ba/tests/RelToAbsTrajectory.stream
src/test/resources/ba/tests/RelToAbsTrajectory.stream
+0
-12
src/test/resources/ba/tests/RelToAbsTrajectoryInst.emam
src/test/resources/ba/tests/RelToAbsTrajectoryInst.emam
+0
-19
src/test/resources/ba/util/CommQuality.emam
src/test/resources/ba/util/CommQuality.emam
+9
-0
src/test/resources/ba/util/DualSetCompare.emam
src/test/resources/ba/util/DualSetCompare.emam
+21
-0
src/test/resources/ba/util/DualSetCompareMatrix.emam
src/test/resources/ba/util/DualSetCompareMatrix.emam
+20
-0
src/test/resources/ba/util/LineIntersection.emam
src/test/resources/ba/util/LineIntersection.emam
+36
-0
src/test/resources/ba/util/MultiOr.emam
src/test/resources/ba/util/MultiOr.emam
+14
-0
src/test/resources/ba/util/RelToAbsTrajectory.emam
src/test/resources/ba/util/RelToAbsTrajectory.emam
+0
-24
src/test/resources/ba/util/SingleSetCompare.emam
src/test/resources/ba/util/SingleSetCompare.emam
+19
-0
src/test/resources/ba/util/SingleSetCompareMatrix.emam
src/test/resources/ba/util/SingleSetCompareMatrix.emam
+19
-0
src/test/resources/ba/util/SingleSetCompareRectangle.emam
src/test/resources/ba/util/SingleSetCompareRectangle.emam
+21
-0
src/test/resources/ba/util/TrajectoryToLines.emam
src/test/resources/ba/util/TrajectoryToLines.emam
+18
-0
src/test/resources/ba/vehicle/VelocityController.emam
src/test/resources/ba/vehicle/VelocityController.emam
+45
-0
src/test/resources/results/CMakeCppOnly/src/cpp/HelperA.h
src/test/resources/results/CMakeCppOnly/src/cpp/HelperA.h
+1
-1
src/test/resources/results/system/src/CMakeLists.txt
src/test/resources/results/system/src/CMakeLists.txt
+10
-0
src/test/resources/results/system/src/ba_system_collisionDetection/CMakeLists.txt
...ts/system/src/ba_system_collisionDetection/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_collisionDetection/coordinator/CMakeLists.txt
...c/ba_system_collisionDetection/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_collisionDetection/coordinator/Coordinator_ba_system_collisionDetection.cpp
.../coordinator/Coordinator_ba_system_collisionDetection.cpp
+82
-0
src/test/resources/results/system/src/ba_system_collisionDetection/coordinator/IAdapter_ba_system_collisionDetection.h
...ction/coordinator/IAdapter_ba_system_collisionDetection.h
+9
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/CMakeLists.txt
...ystem/src/ba_system_collisionDetection/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/HelperA.h
...lts/system/src/ba_system_collisionDetection/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection.h
...tem_collisionDetection/cpp/ba_system_collisionDetection.h
+41
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_multiOr.h
...isionDetection/cpp/ba_system_collisionDetection_multiOr.h
+26
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1_.h
...on/cpp/ba_system_collisionDetection_rectIntersection_1_.h
+101
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__dualSetCompareLines.h
...lisionDetection_rectIntersection_1__dualSetCompareLines.h
+62
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__lineIntersection_1_.h
...lisionDetection_rectIntersection_1__lineIntersection_1_.h
+46
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__multiOrRect.h
...stem_collisionDetection_rectIntersection_1__multiOrRect.h
+26
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines1.h
...tem_collisionDetection_rectIntersection_1__rectToLines1.h
+52
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines1_pointsToLine_1_.h
...ection_rectIntersection_1__rectToLines1_pointsToLine_1_.h
+27
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines1_rectToPoints.h
...Detection_rectIntersection_1__rectToLines1_rectToPoints.h
+26
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines2.h
...tem_collisionDetection_rectIntersection_1__rectToLines2.h
+52
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines2_pointsToLine_1_.h
...ection_rectIntersection_1__rectToLines2_pointsToLine_1_.h
+27
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_rectIntersection_1__rectToLines2_rectToPoints.h
...Detection_rectIntersection_1__rectToLines2_rectToPoints.h
+26
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/ba_system_collisionDetection_singleSetCompareRect.h
...n/cpp/ba_system_collisionDetection_singleSetCompareRect.h
+32
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/types/ba_struct_Point.h
.../ba_system_collisionDetection/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_collisionDetection/cpp/types/ba_struct_Rectangle.h
...system_collisionDetection/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_collisionDetection/roscpp/CMakeLists.txt
...em/src/ba_system_collisionDetection/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_collisionDetection/roscpp/RosAdapter_ba_system_collisionDetection.h
...etection/roscpp/RosAdapter_ba_system_collisionDetection.h
+64
-0
src/test/resources/results/system/src/ba_system_collisionDetection/roscpp/struct_msgs/ba_struct_Point.msg
...collisionDetection/roscpp/struct_msgs/ba_struct_Point.msg
+2
-0
src/test/resources/results/system/src/ba_system_collisionDetection/roscpp/struct_msgs/ba_struct_Rectangle.msg
...isionDetection/roscpp/struct_msgs/ba_struct_Rectangle.msg
+4
-0
src/test/resources/results/system/src/ba_system_intersectionController/CMakeLists.txt
...ystem/src/ba_system_intersectionController/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_intersectionController/coordinator/CMakeLists.txt
..._system_intersectionController/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_intersectionController/coordinator/Coordinator_ba_system_intersectionController.cpp
...rdinator/Coordinator_ba_system_intersectionController.cpp
+82
-0
src/test/resources/results/system/src/ba_system_intersectionController/coordinator/IAdapter_ba_system_intersectionController.h
...r/coordinator/IAdapter_ba_system_intersectionController.h
+9
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/CMakeLists.txt
...m/src/ba_system_intersectionController/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/HelperA.h
...system/src/ba_system_intersectionController/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController.h
...rsectionController/cpp/ba_system_intersectionController.h
+51
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_collisionToStop.h
...er/cpp/ba_system_intersectionController_collisionToStop.h
+56
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_singleSetCompare.h
...r/cpp/ba_system_intersectionController_singleSetCompare.h
+37
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1_.h
...ba_system_intersectionController_trajectoryCollision_1_.h
+349
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__dualSetCompare.h
...sectionController_trajectoryCollision_1__dualSetCompare.h
+142
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__firstLineIntersection.h
...Controller_trajectoryCollision_1__firstLineIntersection.h
+88
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__lineIntersection_1_.h
...onController_trajectoryCollision_1__lineIntersection_1_.h
+46
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__timeCutoffFilter.h
...ctionController_trajectoryCollision_1__timeCutoffFilter.h
+60
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__trajectoryToLinesA.h
...ionController_trajectoryCollision_1__trajectoryToLinesA.h
+40
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/ba_system_intersectionController_trajectoryCollision_1__trajectoryToLinesB.h
...ionController_trajectoryCollision_1__trajectoryToLinesB.h
+40
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/types/ba_struct_Point.h
...system_intersectionController/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_intersectionController/cpp/types/ba_struct_Rectangle.h
...em_intersectionController/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_intersectionController/roscpp/CMakeLists.txt
...rc/ba_system_intersectionController/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_intersectionController/roscpp/RosAdapter_ba_system_intersectionController.h
...ller/roscpp/RosAdapter_ba_system_intersectionController.h
+89
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/CMakeLists.txt
...ts/system/src/ba_system_stopCommQuality_1_/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/coordinator/CMakeLists.txt
...c/ba_system_stopCommQuality_1_/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/coordinator/Coordinator_ba_system_stopCommQuality_1_.cpp
.../coordinator/Coordinator_ba_system_stopCommQuality_1_.cpp
+82
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/coordinator/IAdapter_ba_system_stopCommQuality_1_.h
...ty_1_/coordinator/IAdapter_ba_system_stopCommQuality_1_.h
+9
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/cpp/CMakeLists.txt
...ystem/src/ba_system_stopCommQuality_1_/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/cpp/HelperA.h
...lts/system/src/ba_system_stopCommQuality_1_/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/cpp/ba_system_stopCommQuality_1_.h
...tem_stopCommQuality_1_/cpp/ba_system_stopCommQuality_1_.h
+20
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/cpp/types/ba_struct_Point.h
.../ba_system_stopCommQuality_1_/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/cpp/types/ba_struct_Rectangle.h
...system_stopCommQuality_1_/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/roscpp/CMakeLists.txt
...em/src/ba_system_stopCommQuality_1_/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_1_/roscpp/RosAdapter_ba_system_stopCommQuality_1_.h
...ality_1_/roscpp/RosAdapter_ba_system_stopCommQuality_1_.h
+41
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/CMakeLists.txt
...ts/system/src/ba_system_stopCommQuality_2_/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/coordinator/CMakeLists.txt
...c/ba_system_stopCommQuality_2_/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/coordinator/Coordinator_ba_system_stopCommQuality_2_.cpp
.../coordinator/Coordinator_ba_system_stopCommQuality_2_.cpp
+82
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/coordinator/IAdapter_ba_system_stopCommQuality_2_.h
...ty_2_/coordinator/IAdapter_ba_system_stopCommQuality_2_.h
+9
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/cpp/CMakeLists.txt
...ystem/src/ba_system_stopCommQuality_2_/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/cpp/HelperA.h
...lts/system/src/ba_system_stopCommQuality_2_/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/cpp/ba_system_stopCommQuality_2_.h
...tem_stopCommQuality_2_/cpp/ba_system_stopCommQuality_2_.h
+20
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/cpp/types/ba_struct_Point.h
.../ba_system_stopCommQuality_2_/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/cpp/types/ba_struct_Rectangle.h
...system_stopCommQuality_2_/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/roscpp/CMakeLists.txt
...em/src/ba_system_stopCommQuality_2_/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_stopCommQuality_2_/roscpp/RosAdapter_ba_system_stopCommQuality_2_.h
...ality_2_/roscpp/RosAdapter_ba_system_stopCommQuality_2_.h
+41
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/CMakeLists.txt
...system/src/ba_system_velocityController_1_/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/coordinator/CMakeLists.txt
...a_system_velocityController_1_/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/coordinator/Coordinator_ba_system_velocityController_1_.cpp
...ordinator/Coordinator_ba_system_velocityController_1_.cpp
+82
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/coordinator/IAdapter_ba_system_velocityController_1_.h
...1_/coordinator/IAdapter_ba_system_velocityController_1_.h
+9
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/cpp/CMakeLists.txt
...em/src/ba_system_velocityController_1_/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/cpp/HelperA.h
.../system/src/ba_system_velocityController_1_/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/cpp/ba_system_velocityController_1_.h
...locityController_1_/cpp/ba_system_velocityController_1_.h
+58
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/cpp/types/ba_struct_Point.h
..._system_velocityController_1_/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/cpp/types/ba_struct_Rectangle.h
...tem_velocityController_1_/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/roscpp/CMakeLists.txt
...src/ba_system_velocityController_1_/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_1_/roscpp/RosAdapter_ba_system_velocityController_1_.h
...er_1_/roscpp/RosAdapter_ba_system_velocityController_1_.h
+72
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/CMakeLists.txt
...system/src/ba_system_velocityController_2_/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/coordinator/CMakeLists.txt
...a_system_velocityController_2_/coordinator/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/coordinator/Coordinator_ba_system_velocityController_2_.cpp
...ordinator/Coordinator_ba_system_velocityController_2_.cpp
+82
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/coordinator/IAdapter_ba_system_velocityController_2_.h
...2_/coordinator/IAdapter_ba_system_velocityController_2_.h
+9
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/cpp/CMakeLists.txt
...em/src/ba_system_velocityController_2_/cpp/CMakeLists.txt
+6
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/cpp/HelperA.h
.../system/src/ba_system_velocityController_2_/cpp/HelperA.h
+99
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/cpp/ba_system_velocityController_2_.h
...locityController_2_/cpp/ba_system_velocityController_2_.h
+58
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/cpp/types/ba_struct_Point.h
..._system_velocityController_2_/cpp/types/ba_struct_Point.h
+10
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/cpp/types/ba_struct_Rectangle.h
...tem_velocityController_2_/cpp/types/ba_struct_Rectangle.h
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/roscpp/CMakeLists.txt
...src/ba_system_velocityController_2_/roscpp/CMakeLists.txt
+13
-0
src/test/resources/results/system/src/ba_system_velocityController_2_/roscpp/RosAdapter_ba_system_velocityController_2_.h
...er_2_/roscpp/RosAdapter_ba_system_velocityController_2_.h
+72
-0
src/test/resources/results/system/src/rosMsg/CMakeLists.txt
src/test/resources/results/system/src/rosMsg/CMakeLists.txt
+24
-0
No files found.
README.md
View file @
434a145a
# EMAM2Middleware
## Problems
This generator needs versions of other EMAM libraries that are not yet distributed via Maven.
Workaround: Download these branches and build each via 'mvn clean install -U -s settings.xml'
*
EmbeddedMontiArc/RosPort: https://github.com/EmbeddedMontiArc/EmbeddedMontiArc/tree/RosPort
*
EmbeddedMontiArcMath/RosPort: https://github.com/EmbeddedMontiArc/EmbeddedMontiArcMath/tree/RosPort
*
EMAM2RosMsg: https://github.com/EmbeddedMontiArc/EMAM2RosMsg
*
EMAM2RosCpp: https://github.com/EmbeddedMontiArc/EMAM2RosCpp
*
EMAM2Cpp/hellwig: https://github.com/EmbeddedMontiArc/EMAM2Cpp/tree/hellwig
or use this script:
```
bash
#!/bin/bash
#fail if any of the commands fail
set
-e
git clone https://github.com/EmbeddedMontiArc/EmbeddedMontiArc
git clone https://github.com/EmbeddedMontiArc/EmbeddedMontiArcMath
git clone https://github.com/EmbeddedMontiArc/EMAM2RosMsg
git clone https://github.com/EmbeddedMontiArc/EMAM2RosCpp
git clone https://github.com/EmbeddedMontiArc/EMAM2Cpp
cd
EmbeddedMontiArc
git checkout RosPort
mvn clean
install
-U
-s
settings.xml
cd
..
cd
EmbeddedMontiArcMath
git checkout RosPort
mvn clean
install
-U
-s
settings.xml
cd
..
cd
EMAM2RosMsg
mvn clean
install
-U
-s
settings.xml
cd
..
cd
EMAM2RosCpp
mvn clean
install
-U
-s
settings.xml
cd
..
cd
EMAM2Cpp
git checkout hellwig
mvn clean
install
-U
-s
settings.xml
cd
..
```
## Usage
### Defining the connection between a component and the middleware
The connection between middleware and the component is defined as tags on Ports in .tag files.
...
...
@@ -65,9 +20,8 @@ Look at GenerationTest::testDistributedTargetGenerator. The component is defined
1.
install needed software:
*
ROS Kinetic(http://wiki.ros.org/kinetic/Installation)
*
CMake(https://cmake.org/)
*
Armadillo( www.arma.sourceforge.net)
*
Ubuntu package: libarmadillo-dev
*
creating a copy of the library named armadillo.h might be necessary. Ubuntu location: /usr/include/armadillo
*
Armadillo 8 or higher( www.arma.sourceforge.net)
*
creating a copy of the library named armadillo.h might be necessary.
1.
source your ros environment(http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment , 2.)
1.
a) run src/test/resources/TargetCompilation.sh from
**this project's**
root
1.
or b) compile a single project by
...
...
pom.xml
View file @
434a145a
...
...
@@ -9,7 +9,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-math-middleware-generator
</artifactId>
<version>
0.0.
1
-SNAPSHOT
</version>
<version>
0.0.
2
-SNAPSHOT
</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
...
...
@@ -305,6 +305,30 @@
</configuration>
</plugin>
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.1.0
</version>
<executions>
<execution>
<id>
jar-with-dependencies
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
de.monticore.lang.monticar.generator.middleware.DistributedTargetGeneratorCli
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
<!-- Source Jar Configuration -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
src/main/java/de/monticore/lang/monticar/generator/middleware/DistributedTargetGeneratorCli.java
0 → 100644
View file @
434a145a
package
de.monticore.lang.monticar.generator.middleware
;
import
de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol
;
import
de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosToEmamTagSchema
;
import
de.monticore.lang.monticar.generator.middleware.impls.CPPGenImpl
;
import
de.monticore.lang.monticar.generator.middleware.impls.RosCppGenImpl
;
import
de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab
;
import
de.monticore.lang.monticar.generator.roscpp.helper.TagHelper
;
import
de.monticore.lang.tagging._symboltable.TaggingResolver
;
import
de.se_rwth.commons.logging.Log
;
import
org.apache.commons.cli.*
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* java -cp target/embedded-montiarc-math-middleware-generator-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
* de.monticore.lang.monticar.generator.middleware.DistributedTargetGeneratorCli \
* --models-dir=src/test/resources/ \
* --root-model=tests.a.addComp \
* --output-dir=target/cli-test/src \
* --generators=cpp,roscpp
*/
public
final
class
DistributedTargetGeneratorCli
{
private
static
final
Option
OPTION_MODELS_PATH
=
Option
.
builder
(
"m"
)
.
longOpt
(
"models-dir"
)
.
desc
(
"full path to directory with EMAM models"
)
.
hasArg
(
true
)
.
required
(
true
)
.
build
();
private
static
final
Option
OPTION_ROOT_MODEL
=
Option
.
builder
(
"r"
)
.
longOpt
(
"root-model"
)
.
desc
(
"fully qualified name of the root model"
)
.
hasArg
(
true
)
.
required
(
true
)
.
build
();
private
static
final
Option
OPTION_OUTPUT_PATH
=
Option
.
builder
(
"o"
)
.
longOpt
(
"output-dir"
)
.
desc
(
"full path to output directory for tests"
)
.
hasArg
(
true
)
.
required
(
true
)
.
build
();
private
static
final
Option
OPTION_GENERATORS
=
Option
.
builder
(
"g"
)
.
longOpt
(
"generators"
)
.
desc
(
"identifiers for the generators that should be used"
)
.
hasArg
(
true
)
.
required
(
true
)
.
numberOfArgs
(
10
)
.
valueSeparator
(
','
)
.
build
();
public
static
final
String
GENERATOR_CPP
=
"cpp"
;
public
static
final
String
GENERATOR_ROSCPP
=
"roscpp"
;
private
DistributedTargetGeneratorCli
()
{}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
Arrays
.
toString
(
args
));
Options
options
=
getOptions
();
CommandLineParser
parser
=
new
DefaultParser
();
CommandLine
cliArgs
=
parseArgs
(
options
,
parser
,
args
);
if
(
cliArgs
!=
null
)
{
runGenerator
(
cliArgs
);
}
}
private
static
Options
getOptions
()
{
Options
options
=
new
Options
();
options
.
addOption
(
OPTION_MODELS_PATH
);
options
.
addOption
(
OPTION_ROOT_MODEL
);
options
.
addOption
(
OPTION_OUTPUT_PATH
);
options
.
addOption
(
OPTION_GENERATORS
);
return
options
;
}
private
static
Set
<
String
>
getGeneratorNames
()
{
HashSet
<
String
>
res
=
new
HashSet
<>();
res
.
add
(
GENERATOR_CPP
);
res
.
add
(
GENERATOR_ROSCPP
);
return
res
;
}
private
static
CommandLine
parseArgs
(
Options
options
,
CommandLineParser
parser
,
String
[]
args
)
{
CommandLine
cliArgs
;
try
{
cliArgs
=
parser
.
parse
(
options
,
args
);
}
catch
(
ParseException
e
)
{
Log
.
error
(
"0x9A1AC: Argument parsing exception"
,
e
);
return
null
;
}
return
cliArgs
;
}
private
static
void
runGenerator
(
CommandLine
cliArgs
)
{
String
modelsDirPath
=
expandHomeDir
(
cliArgs
.
getOptionValue
(
OPTION_MODELS_PATH
.
getOpt
()));
if
(!
Files
.
isDirectory
(
Paths
.
get
(
modelsDirPath
))){
Log
.
error
(
"0x6444B: Models dir does not exist: "
+
modelsDirPath
);
return
;
}
String
outputPath
=
expandHomeDir
(
cliArgs
.
getOptionValue
(
OPTION_OUTPUT_PATH
.
getOpt
()));
String
rootModelName
=
cliArgs
.
getOptionValue
(
OPTION_ROOT_MODEL
.
getOpt
());
Set
<
String
>
generators
=
Arrays
.
stream
(
cliArgs
.
getOptionValues
(
OPTION_GENERATORS
.
getOpt
())).
collect
(
Collectors
.
toSet
());
TaggingResolver
taggingResolver
=
AbstractSymtab
.
createSymTabAndTaggingResolver
(
modelsDirPath
);
DistributedTargetGenerator
generator
=
new
DistributedTargetGenerator
();
generator
.
setGenerationTargetPath
(
outputPath
);
Set
<
String
>
validGenNames
=
getGeneratorNames
();
generators
.
forEach
(
genName
->
{
if
(
validGenNames
.
contains
(
genName
))
{
Log
.
warn
(
"Using generator "
+
genName
);
}
else
{
Log
.
error
(
"0xE28B6: Not a valid generator Name:"
+
genName
+
"."
);
}
});
ExpandedComponentInstanceSymbol
componentInstanceSymbol
=
taggingResolver
.<
ExpandedComponentInstanceSymbol
>
resolve
(
rootModelName
,
ExpandedComponentInstanceSymbol
.
KIND
).
orElse
(
null
);
if
(
componentInstanceSymbol
==
null
)
{
Log
.
error
(
"0x5FFAE: The given component cannot be resolved."
);
return
;
}
if
(
generators
.
contains
(
GENERATOR_CPP
))
{
generator
.
add
(
new
CPPGenImpl
(),
"cpp"
);
}
if
(
generators
.
contains
(
GENERATOR_ROSCPP
))
{
generator
.
add
(
new
RosCppGenImpl
(),
"roscpp"
);
RosToEmamTagSchema
.
registerTagTypes
(
taggingResolver
);
TagHelper
.
resolveTags
(
taggingResolver
,
componentInstanceSymbol
);
}
try
{
generator
.
generate
(
componentInstanceSymbol
,
taggingResolver
);
}
catch
(
IOException
e
)
{
Log
.
error
(
"Error generating files"
,
e
);
}
}
private
static
String
expandHomeDir
(
String
path
)
{
if
(
path
.
startsWith
(
"~"
))
{
return
System
.
getProperty
(
"user.home"
)
+
path
.
substring
(
1
);
}
return
path
;
}
}
src/main/java/de/monticore/lang/monticar/generator/middleware/MiddlewareGenerator.java
View file @
434a145a
...
...
@@ -51,6 +51,7 @@ public class MiddlewareGenerator extends CMakeGenerator {
.
filter
(
fn
->
fn
.
matches
(
"(\\w+(Adapter_))?("
+
name
+
"\\.h)"
))
.
filter
(
fn
->
!
fn
.
startsWith
(
"IAdapter"
))
.
map
(
fn
->
"#include \""
+
fn
+
"\""
)
.
sorted
()
.
collect
(
Collectors
.
joining
(
"\n"
));
String
addAdapters
=
filesNames
.
stream
()
...
...
@@ -58,6 +59,7 @@ public class MiddlewareGenerator extends CMakeGenerator {
.
filter
(
fn
->
!
fn
.
startsWith
(
"IAdapter"
))
.
map
(
fn
->
fn
.
substring
(
0
,
fn
.
length
()
-
2
))
.
map
(
fn
->
" adapters.push_back(new "
+
fn
+
"());"
)
.
sorted
()
.
collect
(
Collectors
.
joining
(
"\n"
));
String
initParams
=
componentInstanceSymbol
.
getArguments
().
stream
()
...
...
@@ -87,6 +89,7 @@ public class MiddlewareGenerator extends CMakeGenerator {
.
filter
(
fn
->
fn
.
matches
(
"(\\w+(Adapter_))?("
+
name
+
"\\.h)"
))
.
filter
(
fn
->
!
fn
.
startsWith
(
"IAdapter"
))
.
map
(
fn
->
fn
.
substring
(
0
,
fn
.
length
()
-
2
))
.
sorted
()
.
collect
(
Collectors
.
joining
(
" "
));
String
content
=
TemplateHelper
.
getCoordinatorCmakeListsTemplate
()
...
...
src/main/java/de/monticore/lang/monticar/generator/middleware/helpers/TemplateHelper.java
View file @
434a145a
package
de.monticore.lang.monticar.generator.middleware.helpers
;
import
de.se_rwth.commons.logging.Log
;
import
org.apache.commons.io.
File
Utils
;
import
org.apache.commons.io.
IO
Utils
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -16,12 +15,13 @@ public class TemplateHelper {
}
String
tmpStr
=
""
;
String
fullFileName
=
"src/main/resources/de/monticore/lang/monticar/generator/middleware/"
+
fileName
;
String
resourceFileName
=
"/de/monticore/lang/monticar/generator/middleware/"
+
fileName
;
try
{
tmpStr
=
FileUtils
.
readFileToString
(
new
File
(
full
FileName
));
tmpStr
=
IOUtils
.
toString
(
TemplateHelper
.
class
.
getResourceAsStream
(
resource
FileName
));
}
catch
(
Exception
e
)
{
//Not recoverable
Log
.
error
(
"Template file not found: "
+
full
FileName
);
Log
.
error
(
"Template file not found: "
+
resource
FileName
);
}
cache
.
put
(
fileName
,
tmpStr
);
...
...
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/CPPGenImpl.java
View file @
434a145a
...
...
@@ -9,6 +9,11 @@ import de.monticore.lang.tagging._symboltable.TaggingResolver;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -34,6 +39,8 @@ public class CPPGenImpl implements GeneratorImpl {
files
.
add
(
generatorCPP
.
generateFile
(
generateCMake
(
componentInstanceSymbol
)));
files
.
addAll
(
generatorCPP
.
generateFiles
(
componentInstanceSymbol
,
taggingResolver
));
fixKnownErrors
(
files
);
return
files
;
}
...
...
@@ -49,4 +56,21 @@ public class CPPGenImpl implements GeneratorImpl {
cmake
.
setFileContent
(
TemplateHelper
.
getCmakeCppTemplate
().
replace
(
"${compName}"
,
name
));
return
cmake
;
}
private
void
fixKnownErrors
(
List
<
File
>
files
)
throws
IOException
{
for
(
File
f
:
files
)
{
Path
path
=
Paths
.
get
(
f
.
getAbsolutePath
());
Charset
charset
=
StandardCharsets
.
UTF_8
;
String
content
=
new
String
(
Files
.
readAllBytes
(
path
),
charset
);
content
=
content
//Matrix access problems
.
replace
(
"int curIndex = indexLookup(i);"
,
"int curIndex = indexLookup(i-1);"
)
.
replace
(
"-1-1"
,
"-1"
)
//not present in emam2cpp master
.
replace
(
"] ;"
,
"];"
)
;
Files
.
write
(
path
,
content
.
getBytes
(
charset
));
}
}
}
src/main/java/de/monticore/lang/monticar/generator/middleware/impls/RosCppGenImpl.java
View file @
434a145a
...
...
@@ -4,6 +4,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.Expanded
import
de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol
;
import
de.monticore.lang.monticar.generator.roscpp.GeneratorRosCpp
;
import
de.monticore.lang.tagging._symboltable.TaggingResolver
;
import
de.se_rwth.commons.logging.Log
;
import
java.io.File
;
import
java.io.IOException
;
...
...
@@ -36,8 +37,13 @@ public class RosCppGenImpl implements GeneratorImpl {
@Override
public
boolean
willAccept
(
ExpandedComponentInstanceSymbol
componentInstanceSymbol
)
{
return
componentInstanceSymbol
.
getPortsList
().
stream
()
boolean
result
=
componentInstanceSymbol
.
getPortsList
().
stream
()
.
filter
(
PortSymbol:
:
isRosPort
)
.
count
()
>
0
;
if
(!
result
){
Log
.
warn
(
"GeneratorRosCpp: No ROS Ports found! Ignoring component "
+
componentInstanceSymbol
.
getName
());
}
return
result
;
}
}
src/test/java/de/monticore/lang/monticar/generator/middleware/CliTest.java
0 → 100644
View file @
434a145a
package
de.monticore.lang.monticar.generator.middleware
;
import
de.monticore.lang.embeddedmontiarc.LogConfig
;
import
de.se_rwth.commons.logging.Finding
;
import
org.junit.AfterClass
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
CliTest
{
private
static
final
String
VALID_MODELS_DIR_OPTION
=
"--models-dir=src/test/resources/"
;
private
static
final
String
VALID_ROOT_MODEL_OPTION
=
"--root-model=tests.a.addComp"
;
private
static
final
String
VALID_GENERATOR_CPP_OPTION
=
"--generators=cpp"
;
private
static
final
String
VALID_GENERATOR_ALL_OPTION
=
"--generators=cpp,roscpp"
;
private
static
final
String
INVALID_MODELS_DIR_OPTION
=
"--models-dir=src/invalid/resources/"
;
private
static
final
String
INVALID_ROOT_MODEL_OPTION
=
"--root-model=invalid.invalid.addComp"
;
private
static
final
String
INVALID_GENERATOR_OPTION
=
"--generators=invalid"
;
private
static
final
String
INVALID_GENERATOR_EMPTY_OPTION
=
"--generators="
;
@BeforeClass
public
static
void
initLog
(){
LogConfig
.
init
();
LogConfig
.
enableFailQuick
(
false
);
}
@Before
public
void
clearFindings
(){
LogConfig
.
getFindings
().
clear
();
}
@AfterClass
public
static
void
resetLog
(){
LogConfig
.
getFindings
().
clear
();
LogConfig
.
enableFailQuick
(
true
);
}
@Test
public
void
testParserError
(){
String
[]
args
=
{
"invalidParsingArg"
};
DistributedTargetGeneratorCli
.
main
(
args
);
assertTrue
(
LogConfig
.
getErrorCount
()
==
1
);
assertTrue
(
LogConfig
.
getFindings
().
stream
().
map
(
Finding:
:
getMsg
).
anyMatch
(
msg
->
msg
.
contains
(
"0x9A1AC"
)));
}
@Test
public
void
testNoGenerators
(){
String
[]
args
=
{
VALID_MODELS_DIR_OPTION
,
VALID_ROOT_MODEL_OPTION
,
INVALID_GENERATOR_EMPTY_OPTION
,
"--output-dir=target/cliTest/NoGenerators/"
};
DistributedTargetGeneratorCli
.
main
(
args
);
assertTrue
(
LogConfig
.
getErrorCount
()
==
1
);
assertTrue
(
LogConfig
.
getFindings
().
stream
().
map
(
Finding:
:
getMsg
).
anyMatch
(
msg
->
msg
.
contains
(
"0xE28B6"
)));
}
@Test
public
void
testInvalidGenerator
(){
String
[]
args
=
{
VALID_MODELS_DIR_OPTION
,
VALID_ROOT_MODEL_OPTION
,
INVALID_GENERATOR_OPTION
,
"--output-dir=target/cliTest/InvalidGenerators/"
};
DistributedTargetGeneratorCli
.
main
(
args
);
assertTrue
(
LogConfig
.
getErrorCount
()
==
1
);
assertTrue
(
logContains
(
"0xE28B6"
));
}
@Test
public
void
testOneGenerator
(){
String
targetDir
=
"target/cliTest/OneGenerator/"
;
String
[]
args
=
{
VALID_MODELS_DIR_OPTION
,
VALID_ROOT_MODEL_OPTION
,
VALID_GENERATOR_CPP_OPTION
,
"--output-dir="
+
targetDir
};
DistributedTargetGeneratorCli
.
main
(
args
);
String
[]
positiveFileNames
=
{
"CMakeLists.txt"
,
"tests_a_addComp/cpp/tests_a_addComp.h"
,
"tests_a_addComp/cpp/CMakeLists.txt"
,
"tests_a_addComp/coordinator/CMakeLists.txt"
,
"tests_a_addComp/coordinator/Coordinator_tests_a_addComp.cpp"
};
for
(
String
positiveFileName
:
positiveFileNames
)
{
assertTrue
(
Files
.
exists
(
Paths
.
get
(
targetDir
+
positiveFileName
)));
}
}
@Test
public
void
testAllGenerators
(){
String
targetDir
=
"target/cliTest/AllGenerators/"
;
String
[]
args
=
{
VALID_MODELS_DIR_OPTION
,
VALID_ROOT_MODEL_OPTION
,
VALID_GENERATOR_ALL_OPTION
,
"--output-dir="
+
targetDir
};
DistributedTargetGeneratorCli
.
main
(
args
);
String
[]
positiveFileNames
=
{
"CMakeLists.txt"
,
"tests_a_addComp/cpp/tests_a_addComp.h"
,
"tests_a_addComp/cpp/CMakeLists.txt"
,
"tests_a_addComp/coordinator/CMakeLists.txt"
,
"tests_a_addComp/coordinator/Coordinator_tests_a_addComp.cpp"
,
"tests_a_addComp/roscpp/RosAdapter_tests_a_addComp.h"
,
"tests_a_addComp/roscpp/CMakeLists.txt"
,
};
for
(
String
positiveFileName
:
positiveFileNames
)
{
assertTrue
(
Files
.
exists
(
Paths
.
get
(
targetDir
+
positiveFileName
)));
}
}
@Test
public
void
testInvalidRootModelError
(){
String
[]
args
=
{
VALID_MODELS_DIR_OPTION
,
INVALID_ROOT_MODEL_OPTION
,
VALID_GENERATOR_CPP_OPTION
,
"--output-dir=target/cliTest/InvalidRootModel/"
};
DistributedTargetGeneratorCli
.
main
(
args
);
assertTrue
(
LogConfig
.
getErrorCount
()
==
1
);
assertTrue
(
logContains
(
"0x5FFAE"
));
}
@Test
public
void
testInvalidModelsDirError
(){
String
[]
args
=
{
INVALID_MODELS_DIR_OPTION
,
VALID_ROOT_MODEL_OPTION
,
VALID_GENERATOR_CPP_OPTION
,
"--output-dir=target/cliTest/InvalidModelsDir/"
};
DistributedTargetGeneratorCli
.
main
(
args
);
assertTrue
(
LogConfig
.
getErrorCount
()
==
1
);
assertTrue
(
logContains
(
"0x6444B"
));
}
private
boolean
logContains
(
String
errorCode
){
return
LogConfig
.
getFindings
().
stream
().
map
(
Finding:
:
getMsg
).
anyMatch
(
msg
->
msg
.
contains
(
errorCode
));