use of org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel in project drools-wb by kiegroup.
the class GuidedScoreCardFactory method makeScoreCardWithoutCharacteristics.
public static ScoreCardModel makeScoreCardWithoutCharacteristics(final String packageName, final Collection<Import> imports, final String name) {
final ScoreCardModel model = new ScoreCardModel();
model.getImports().getImports().addAll(imports);
model.setPackageName(packageName);
model.setName(name);
model.setFactName("Applicant");
model.setFieldName("age");
return model;
}
use of org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel in project drools-wb by kiegroup.
the class GuidedScoreCardEditorPresenterTest method testGetContentSupplier.
@Test
public void testGetContentSupplier() throws Exception {
final ScoreCardModel content = mock(ScoreCardModel.class);
doReturn(content).when(view).getModel();
final Supplier<ScoreCardModel> contentSupplier = editor.getContentSupplier();
assertEquals(content, contentSupplier.get());
}
use of org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel in project drools-wb by kiegroup.
the class GuidedScoreCardEditorServiceImplTest method testSaveAndRename.
@Test
public void testSaveAndRename() throws Exception {
final Path path = mock(Path.class);
final String newFileName = "newFileName";
final Metadata metadata = mock(Metadata.class);
final ScoreCardModel content = mock(ScoreCardModel.class);
final String comment = "comment";
service.saveAndRename(path, newFileName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newFileName, metadata, content, comment);
}
use of org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel in project drools-wb by kiegroup.
the class NewGuidedScoreCardHandler method create.
@Override
public void create(final Package pkg, final String baseFileName, final NewResourcePresenter presenter) {
final ScoreCardModel model = new ScoreCardModel();
model.setName(baseFileName);
model.setPackageName(pkg.getPackageName());
busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Saving());
scoreCardService.call(getSuccessCallback(presenter), new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).create(pkg.getPackageMainResourcesPath(), buildFileName(baseFileName, resourceType), model, "");
}
use of org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel in project drools by kiegroup.
the class GuidedScoreCardDRLPersistenceTest method testEmptyModel.
@Test
public void testEmptyModel() {
final ScoreCardModel model = new ScoreCardModel();
model.setName("test");
final String drl = GuidedScoreCardDRLPersistence.marshal(model);
assertNotNull(drl);
assertFalse(drl.contains("package"));
assertEquals(12, StringUtil.countMatches(drl, "rule \""));
assertEquals(2, StringUtil.countMatches(drl, "import "));
}
Aggregations