use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBasesPresenterTest method testNewKBaseModelEmptyMap.
@Test
public void testNewKBaseModelEmptyMap() {
doReturn(emptyList()).when(knowledgeBaseListPresenter).getObjectsList();
final KBaseModel kBaseModel = knowledgeBasesPresenter.newKBaseModel("Name");
Assert.assertEquals("Name", kBaseModel.getName());
Assert.assertEquals(true, kBaseModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KSessionSelector method selectFromModel.
private void selectFromModel(final String currentKSession) {
for (KBaseModel kbase : kmodule.getKBases().values()) {
for (KSessionModel ksession : kbase.getKSessions()) {
if (ksession.getName().equals(currentKSession)) {
listKSessions(kmodule.getKBases().get(kbase.getName()).getKSessions());
view.setSelected(kbase.getName(), currentKSession);
break;
}
}
}
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel 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);
}
Aggregations