1 package org
.argeo
.slc
.hibernate
.process
;
3 import org
.argeo
.slc
.core
.process
.SlcExecution
;
4 import org
.argeo
.slc
.core
.process
.SlcExecutionStep
;
5 import org
.argeo
.slc
.core
.process
.SlcExecutionTestUtils
;
6 import org
.argeo
.slc
.dao
.process
.SlcExecutionDao
;
7 import org
.argeo
.slc
.unit
.AbstractSpringTestCase
;
9 public class SlcExecutionHibernateTest
extends AbstractSpringTestCase
{
11 public void testSave() {
12 SlcExecutionDao dao
= getBean("slcExecutionDao");
14 SlcExecution slcExec
= SlcExecutionTestUtils
.createSimpleSlcExecution();
15 slcExec
.getSteps().add(new SlcExecutionStep("LOG", "A log line"));
16 slcExec
.getSteps().add(new SlcExecutionStep("LOG", "Two log\nlines"));
20 SlcExecution slcExecPersisted
= dao
.getSlcExecution(slcExec
.getUuid());
21 SlcExecutionTestUtils
.assertSlcExecution(slcExec
, slcExecPersisted
);
22 assertEquals(2, slcExecPersisted
.getSteps().size());
23 SlcExecutionTestUtils
.assertSlcExecutionStep(slcExec
.getSteps().get(0),
24 slcExecPersisted
.getSteps().get(0));
25 SlcExecutionTestUtils
.assertSlcExecutionStep(slcExec
.getSteps().get(1),
26 slcExecPersisted
.getSteps().get(1));
30 protected String
getApplicationContextLocation() {
31 return "org/argeo/slc/hibernate/applicationContext.xml";