Tabnine Logo
DMNRuntimeUtil.createExpectingDMNMessages
Code IndexAdd Tabnine to your IDE (free)

How to use
createExpectingDMNMessages
method
in
org.kie.dmn.core.util.DMNRuntimeUtil

Best Java code snippets using org.kie.dmn.core.util.DMNRuntimeUtil.createExpectingDMNMessages (Showing top 11 results out of 315)

origin: org.kie/kie-dmn-core

@Test
public void testErrorMessages() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("car_damage_responsibility2.dmn", this.getClass());
  assertThat(messages.isEmpty(), is(false));
}
origin: org.kie/kie-dmn-core

@Test
public void testInvalidVariableNames() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("invalid-variable-names.dmn", this.getClass());
  assertThat(messages.isEmpty(), is(false));
}
origin: org.kie/kie-dmn-core

@Test
public void testPriority_table_missing_output_values() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("DTABLE_PRIORITY_MISSING_OUTVALS.dmn", this.getClass());
  assertThat(messages.size(), is(1));
}
origin: org.kie/kie-dmn-core

@Test
public void testJavaFunctionContext_withErrors() {
  // DROOLS-1568
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("java_function_context_with_errors.dmn", this.getClass());
  assertThat(messages.size(), is(2));
  final List<String> sourceIDs = messages.stream().map(DMNMessage::getSourceId).collect(Collectors.toList());
  assertTrue( sourceIDs.contains( "_a72a7aff-48c3-4806-83ca-fc1f1fe34320") );
  assertTrue( sourceIDs.contains( "_a72a7aff-48c3-4806-83ca-fc1f1fe34321" ) );
}
origin: org.kie/kie-dmn-core

  @Test
  public void testMissingInputData() {
    final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("missing_input_data.dmn", getClass());
    assertThat(messages.get(0).getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL));
  }
}
origin: org.kie/kie-dmn-core

@Test
public void testUnknownVariable2() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("unknown_variable2.dmn", this.getClass());
  assertThat(messages.get(0).getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL));
  assertThat(messages.get(0).getMessage(), containsString("Unknown variable 'Borrower.liquidAssetsAmt'"));
}
origin: org.kie/kie-dmn-core

@Test
public void testInvalidModel() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("Loan_Prequalification_Condensed_Invalid.dmn", this.getClass());
  assertThat(messages.size(), is(2));
  assertThat(messages.get(0).getSourceId(), is("_8b5cac9e-c8ca-4817-b05a-c70fa79a8d48"));
  assertThat(messages.get(1).getSourceId(), is("_ef09d90e-e1a4-4ec9-885b-482d1f4a1cee"));
}
origin: org.kie/kie-dmn-core

@Test
public void testWrongTypeRefForDRGElement() {
  // DROOLS-2917 DMN resolveTypeRef returning null in BKM causes NPE during KieContainer compilation
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("WrongTypeRefForDRGElement.dmn", this.getClass());
  DMNRuntimeUtil.formatMessages(messages);
  assertThat(messages.isEmpty(), is(false));
  assertThat(messages.stream().anyMatch(m -> m.getMessageType().equals(DMNMessageType.TYPE_DEF_NOT_FOUND)), is(true));
  assertThat(messages.stream().anyMatch(m -> m.getSourceId().equals("_561d31ba-a34b-4cf3-b9a4-537e21ce1013")), is(true));
  assertThat(messages.stream().anyMatch(m -> m.getSourceId().equals("_45fa8674-f4f0-4c06-b2fd-52bbd17d8550")), is(true));
}
origin: org.kie/kie-dmn-core

@Test
public void testUnknownVariable1() {
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("unknown_variable1.dmn", this.getClass());
  assertEquals(1, messages.stream().filter(m -> m.getMessageType().equals(DMNMessageType.ERR_COMPILING_FEEL))
              .filter(m -> m.getMessage().contains("Unknown variable 'NonSalaryPct'"))
              .count());
}
origin: org.kie/kie-dmn-core

@Test
public void testBoxedInvocationMissingExpression() {
  // DROOLS-2813 DMN boxed invocation missing expression NPE and Validator issue
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("DROOLS-2813-NPE-BoxedInvocationMissingExpression.dmn", this.getClass());
  assertTrue(messages.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION) && p.getSourceId().equals("_a111c4df-c5b5-4d84-81e7-3ec735b50d06")));
}
origin: org.kie/kie-dmn-core

@Test
public void testWrongConstraintsInItemDefinition() {
  // DROOLS-1503
  final List<DMNMessage> messages = DMNRuntimeUtil.createExpectingDMNMessages("WrongConstraintsInItemDefinition.dmn", this.getClass());
  assertThat(DMNRuntimeUtil.formatMessages(messages), messages.size(), is(3));
  assertThat(messages.get(0).getSourceReference(), is(instanceOf(ItemDefinition.class)));
  assertThat(messages.get(0).getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL));
  assertThat(messages.get(1).getSourceId(), is("_e794c655-4fdf-45d1-b7b7-d990df513f92"));
  assertThat(messages.get(1).getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL));
  
  // The DecisionTable does not define typeRef for the single OutputClause, but neither the enclosing Decision define typeRef for its variable
  assertThat(messages.get(2).getSourceId(), is("_31911de7-e184-411c-99d1-f33977971270"));
  assertThat(messages.get(2).getMessageType(), is(DMNMessageType.MISSING_TYPE_REF));
}

org.kie.dmn.core.utilDMNRuntimeUtilcreateExpectingDMNMessages

Popular methods of DMNRuntimeUtil

  • createRuntime
  • createRuntimeWithAdditionalResources
  • formatMessages
  • createAndDeployJarIgnoringErrors
  • createJarIgnoringErrors
  • createListener
  • getKieContainerIgnoringErrors
  • typeSafeGetKieRuntime

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • setScale (BigDecimal)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • String (java.lang)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now