use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedDecisionTreeEditorServiceImplTest 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 GuidedDecisionTree content = mock(GuidedDecisionTree.class);
final String comment = "comment";
service.saveAndRename(path, newFileName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newFileName, metadata, content, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedDecisionTableEditorPresenterTest method testGetMetadataSupplier.
@Test
public void testGetMetadataSupplier() {
final GuidedDecisionTableView.Presenter document = mock(GuidedDecisionTableView.Presenter.class);
final Overview overview = mock(Overview.class);
final Metadata expectedMetadata = mock(Metadata.class);
doReturn(document).when(presenter).getActiveDocument();
doReturn(overview).when(document).getOverview();
doReturn(expectedMetadata).when(overview).getMetadata();
final Metadata actualMetadata = presenter.getMetadataSupplier().get();
assertEquals(expectedMetadata, actualMetadata);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedRuleEditorServiceImpl method save.
@Override
public Path save(final Path resource, final RuleModel model, final Metadata metadata, final String comment) {
try {
final Package pkg = moduleService.resolvePackage(resource);
final String packageName = (pkg == null ? null : pkg.getPackageName());
model.setPackageName(packageName);
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), toSourceUnexpanded(resource, model), metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedRuleEditorServiceImplTest 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 RuleModel content = mock(RuleModel.class);
final String comment = "comment";
service.saveAndRename(path, newFileName, metadata, content, comment);
verify(saveAndRenameService).saveAndRename(path, newFileName, metadata, content, comment);
}
use of org.guvnor.common.services.shared.metadata.model.Metadata in project drools-wb by kiegroup.
the class GuidedScoreCardEditorServiceImpl method save.
@Override
public Path save(final Path resource, final ScoreCardModel model, final Metadata metadata, final String comment) {
try {
final Package pkg = moduleService.resolvePackage(resource);
final String packageName = (pkg == null ? null : pkg.getPackageName());
model.setPackageName(packageName);
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), GuidedScoreCardXMLPersistence.getInstance().marshal(model), metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
Aggregations