Skip to content

Commit 653fb89

Browse files
committed
Fix failing test
Due to the validation of Regular Expression Constraints on example values, validation of the CatenaX Battery Pass model now fails
1 parent 43c4c93 commit 653fb89

File tree

2 files changed

+3
-2
lines changed
  • core
    • esmf-aspect-model-github-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/github
    • esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/constraint

2 files changed

+3
-2
lines changed

core/esmf-aspect-model-github-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/github/GitHubStrategyTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader;
3333
import org.eclipse.esmf.aspectmodel.resolver.GithubRepository;
3434
import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy;
35+
import org.eclipse.esmf.aspectmodel.shacl.violation.SparqlConstraintViolation;
3536
import org.eclipse.esmf.aspectmodel.shacl.violation.Violation;
3637
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
3738
import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator;
@@ -150,6 +151,6 @@ void testLoadCatenaxBatteryPass() {
150151

151152
final AspectModelValidator validator = new AspectModelValidator();
152153
final List<Violation> violations = validator.validateModel( batteryPass );
153-
assertThat( violations ).isEmpty();
154+
assertThat( violations ).hasOnlyElementsOfType( SparqlConstraintViolation.class );
154155
}
155156
}

core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/constraint/JsConstraint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public JsConstraint( final String message, final JsLibrary jsLibrary, final Stri
7777
engine = new ScriptEngineManager().getEngineByName( "JavaScript" );
7878
if ( engine == null ) {
7979
throw new ShaclValidationException( "Could not initialize JavaScript engine. Please make sure org.graalvm.js:js is "
80-
+ "in the list of dependencies and/or the 'js' component is installed in you GraalVM runtime." );
80+
+ "in the list of dependencies and/or the 'js' component is installed in your GraalVM runtime." );
8181
}
8282
final Bindings bindings = engine.getBindings( ScriptContext.ENGINE_SCOPE );
8383
// The following settings are required to allow the script to access methods and fields on the injected objects

0 commit comments

Comments
 (0)