Search in sources :

Example 36 with KBaseModel

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());
}
Also used : KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 37 with KBaseModel

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;
            }
        }
    }
}
Also used : KSessionModel(org.kie.workbench.common.services.shared.kmodule.KSessionModel) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel)

Example 38 with KBaseModel

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);
}
Also used : KSessionModel(org.kie.workbench.common.services.shared.kmodule.KSessionModel) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel)

Aggregations

KBaseModel (org.kie.workbench.common.services.shared.kmodule.KBaseModel)38 Test (org.junit.Test)27 KSessionModel (org.kie.workbench.common.services.shared.kmodule.KSessionModel)12 KModuleModel (org.kie.workbench.common.services.shared.kmodule.KModuleModel)6 KnowledgeBasesPresenter (org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.KnowledgeBasesPresenter)5 KnowledgeBasesPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter)3 HierarchicalStreamReader (com.thoughtworks.xstream.io.HierarchicalStreamReader)2 AbstractXStreamConverter (org.drools.core.util.AbstractXStreamConverter)2 SingleValueItemObjectModel (org.kie.workbench.common.services.shared.kmodule.SingleValueItemObjectModel)2 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 RuntimeStrategy (org.kie.internal.runtime.conf.RuntimeStrategy)1 KnowledgeBaseItemPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.KnowledgeBaseItemPresenter)1 KnowledgeBaseItemPresenter (org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.item.KnowledgeBaseItemPresenter)1 ProcessConfigModule (org.kie.workbench.common.screens.server.management.model.ProcessConfigModule)1 RuntimeStrategy (org.kie.workbench.common.screens.server.management.model.RuntimeStrategy)1 KModuleContentHandler (org.kie.workbench.common.services.backend.kmodule.KModuleContentHandler)1 ConsoleLogger (org.kie.workbench.common.services.shared.kmodule.ConsoleLogger)1 FileLogger (org.kie.workbench.common.services.shared.kmodule.FileLogger)1