Search in sources :

Example 6 with KBaseModel

use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.

the class KnowledgeBaseItemPresenterTest method testSetup.

@Test
public void testSetup() {
    final KnowledgeBaseItemPresenter setup = knowledgeBaseItemPresenter.setup(new KBaseModel(), mock(KnowledgeBasesPresenter.class));
    Assert.assertEquals(setup, knowledgeBaseItemPresenter);
    verify(view).setKnowledgeSessionsCount(anyInt());
    verify(view).setDefault(anyBoolean());
    verify(view).setName(any());
    verify(knowledgeSessionsModal).setup(any());
    verify(addPackageModal).setup(any(), any());
    verify(addIncludedKnowledgeBaseModal).setup(any(), any());
    verify(packageListPresenter).setup(any(), any(), any());
    verify(includedKnowledgeBasesListPresenter).setup(any(), any(), any());
    verify(eventProcessingModeSelect).setup(any(), any(), any(), any());
    verify(equalsBehaviorSelect).setup(any(), any(), any(), any());
}
Also used : KnowledgeBasesPresenter(org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 7 with KBaseModel

use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.

the class KnowledgeBaseItemPresenterTest method testOnDefaultKnowledgeSessionChanged.

@Test
public void testOnDefaultKnowledgeSessionChanged() {
    final KBaseModel kBaseModel = new KBaseModel();
    kBaseModel.setDefault(true);
    knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
    knowledgeBaseItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeBaseChange(kBaseModel));
    Assert.assertTrue(kBaseModel.isDefault());
}
Also used : KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 8 with KBaseModel

use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.

the class KnowledgeBaseItemPresenterTest method testOnDefaultKnowledgeSessionChangedWithAnotherKBaseModel.

@Test
public void testOnDefaultKnowledgeSessionChangedWithAnotherKBaseModel() {
    final KBaseModel kBaseModel = new KBaseModel();
    kBaseModel.setDefault(true);
    knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
    knowledgeBaseItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeBaseChange(mock(KBaseModel.class)));
    Assert.assertFalse(kBaseModel.isDefault());
}
Also used : KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 9 with KBaseModel

use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.

the class KnowledgeSessionListItemPresenterTest method testOnDefaultKnowledgeSessionChanged.

@Test
public void testOnDefaultKnowledgeSessionChanged() {
    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;
    knowledgeSessionListItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeSessionChange(kBaseModel, kSessionModel));
    Assert.assertTrue(kSessionModel.isDefault());
}
Also used : KSessionModel(org.kie.workbench.common.services.shared.kmodule.KSessionModel) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 10 with KBaseModel

use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.

the class KnowledgeSessionsModalTest method testSetup.

@Test
public void testSetup() {
    final KnowledgeBaseItemPresenter parentPresenter = mock(KnowledgeBaseItemPresenter.class);
    doReturn(new KBaseModel()).when(parentPresenter).getObject();
    doNothing().when(knowledgeSessionsModal).superSetup();
    doNothing().when(knowledgeSessionsModal).setWidth(any());
    knowledgeSessionsModal.setup(parentPresenter);
    verify(knowledgeSessionsModal).superSetup();
    verify(knowledgeBasesListPresenter).setup(any(), any(), any());
}
Also used : KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) KnowledgeBaseItemPresenter(org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.KnowledgeBaseItemPresenter) Test(org.junit.Test)

Aggregations

KBaseModel (org.kie.workbench.common.services.shared.kmodule.KBaseModel)20 Test (org.junit.Test)11 KSessionModel (org.kie.workbench.common.services.shared.kmodule.KSessionModel)7 KnowledgeBasesPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter)3 KModuleModel (org.kie.workbench.common.services.shared.kmodule.KModuleModel)3 HierarchicalStreamReader (com.thoughtworks.xstream.io.HierarchicalStreamReader)2 AbstractXStreamConverter (org.drools.core.util.AbstractXStreamConverter)2 KnowledgeBaseItemPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.item.KnowledgeBaseItemPresenter)1