diff --git a/src/var/FeatureModelConfigurator/configs/config.xml b/src/var/FeatureModelConfigurator/configs/config.xml index d12aa2324d08dba19c6a138868dacb765a25b59e..081fa7936536f710ae33208b69a14b73d15b3540 100644 --- a/src/var/FeatureModelConfigurator/configs/config.xml +++ b/src/var/FeatureModelConfigurator/configs/config.xml @@ -13,6 +13,9 @@ <feature automatic="unselected" name="Pi_Camera"/> <feature automatic="unselected" name="imu"/> <feature automatic="unselected" name="lds_lfcd_sensor"/> + <feature automatic="unselected" name="lds_lfcd_sensor_BAD_RANGE"/> + <feature automatic="unselected" name="lds_lfcd_sensor_GOOD_RANGE"/> + <feature automatic="unselected" name="lds_lfcd_sensor_HIGH_NOISE"/> <feature automatic="unselected" name="realsense_R200"/> <feature automatic="unselected" name="Pi_Camera___turtlebot3_burger_for_autorace"/> <feature automatic="unselected" name="Pi_Camera___turtlebot3_waffle_pi"/> diff --git a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Configurator.jak b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Configurator.jak index e241cc651bfaa1c738fd8636b798d1e2aed769df..2583323be467489e25947a95e3501d866b3889d7 100644 --- a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Configurator.jak +++ b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Configurator.jak @@ -2,6 +2,9 @@ import java.util.List; import java.util.ArrayList; import java.io.IOException; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.File; import org.jdom2.Document; import org.jdom2.Element; @@ -29,11 +32,12 @@ public class Configurator { private List m_aModuleList; //output path private String m_sOutputPath = "resources/output/featuremodel.xml"; - //TODO: set this - //path for test case selector, which has to be launched from this application - private String m_sTestCaseSelectorPath; //path to the feature model xml private String m_sFeatureModelPath = "model.xml"; + //path to the directory of test manager + private String m_sTestManagerPath = "../../../build/sim/"; + //path to the directory of testcase compliler + private String m_sTestCaseCompilerPath = "../../../build/test/compiler/"; //document representation of the feature model private Document m_oFeatureModelDoc; @@ -117,6 +121,34 @@ public class Configurator { System.out.println(oEx); return; } + + Runtime oRuntime = Runtime.getRuntime(); + + //TODO launch compiler + try { + File oWorkingDir = new File(m_sTestCaseCompilerPath); + Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString()); + } + + //TODO launch test manager + try { + File oWorkingDir = new File(m_sTestManagerPath); + Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching TestManager failed: " + oEx.toString()); + } } //get all parents of a given module from the Feature Model file diff --git a/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_BAD_RANGE/Configurator.jak b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_BAD_RANGE/Configurator.jak new file mode 100644 index 0000000000000000000000000000000000000000..a05a3fc7a2166da30390c6f1d2b212a994409e18 --- /dev/null +++ b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_BAD_RANGE/Configurator.jak @@ -0,0 +1,9 @@ +/** + * TODO description + */ +public refines class Configurator { + public void save() { + Super().addToModuleList("lds_lfcd_sensor_BAD_RANGE"); + Super().save(); + } +} \ No newline at end of file diff --git a/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_GOOD_RANGE/Configurator.jak b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_GOOD_RANGE/Configurator.jak new file mode 100644 index 0000000000000000000000000000000000000000..e5dea4174675ae64b8520a389a04dae5372a19c9 --- /dev/null +++ b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_GOOD_RANGE/Configurator.jak @@ -0,0 +1,9 @@ +/** + * TODO description + */ +public refines class Configurator { + public void save() { + Super().addToModuleList("lds_lfcd_sensor_GOOD_RANGE"); + Super().save(); + } +} \ No newline at end of file diff --git a/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_HIGH_NOISE/Configurator.jak b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_HIGH_NOISE/Configurator.jak new file mode 100644 index 0000000000000000000000000000000000000000..280652f438c20efffab9e46fda9c9b678e899731 --- /dev/null +++ b/src/var/FeatureModelConfigurator/features/lds_lfcd_sensor_HIGH_NOISE/Configurator.jak @@ -0,0 +1,9 @@ +/** + * TODO description + */ +public refines class Configurator { + public void save() { + Super().addToModuleList("lds_lfcd_sensor_HIGH_NOISE"); + Super().save(); + } +} \ No newline at end of file diff --git a/src/var/FeatureModelConfigurator/model.xml b/src/var/FeatureModelConfigurator/model.xml index 73ef3642b20f4977ba6d8a105d9ced93ab92a35b..5fedabf7efbdd617b1cf8c5791d48542dd7ecf45 100644 --- a/src/var/FeatureModelConfigurator/model.xml +++ b/src/var/FeatureModelConfigurator/model.xml @@ -26,6 +26,9 @@ <feature name="Pi_Camera" /> <feature name="imu" /> <feature name="lds_lfcd_sensor" /> + <feature name="lds_lfcd_sensor_BAD_RANGE" /> + <feature name="lds_lfcd_sensor_GOOD_RANGE" /> + <feature name="lds_lfcd_sensor_HIGH_NOISE" /> <feature name="realsense_R200" /> <feature name="Pi_Camera___turtlebot3_burger_for_autorace" /> <feature name="Pi_Camera___turtlebot3_waffle_pi" /> diff --git a/src/var/FeatureModelConfigurator/src/Configurator.jak b/src/var/FeatureModelConfigurator/src/Configurator.jak index b8dfb6adc7ee35aa5fb4704ea7fab6b32703d211..d75c8f5ce9751b8dd8f4301fb79a64e99c8c0260 100644 --- a/src/var/FeatureModelConfigurator/src/Configurator.jak +++ b/src/var/FeatureModelConfigurator/src/Configurator.jak @@ -2,6 +2,9 @@ import java.util.List; import java.util.ArrayList; import java.io.IOException; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.File; import org.jdom2.Document; import org.jdom2.Element; @@ -31,11 +34,12 @@ abstract class Configurator$$ConfiguratorMain { private List m_aModuleList; //output path private String m_sOutputPath = "resources/output/featuremodel.xml"; - //TODO: set this - //path for test case selector, which has to be launched from this application - private String m_sTestCaseSelectorPath; //path to the feature model xml private String m_sFeatureModelPath = "model.xml"; + //path to the directory of test manager + private String m_sTestManagerPath = "../../../build/sim/"; + //path to the directory of testcase compliler + private String m_sTestCaseCompilerPath = "../../../build/test/compiler/"; //document representation of the feature model private Document m_oFeatureModelDoc; @@ -119,6 +123,34 @@ abstract class Configurator$$ConfiguratorMain { System.out.println(oEx); return; } + + Runtime oRuntime = Runtime.getRuntime(); + + //TODO launch compiler + try { + File oWorkingDir = new File(m_sTestCaseCompilerPath); + Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString()); + } + + //TODO launch test manager + try { + File oWorkingDir = new File(m_sTestManagerPath); + Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching TestManager failed: " + oEx.toString()); + } } //get all parents of a given module from the Feature Model file diff --git a/src/var/FeatureModelConfigurator/src/Configurator.java b/src/var/FeatureModelConfigurator/src/Configurator.java index 3c33295c4101fee85ce41b4b1704b8a43a92021c..ab46e9a561df91b0268dbc3eff8a546f2a819a63 100644 --- a/src/var/FeatureModelConfigurator/src/Configurator.java +++ b/src/var/FeatureModelConfigurator/src/Configurator.java @@ -2,6 +2,9 @@ import java.util.List; import java.util.ArrayList; import java.io.IOException; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.File; import org.jdom2.Document; import org.jdom2.Element; @@ -31,11 +34,12 @@ abstract class Configurator$$ConfiguratorMain { private List m_aModuleList; //output path private String m_sOutputPath = "resources/output/featuremodel.xml"; - //TODO: set this - //path for test case selector, which has to be launched from this application - private String m_sTestCaseSelectorPath; //path to the feature model xml private String m_sFeatureModelPath = "model.xml"; + //path to the directory of test manager + private String m_sTestManagerPath = "../../../build/sim/"; + //path to the directory of testcase compliler + private String m_sTestCaseCompilerPath = "../../../build/test/compiler/"; //document representation of the feature model private Document m_oFeatureModelDoc; @@ -119,6 +123,34 @@ abstract class Configurator$$ConfiguratorMain { System.out.println(oEx); return; } + + Runtime oRuntime = Runtime.getRuntime(); + + //TODO launch compiler + try { + File oWorkingDir = new File(m_sTestCaseCompilerPath); + Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString()); + } + + //TODO launch test manager + try { + File oWorkingDir = new File(m_sTestManagerPath); + Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir); + BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream())); + String sOutput = null; + while ((sOutput = oOutput.readLine()) != null) { + System.out.println(sOutput); + } + } catch (IOException oEx) { + System.out.println("ERROR: launching TestManager failed: " + oEx.toString()); + } } //get all parents of a given module from the Feature Model file diff --git a/src/var/FeatureModelImplGenerator/template/Main.jak b/src/var/FeatureModelImplGenerator/template/Main.jak index 505ec8716d121b3f35daa3e7f8d5be0268460d97..2583323be467489e25947a95e3501d866b3889d7 100644 --- a/src/var/FeatureModelImplGenerator/template/Main.jak +++ b/src/var/FeatureModelImplGenerator/template/Main.jak @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; +import java.io.File; import org.jdom2.Document; import org.jdom2.Element; @@ -33,10 +34,10 @@ public class Configurator { private String m_sOutputPath = "resources/output/featuremodel.xml"; //path to the feature model xml private String m_sFeatureModelPath = "model.xml"; - //path to the test manager - private String m_sTestManagerPath = "../../../build/sim/testmanager.sh"; - //path to the testcase compliler - private String m_sTestCaseCompilerPath = "../../../build/test/compiler/compile"; + //path to the directory of test manager + private String m_sTestManagerPath = "../../../build/sim/"; + //path to the directory of testcase compliler + private String m_sTestCaseCompilerPath = "../../../build/test/compiler/"; //document representation of the feature model private Document m_oFeatureModelDoc; @@ -125,7 +126,8 @@ public class Configurator { //TODO launch compiler try { - Process oTestCaseCompiler = oRuntime.exec(m_sTestCaseCompilerPath); + File oWorkingDir = new File(m_sTestCaseCompilerPath); + Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir); BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream())); String sOutput = null; while ((sOutput = oOutput.readLine()) != null) { @@ -137,7 +139,8 @@ public class Configurator { //TODO launch test manager try { - Process oTestManager = oRuntime.exec(m_sTestManagerPath); + File oWorkingDir = new File(m_sTestManagerPath); + Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir); BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream())); String sOutput = null; while ((sOutput = oOutput.readLine()) != null) {