01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
04: *
05: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
06: * General Public License as published by the Free Software Foundation; either version 2 of the License,
07: * or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with this program; if not,
14: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15: */
16:
17: package wilos.test.business.services.spem2.process;
18:
19: import static org.junit.Assert.assertTrue;
20:
21: import org.junit.After;
22: import org.junit.Before;
23: import org.junit.Test;
24:
25: import wilos.business.services.misc.project.ProjectService;
26: import wilos.business.services.spem2.process.ProcessManagementService;
27: import wilos.model.misc.project.Project;
28: import wilos.model.spem2.process.Process;
29: import wilos.test.TestConfiguration;
30:
31: public class ProcessManagementServiceTest {
32:
33: private ProjectService projectS;
34:
35: private ProcessManagementService pms;
36:
37: private Process process;
38:
39: private Project project;
40:
41: public ProcessManagementServiceTest() {
42: this .projectS = (ProjectService) TestConfiguration
43: .getInstance().getApplicationContext().getBean(
44: "ProjectService");
45: this .pms = (ProcessManagementService) TestConfiguration
46: .getInstance().getApplicationContext().getBean(
47: "ProcessManagementService");
48: }
49:
50: @Before
51: public void setUp() {
52: this .process = new Process();
53: this .process.setName("TestProcess");
54: this .process.setDescription("description test");
55: }
56:
57: @After
58: public void tearDown() {
59: //None.
60: }
61:
62: @Test
63: public void testHasBeenInstanciated() {
64: this .project = new Project();
65: this.projectS.getProjectDao().saveOrUpdateProject(this.project);
66: this.process.addProject(this.project);
67: this.pms.getProcessDao().saveOrUpdateProcess(this.process);
68: assertTrue(this.pms.hasBeenInstanciated(this.process.getId()));
69: this.projectS.getProjectDao().deleteProject(this.project);
70: }
71:
72: }
|