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));
}
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));
}
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());
}
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());
}
Aggregations