Search in sources :

Example 16 with Import

use of org.kie.dmn.model.v1_1.Import in project drools by kiegroup.

the class ImportDMNResolverUtilTest method testNSonly.

@Test
public void testNSonly() {
    Import i = makeImport("ns1", null, null);
    List<QName> available = Arrays.asList(new QName("ns1", "m1"), new QName("ns2", "m2"), new QName("ns3", "m3"));
    Either<String, QName> result = ImportDMNResolverUtil.resolveImportDMN(i, available, Function.identity());
    assertTrue(result.isRight());
    assertEquals(new QName("ns1", "m1"), result.getOrElse(null));
}
Also used : Import(org.kie.dmn.model.v1_1.Import) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 17 with Import

use of org.kie.dmn.model.v1_1.Import in project drools by kiegroup.

the class ImportDMNResolverUtilTest method testNSandModelNameWithAlias.

@Test
public void testNSandModelNameWithAlias() {
    Import i = makeImport("ns1", "aliased", "m1");
    List<QName> available = Arrays.asList(new QName("ns1", "m1"), new QName("ns2", "m2"), new QName("ns3", "m3"));
    Either<String, QName> result = ImportDMNResolverUtil.resolveImportDMN(i, available, Function.identity());
    assertTrue(result.isRight());
    assertEquals(new QName("ns1", "m1"), result.getOrElse(null));
}
Also used : Import(org.kie.dmn.model.v1_1.Import) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 18 with Import

use of org.kie.dmn.model.v1_1.Import in project drools by kiegroup.

the class ImportDMNResolverUtilTest method testLocateInNSdefaultWithAliasunexistent.

@Test
public void testLocateInNSdefaultWithAliasunexistent() {
    Import i = makeImport("nsA", "boh", null);
    List<QName> available = Arrays.asList(new QName("nsA", "m1"), new QName("nsA", "m2"), new QName("nsB", "m3"));
    Either<String, QName> result = ImportDMNResolverUtil.resolveImportDMN(i, available, Function.identity());
    assertTrue(result.isLeft());
}
Also used : Import(org.kie.dmn.model.v1_1.Import) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 19 with Import

use of org.kie.dmn.model.v1_1.Import in project drools by kiegroup.

the class ImportDMNResolverUtilTest method testNSandUnexistentModelName.

@Test
public void testNSandUnexistentModelName() {
    Import i = makeImport("ns1", null, "boh");
    List<QName> available = Arrays.asList(new QName("ns1", "m1"), new QName("ns2", "m2"), new QName("ns3", "m3"));
    Either<String, QName> result = ImportDMNResolverUtil.resolveImportDMN(i, available, Function.identity());
    assertTrue(result.isLeft());
}
Also used : Import(org.kie.dmn.model.v1_1.Import) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Aggregations

Import (org.kie.dmn.model.v1_1.Import)17 QName (javax.xml.namespace.QName)15 Test (org.junit.Test)12 DMNModel (org.kie.dmn.api.core.DMNModel)2 Definitions (org.kie.dmn.model.v1_1.Definitions)2 XStream (com.thoughtworks.xstream.XStream)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)1 Auditing (org.eclipse.bpmn2.Auditing)1 ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)1 Import (org.eclipse.bpmn2.Import)1 Monitoring (org.eclipse.bpmn2.Monitoring)1 Internal (org.eclipse.emf.ecore.EStructuralFeature.Internal)1 EAttributeImpl (org.eclipse.emf.ecore.impl.EAttributeImpl)1 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)1 ExtendedMetaData (org.eclipse.emf.ecore.util.ExtendedMetaData)1 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)1 GlobalType (org.jboss.drools.GlobalType)1