use of org.kie.server.controller.api.model.spec.ProcessConfig in project kie-wb-common by kiegroup.
the class ServerTemplateVFSStorageTest method createServerTemplateWithContainer.
/*
* helper method to setup template container and container spec
*/
protected void createServerTemplateWithContainer() {
serverTemplate = new ServerTemplate();
serverTemplate.setName("test server");
serverTemplate.setId(UUID.randomUUID().toString());
Map<Capability, ContainerConfig> configs = new HashMap<Capability, ContainerConfig>();
ruleConfig = new RuleConfig();
ruleConfig.setPollInterval(1000l);
ruleConfig.setScannerStatus(KieScannerStatus.STARTED);
configs.put(Capability.RULE, ruleConfig);
processConfig = new ProcessConfig();
processConfig.setKBase("defaultKieBase");
processConfig.setKSession("defaultKieSession");
processConfig.setMergeMode("MERGE_COLLECTION");
processConfig.setRuntimeStrategy("PER_PROCESS_INSTANCE");
configs.put(Capability.PROCESS, processConfig);
containerSpec = new ContainerSpec();
containerSpec.setId("test container");
containerSpec.setServerTemplateKey(new ServerTemplateKey(serverTemplate.getId(), serverTemplate.getName()));
containerSpec.setReleasedId(new ReleaseId("org.kie", "kie-server-kjar", "1.0"));
containerSpec.setStatus(KieContainerStatus.STOPPED);
containerSpec.setConfigs(configs);
serverTemplate.addContainerSpec(containerSpec);
container = new Container();
container.setServerInstanceId(serverTemplate.getId());
container.setServerTemplateId(serverTemplate.getId());
container.setResolvedReleasedId(containerSpec.getReleasedId());
container.setContainerName(containerSpec.getContainerName());
container.setContainerSpecId(containerSpec.getId());
container.setUrl("http://fake.server.net/kie-server");
}
use of org.kie.server.controller.api.model.spec.ProcessConfig in project kie-wb-common by kiegroup.
the class ContainerProcessConfigPresenterTest method testSetup.
@Test
public void testSetup() {
final ContainerSpecKey containerSpecKey = new ContainerSpecKey("id", "container-name", new ServerTemplateKey("template-id", "template-name"));
final ProcessConfig processConfig = new ProcessConfig(RuntimeStrategy.PER_REQUEST.toString(), "kbase", "ksession", MergeMode.KEEP_ALL.toString());
presenter.setup(containerSpecKey, processConfig);
verify(view).enableActions();
verify(processConfigPresenter).setup(containerSpecKey, processConfig);
verify(processConfigPresenter).setProcessConfig(processConfig);
}
use of org.kie.server.controller.api.model.spec.ProcessConfig in project kie-wb-common by kiegroup.
the class ProcessConfigPresenterTest method testBuildProcessConfig2.
@Test
public void testBuildProcessConfig2() {
when(view.getRuntimeStrategy()).thenReturn(Constants.ClientRuntimeStrategy_PerProcessInstance);
when(view.getKBase()).thenReturn("b");
when(view.getKSession()).thenReturn("c");
when(view.getMergeMode()).thenReturn(Constants.ClientMergeMode_MergeCollections);
final ProcessConfig processConfig = presenter.buildProcessConfig();
assertEquals("PER_PROCESS_INSTANCE", processConfig.getRuntimeStrategy());
assertEquals("b", processConfig.getKBase());
assertEquals("c", processConfig.getKSession());
assertEquals("MERGE_COLLECTIONS", processConfig.getMergeMode());
}
use of org.kie.server.controller.api.model.spec.ProcessConfig in project kie-wb-common by kiegroup.
the class ProcessConfigPresenterTest method testSetup.
@Test
public void testSetup() {
final ContainerSpecKey containerSpecKey = new ContainerSpecKey();
final ProcessConfig processConfig = new ProcessConfig(ClientRuntimeStrategy.PER_CASE.toString(), "kBase", "kSession", ClientMergeMode.KEEP_ALL.toString());
presenter.setup(containerSpecKey, processConfig);
verify(view).setContent(ClientRuntimeStrategy.PER_CASE.getValue(translationService), processConfig.getKBase(), processConfig.getKSession(), ClientMergeMode.convert(processConfig.getMergeMode(), translationService).getValue(translationService));
assertEquals(containerSpecKey, presenter.getContainerSpecKey());
assertEquals(processConfig, presenter.getProcessConfig());
presenter.clear();
assertNull(presenter.getContainerSpecKey());
assertNull(presenter.getProcessConfig());
}
use of org.kie.server.controller.api.model.spec.ProcessConfig in project kie-wb-common by kiegroup.
the class ProcessConfigPresenterTest method testCancel.
@Test
public void testCancel() {
final ProcessConfig processConfig = new ProcessConfig(ClientRuntimeStrategy.PER_CASE.toString(), "kBase", "kSession", ClientMergeMode.OVERRIDE_ALL.toString());
presenter.setProcessConfig(processConfig);
presenter.cancel();
verify(view, times(2)).setContent(ClientRuntimeStrategy.PER_CASE.getValue(translationService), processConfig.getKBase(), processConfig.getKSession(), ClientMergeMode.OVERRIDE_ALL.getValue(translationService));
}
Aggregations