Skip to content

Commit dfc8896

Browse files
authored
Merge pull request #49 from open-simulation-platform/release/0.8.0
Release/0.8.0
2 parents dbc8bd3 + dd3eb01 commit dfc8896

File tree

44 files changed

+986
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+986
-85
lines changed

osp-model-description-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>msmi-validator</artifactId>
77
<groupId>com.opensimulationplatform</groupId>
8-
<version>0.7.0-SNAPSHOT</version>
8+
<version>0.8.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

osp-model-description-cli/src/test/java/com/opensimulationplatform/modeldescription/cli/CommandLineInterfaceTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.opensimulationplatform.modeldescription.cli;
22

3+
import com.opensimulationplatform.core.util.resource.Resources;
34
import org.junit.Rule;
45
import org.junit.Test;
56
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
@@ -14,10 +15,10 @@ public class CommandLineInterfaceTest {
1415

1516
@Rule
1617
public final TemporaryFolder tempFolder = new TemporaryFolder();
17-
private final String ontology = TestResources.OSP_OWL.toFile().getAbsolutePath();
18-
private final String fmu = TestResources.CRANE_CONTROLLER_FMU.toFile().getAbsolutePath();
19-
private final String invalidModelDescription = TestResources.CRANE_CONTROLLER_INVALID.toFile().getAbsolutePath();
20-
private final String validModelDescription = TestResources.CRANE_CONTROLLER_VALID.toFile().getAbsolutePath();
18+
private final String ontology = Resources.OSP_OWL.toFile().getAbsolutePath();
19+
private final String fmu = TestResources.CRANE_CONTROLLER_FMU.getAbsolutePath();
20+
private final String invalidModelDescription = TestResources.CRANE_CONTROLLER_INVALID.getAbsolutePath();
21+
private final String validModelDescription = TestResources.CRANE_CONTROLLER_VALID.getAbsolutePath();
2122

2223
@Test
2324
public void canCheckInvalidModelDescription() {
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package com.opensimulationplatform.modeldescription.cli;
22

3-
import com.opensimulationplatform.core.util.resource.Resource;
3+
import java.io.File;
44

55
public class TestResources {
6-
static final Resource CRANE_CONTROLLER_FMU = new Resource("/CraneController.fmu");
7-
static final Resource CRANE_CONTROLLER_VALID = new Resource("/CraneController_OspModelDescription-valid.xml");
8-
static final Resource CRANE_CONTROLLER_INVALID = new Resource("/CraneController_OspModelDescription-invalid.xml");
9-
static final Resource OSP_OWL = new Resource("/osp.owl");
6+
static final File CRANE_CONTROLLER_FMU = new File("./src/test/resources/CraneController.fmu");
7+
static final File CRANE_CONTROLLER_VALID = new File("./src/test/resources/CraneController_OspModelDescription-valid.xml");
8+
static final File CRANE_CONTROLLER_INVALID = new File("./src/test/resources/CraneController_OspModelDescription-invalid.xml");
109
}

osp-model-description/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>msmi-validator</artifactId>
77
<groupId>com.opensimulationplatform</groupId>
8-
<version>0.7.0-SNAPSHOT</version>
8+
<version>0.8.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.opensimulationplatform.modeldescription;
22

3-
import com.opensimulationplatform.core.util.resource.Resource;
3+
import java.io.File;
44

55
public class TestResources {
6-
public static final Resource MODEL_DEFINITION_XML = new Resource("/parsing/xml/OspModelDescription.xml");
7-
public static final Resource OSP_OWL = new Resource("/osp.owl");
8-
public static final Resource CRANE_CONTROLLER_FMU = new Resource("/validator/CraneController.fmu");
9-
public static final Resource KNUCKLE_BOOM_CRANE_FMU = new Resource("/validator/KnuckleBoomCrane.fmu");
10-
public static final Resource CRANE_CONTROLLER_XML = new Resource("/validator/xml/CraneController_OspModelDescription.xml");
11-
public static final Resource KNUCKLE_BOOM_CRANE_XML = new Resource("/validator/xml/KnuckleBoomCrane_OspModelDescription.xml");
6+
public static final File MODEL_DEFINITION_XML = new File("./src/test/resources/parsing/xml/OspModelDescription.xml");
7+
public static final File CRANE_CONTROLLER_FMU = new File("./src/test/resources/validator/CraneController.fmu");
8+
public static final File KNUCKLE_BOOM_CRANE_FMU = new File("./src/test/resources/validator/KnuckleBoomCrane.fmu");
9+
public static final File CRANE_CONTROLLER_XML = new File("./src/test/resources/validator/xml/CraneController_OspModelDescription.xml");
10+
public static final File KNUCKLE_BOOM_CRANE_XML = new File("./src/test/resources/validator/xml/KnuckleBoomCrane_OspModelDescription.xml");
1211
}

osp-model-description/src/test/java/com/opensimulationplatform/modeldescription/xml/parser/OspModelDescriptionParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class OspModelDescriptionParserTest {
1212
@Test
1313
public void canParse() {
14-
OspModelDescription ospModelDescription = OspModelDescriptionParser.parse(TestResources.MODEL_DEFINITION_XML.toFile());
14+
OspModelDescription ospModelDescription = OspModelDescriptionParser.parse(TestResources.MODEL_DEFINITION_XML);
1515

1616
List<Plugs.Plug> plugs = ospModelDescription.getPlugs().getPlug();
1717
assertEquals(3, plugs.size());

osp-model-description/src/test/java/com/opensimulationplatform/modeldescription/xml/validator/XmlValidatorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
public class XmlValidatorTest {
1010
@Test
1111
public void canValidate() {
12-
ModelDescriptionValidator.Result result = XmlValidator.validate(TestResources.CRANE_CONTROLLER_XML.toFile(), TestResources.CRANE_CONTROLLER_FMU.toFile());
12+
ModelDescriptionValidator.Result result = XmlValidator.validate(TestResources.CRANE_CONTROLLER_XML, TestResources.CRANE_CONTROLLER_FMU);
1313
assertTrue(String.valueOf(result.getMessages()), result.isValid());
1414

15-
result = XmlValidator.validate(TestResources.KNUCKLE_BOOM_CRANE_XML.toFile(), TestResources.KNUCKLE_BOOM_CRANE_FMU.toFile());
15+
result = XmlValidator.validate(TestResources.KNUCKLE_BOOM_CRANE_XML, TestResources.KNUCKLE_BOOM_CRANE_FMU);
1616
assertTrue(String.valueOf(result.getMessages()), result.isValid());
1717
}
1818
}

osp-system-structure-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>msmi-validator</artifactId>
77
<groupId>com.opensimulationplatform</groupId>
8-
<version>0.7.0-SNAPSHOT</version>
8+
<version>0.8.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

osp-system-structure-cli/src/test/java/com/opensimulationplatform/systemstructure/cli/CommandLineInterfaceTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.opensimulationplatform.systemstructure.cli;
22

3+
import com.opensimulationplatform.core.util.resource.Resources;
34
import org.junit.Rule;
45
import org.junit.Test;
56
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
@@ -15,9 +16,9 @@ public class CommandLineInterfaceTest {
1516
@Rule
1617
public final TemporaryFolder tempFolder = new TemporaryFolder();
1718

18-
private final String ontology = TestResources.OSP_OWL.toFile().getAbsolutePath();
19-
private final String invalidConfig = TestResources.SYSTEM_STRUCTURE_INVALID_XML.toFile().getAbsolutePath();
20-
private final String validConfig = TestResources.SYSTEM_STRUCTURE_VALID_XML.toFile().getAbsolutePath();
19+
private final String ontology = Resources.OSP_OWL.toFile().getAbsolutePath();
20+
private final String invalidConfig = TestResources.SYSTEM_STRUCTURE_INVALID_XML.getAbsolutePath();
21+
private final String validConfig = TestResources.SYSTEM_STRUCTURE_VALID_XML.getAbsolutePath();
2122

2223
@Test
2324
public void canCheckInvalidConfiguration() {
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package com.opensimulationplatform.systemstructure.cli;
22

3-
import com.opensimulationplatform.core.util.resource.Resource;
3+
import java.io.File;
44

55
class TestResources {
6-
static final Resource SYSTEM_STRUCTURE_INVALID_XML = new Resource("/validator/xml/OspSystemStructure-invalid.xml");
7-
static final Resource SYSTEM_STRUCTURE_VALID_XML = new Resource("/validator/xml/OspSystemStructure-valid.xml");
8-
static final Resource OSP_OWL = new Resource("/osp.owl");
6+
static final File SYSTEM_STRUCTURE_INVALID_XML = new File("./src/test/resources/validator/xml/OspSystemStructure-invalid.xml");
7+
static final File SYSTEM_STRUCTURE_VALID_XML = new File("./src/test/resources/validator/xml/OspSystemStructure-valid.xml");
98
}

0 commit comments

Comments
 (0)