Permalink
Browse files

[#83]: Automatic Evaluation of Exploration Candidates

Added the test fragment for the DSE

Task-Url: http://github.com/roberthilbrich/assist-public/issues/83
  • Loading branch information...
RobertHilbrich committed Jun 29, 2018
1 parent 7ebee81 commit 73b25567e779cdda4b26f91afb9e7df3582d4117
Showing with 462 additions and 6 deletions.
  1. +16 −0 ch.hilbri.assist.dse.tests/.classpath
  2. +6 −0 ch.hilbri.assist.dse.tests/.gitignore
  3. +40 −0 ch.hilbri.assist.dse.tests/.project
  4. +2 −0 ch.hilbri.assist.dse.tests/.settings/org.eclipse.core.resources.prefs
  5. +7 −0 ch.hilbri.assist.dse.tests/.settings/org.eclipse.jdt.core.prefs
  6. +4 −0 ch.hilbri.assist.dse.tests/.settings/org.eclipse.m2e.core.prefs
  7. +7 −0 ch.hilbri.assist.dse.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
  8. +31 −0 ch.hilbri.assist.dse.tests/DSE Tests.launch
  9. +21 −0 ch.hilbri.assist.dse.tests/META-INF/MANIFEST.MF
  10. +9 −0 ch.hilbri.assist.dse.tests/build.properties
  11. BIN ch.hilbri.assist.dse.tests/logback-classic-1.1.2.jar
  12. BIN ch.hilbri.assist.dse.tests/logback-core-1.1.2.jar
  13. +73 −0 ch.hilbri.assist.dse.tests/pom.xml
  14. +106 −0 ch.hilbri.assist.dse.tests/resources/example.ddsl
  15. BIN ch.hilbri.assist.dse.tests/slf4j-api-1.7.7.jar
  16. +53 −0 ch.hilbri.assist.dse.tests/src/ch/hilbri/assist/dse/tests/AbstractDSETest.xtend
  17. +14 −0 ch.hilbri.assist.dse.tests/src/ch/hilbri/assist/dse/tests/TestSuiteAllDSETests.xtend
  18. +28 −0 ch.hilbri.assist.dse.tests/src/ch/hilbri/assist/dse/tests/basics/VariancePointRemovalTests.xtend
  19. +17 −0 ch.hilbri.assist.dse.tests/src/logback-test.xml
  20. 0 ch.hilbri.assist.dse.tests/xtend-gen/.xtend-gen-keep
  21. +26 −5 ch.hilbri.assist.dse/src/ch/hilbri/assist/dse/evaluation/Evaluation.xtend
  22. +1 −1 ch.hilbri.assist.releng.product.gui/ASSIST GUI (Win32).launch
  23. +1 −0 ch.hilbri.assist.releng/pom.xml
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="xtend-gen">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
@@ -0,0 +1,6 @@
/bin/
/target/
/xtend-gen/*
/src-gen/*
!/xtend-gen/.xtend-gen-keep
!/src-gen/.src-gen-keep
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ch.hilbri.assist.dse.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
@@ -0,0 +1,7 @@
//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=xtend-gen
//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=xtend-gen
BuilderConfiguration.is_project_specific=true
eclipse.preferences.version=1
outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<stringAttribute key="bad_container_name" value="\ch.hilbri.assist.tests"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ch.hilbri.assist.dse.tests/xtend-gen/ch/hilbri/assist/dse/tests/TestSuiteAllDSETests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/ch.hilbri.assist.dse.tests/logback-classic-1.1.2.jar&quot; path=&quot;2&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/ch.hilbri.assist.dse.tests/logback-core-1.1.2.jar&quot; path=&quot;2&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/ch.hilbri.assist.dse.tests/slf4j-api-1.7.7.jar&quot; path=&quot;2&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8&quot; javaProject=&quot;ch.hilbri.assist.mapping.tests&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;ch.hilbri.assist.mapping.tests&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ch.hilbri.assist.dse.tests.TestSuiteAllDSETests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ch.hilbri.assist.dse.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
</launchConfiguration>
@@ -0,0 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ch.hilbri.assist.dse.tests
Bundle-SymbolicName: ch.hilbri.assist.dse.tests
Bundle-Version: 2.5.0.qualifier
Bundle-Vendor: Robert Hilbrich
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle:
org.junit,
org.eclipse.xtext.junit4,
org.eclipse.core.runtime,
ch.hilbri.assist.dse.dsl.tests,
org.eclipse.xtext.xbase.junit,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtext.testing,
org.eclipse.xtext.xbase.testing,
ch.hilbri.assist.model,
ch.qos.logback.classic,
ch.qos.logback.core
Fragment-Host: ch.hilbri.assist.dse;bundle-version="2.5.0"
Automatic-Module-Name: ch.hilbri.assist.dse.tests
@@ -0,0 +1,9 @@
source.. = src/,\
xtend-gen/
bin.includes = META-INF/,\
.,\
src/logback-test.xml,\
resources/,\
slf4j-api-1.7.7.jar,\
logback-core-1.1.2.jar,\
logback-classic-1.1.2.jar
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,73 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>ch.hilbri.assist.dse.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>
<parent>
<groupId>assist</groupId>
<artifactId>ch.hilbri.assist.releng</artifactId>
<version>2.5.0-SNAPSHOT</version>
<relativePath>../ch.hilbri.assist.releng</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<testSuite>ch.hilbri.assist.mapping.tests</testSuite>
<testClass>ch.hilbri.assist.mapping.tests.TestSuiteAllMappingTests</testClass>
<failIfNoTests>false</failIfNoTests>
<useUIHarness>false</useUIHarness>
<dependencies>
<dependency>
<type>eclipse-plugin</type>
<artifactId>org.eclipse.xtext.logging</artifactId>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.classic</artifactId>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.core</artifactId>
</dependency>
<dependency>
<type>eclipse-plugin</type>
<artifactId>ch.qos.logback.slf4j</artifactId>
</dependency>
</dependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<dependency-resolution>
<extraRequirements>
<!-- to get the org.eclipse.osgi.compatibility.state
plugin if the target platform is Luna or later. (backward compatible with
kepler and previous versions) see https://bugs.eclipse.org/bugs/show_bug.cgi?id=492149 -->
<requirement>
<type>eclipse-feature</type>
<id>org.eclipse.rcp</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,106 @@
Global {
System = "Example System";
}
Hardware {
Compartment Comp1 {
Manufacturer = "Manufacturer 1";
Box Box1 {
Manufacturer = "Manufacturer 1";
Board Board1 {
Manufacturer = "Manufacturer 2";
DesignAssuranceLevel = A;
Processor P1 {
Core C0 {
Capacity = 100;
}
Core C1 {
Capacity = 100;
}
}
}
Alternatives {
Alternative CheapBoard1 {
Board Board2 {
Manufacturer = "Cheap Manufacturer";
DesignAssuranceLevel = B;
Processor P1 {
Core C0 {
Capacity = 80;
}
}
}
}
Alternative ExpensiveBoard {
Board Board3 {
Manufacturer = "Expensive Manufacturer";
DesignAssuranceLevel = A;
Processor P1 {
Core C0 {
Capacity = 100;
}
Core C1 {
Capacity = 100;
}
}
}
}
}
}
}
}
Software {
Application A1 {
CriticalityLevel = A;
Task A1_T1 {
CoreUtilization = 1000;
}
}
Alternatives {
Alternative MultipleRedundantApplications {
Application B1 {
CriticalityLevel = B;
Task B1_T1 {
CoreUtilization = 20;
}
}
Application B2 {
CriticalityLevel = B;
Task B1_T1 {
CoreUtilization = 20;
}
}
}
Alternative SingleCriticalApplication {
Application C1 {
CriticalityLevel = A;
Task C1_T1 {
CoreUtilization = 40;
}
}
}
}
}
Restrictions {
Alternatives {
Alternative MultipleRedundantApplications {
B1, B2 dislocal up to Board;
}
}
}
Candidates {
Candidate Cheap {
Boards = CheapBoard1;
Applications = MultipleRedundantApplications;
Restrictions = MultipleRedundantApplications;
}
Candidate Expensive {
Boards = ExpensiveBoard;
Applications = SingleCriticalApplication;
}
}
Binary file not shown.
@@ -0,0 +1,53 @@
package ch.hilbri.assist.dse.tests
import ch.hilbri.assist.dse.dsl.tests.DSEDslInjectorProvider
import ch.hilbri.assist.model.AssistModel
import ch.hilbri.assist.model.ModelPackage
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.joran.JoranConfigurator
import ch.qos.logback.core.joran.spi.JoranException
import com.google.inject.Inject
import java.io.IOException
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.XtextRunner
import org.eclipse.xtext.testing.util.ParseHelper
import org.eclipse.xtext.testing.util.ResourceHelper
import org.junit.BeforeClass
import org.junit.runner.RunWith
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@RunWith(XtextRunner)
@InjectWith(DSEDslInjectorProvider)
class AbstractDSETest {
protected String input
protected Logger logger
new() {
/* Configure Logback programmatically to use logback-test.xml */
val iLoggerFactory = LoggerFactory.getILoggerFactory
val loggerContext = iLoggerFactory as LoggerContext
loggerContext.reset
val configurator = new JoranConfigurator
configurator.setContext(loggerContext)
try {
configurator.doConfigure(class.getResourceAsStream("/logback-test.xml"))
} catch (JoranException e) {
throw new IOException(e.getMessage(), e)
}
logger = LoggerFactory.getLogger(this.class)
}
@Inject
protected ParseHelper<AssistModel> parser
@Inject
protected ResourceHelper resourceHelper
@BeforeClass
def static void registerEPackage() { ModelPackage.eINSTANCE.eClass() }
}
Oops, something went wrong.

0 comments on commit 73b2556

Please sign in to comment.