use of org.kie.workbench.common.services.shared.kmodule.KSessionModel in project kie-wb-common by kiegroup.
the class KSessionSelector method addMockKBaseModel.
private void addMockKBaseModel(final String kbaseName, final String ksessionsName) {
KBaseModel kbaseModel = new KBaseModel();
kbaseModel.setName(kbaseName);
KSessionModel ksessionModel = new KSessionModel();
ksessionModel.setName(ksessionsName);
kbaseModel.getKSessions().add(ksessionModel);
kmodule.getKBases().put(kbaseName, kbaseModel);
}
use of org.kie.workbench.common.services.shared.kmodule.KSessionModel in project kie-wb-common by kiegroup.
the class KSessionSelector method listKSessions.
private void listKSessions(List<KSessionModel> ksessions) {
List<String> ksessionNames = new ArrayList<String>();
for (KSessionModel ksession : ksessions) {
ksessionNames.add(ksession.getName());
}
view.setKSessions(ksessionNames);
}
use of org.kie.workbench.common.services.shared.kmodule.KSessionModel in project kie-wb-common by kiegroup.
the class KnowledgeSessionsModal method newKSessionModel.
KSessionModel newKSessionModel() {
final KSessionModel kSessionModel = new KSessionModel();
kSessionModel.setName("");
kSessionModel.setDefault(knowledgeBasesListPresenter.getObjectsList().isEmpty());
return kSessionModel;
}
use of org.kie.workbench.common.services.shared.kmodule.KSessionModel in project kie-wb-common by kiegroup.
the class KnowledgeSessionListItemPresenterTest method testOnDefaultKnowledgeSessionChangedWithAnotherKSessionModel.
@Test
public void testOnDefaultKnowledgeSessionChangedWithAnotherKSessionModel() {
final KBaseModel kBaseModel = new KBaseModel();
final KSessionModel kSessionModel = new KSessionModel();
kSessionModel.setDefault(true);
final KnowledgeSessionsModal parentPresenter = mock(KnowledgeSessionsModal.class);
doReturn(kBaseModel).when(parentPresenter).getObject();
knowledgeSessionListItemPresenter.parentPresenter = parentPresenter;
knowledgeSessionListItemPresenter.kSessionModel = kSessionModel;
final KSessionModel anotherKSessionModel = new KSessionModel();
anotherKSessionModel.setName("Distinguishing name");
knowledgeSessionListItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeSessionChange(kBaseModel, anotherKSessionModel));
Assert.assertEquals(false, kSessionModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KSessionModel in project kie-wb-common by kiegroup.
the class KnowledgeSessionListItemPresenterTest method testAddWorkItemHandler.
@Test
public void testAddWorkItemHandler() {
doNothing().when(knowledgeSessionListItemPresenter).fireChangeEvent();
knowledgeSessionListItemPresenter.kSessionModel = new KSessionModel();
knowledgeSessionListItemPresenter.addWorkItemHandler();
verify(workItemHandlersListPresenter).add(any());
verify(knowledgeSessionListItemPresenter).signalWorkItemHandlerAddedOrRemoved();
verify(knowledgeSessionListItemPresenter).fireChangeEvent();
}
Aggregations