use of org.drools.workbench.screens.globals.model.GlobalsModel in project drools-wb by kiegroup.
the class GlobalsPersistenceTest method testUnmarshalling.
@Test
public void testUnmarshalling() {
final String content = "global java.lang.String myString;\n";
final GlobalsModel model = GlobalsPersistence.getInstance().unmarshal(content);
assertNotNull(model);
assertEquals(1, model.getGlobals().size());
assertEquals("java.lang.String", model.getGlobals().get(0).getClassName());
assertEquals("myString", model.getGlobals().get(0).getAlias());
}
use of org.drools.workbench.screens.globals.model.GlobalsModel in project drools-wb by kiegroup.
the class DecisionTableXLSToDecisionTableGuidedConverterTest method testGlobalGeneration.
@Test
public // https://bugzilla.redhat.com/show_bug.cgi?id=1310208
void testGlobalGeneration() {
final InputStream is = this.getClass().getResourceAsStream("BZ1310208.xls");
when(ioService.newInputStream(any(org.uberfire.java.nio.file.Path.class))).thenReturn(is);
final ConversionResult result = converter.convert(path);
assertNotNull(result);
final ArgumentCaptor<GlobalsModel> globalsModelArgumentCaptor = ArgumentCaptor.forClass(GlobalsModel.class);
verify(globalsService, times(1)).create(any(Path.class), any(String.class), globalsModelArgumentCaptor.capture(), any(String.class));
assertNotNull(globalsModelArgumentCaptor.getValue());
final GlobalsModel globalsModel = globalsModelArgumentCaptor.getValue();
assertEquals(1, globalsModel.getGlobals().size());
assertEquals("list", globalsModel.getGlobals().get(0).getAlias());
assertEquals("java.util.List", globalsModel.getGlobals().get(0).getClassName());
verify(guidedDecisionTableService, times(1)).create(any(Path.class), any(String.class), any(GuidedDecisionTable52.class), any(String.class));
verify(drlService, never()).create(any(Path.class), any(String.class), any(String.class), any(String.class));
}
Aggregations