annotate src/test/java/de/intevation/lada/LandTest.java @ 1076:4ce4bd48c260

Avoid repeating potentially lengthy download of shapefiles.
author Tom Gottfried <tom@intevation.de>
date Fri, 30 Sep 2016 18:32:48 +0200
parents 7a6985fbb3c8
children 1c41c7b8f7c2
rev   line source
832
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8 package de.intevation.lada;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 import java.net.URL;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 import java.util.ArrayList;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 import javax.inject.Inject;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 import javax.persistence.EntityManager;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 import javax.persistence.PersistenceContext;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 import org.apache.log4j.Logger;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 import org.jboss.arquillian.container.test.api.RunAsClient;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 import org.jboss.arquillian.junit.Arquillian;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 import org.jboss.arquillian.junit.InSequence;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 import org.jboss.arquillian.persistence.Cleanup;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 import org.jboss.arquillian.persistence.CleanupUsingScript;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 import org.jboss.arquillian.persistence.DataSource;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 import org.jboss.arquillian.persistence.TestExecutionPhase;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 import org.jboss.arquillian.persistence.UsingDataSet;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 import org.jboss.arquillian.test.api.ArquillianResource;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 import org.junit.Assert;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 import org.junit.BeforeClass;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 import org.junit.Test;
979
7a6985fbb3c8 Deactivate tests for validators and land-interfaces.
Tom Gottfried <tom@intevation.de>
parents: 832
diff changeset
30 import org.junit.Ignore;
832
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 import org.junit.runner.RunWith;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 import de.intevation.lada.model.land.LKommentarM;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 import de.intevation.lada.model.land.LKommentarP;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 import de.intevation.lada.model.land.LMessung;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 import de.intevation.lada.model.land.LMesswert;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 import de.intevation.lada.model.land.LOrtszuordnung;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 import de.intevation.lada.model.land.LProbe;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 import de.intevation.lada.model.land.LZusatzWert;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 import de.intevation.lada.model.land.Messprogramm;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 import de.intevation.lada.test.land.KommentarMTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 import de.intevation.lada.test.land.KommentarPTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 import de.intevation.lada.test.land.MessprogrammTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 import de.intevation.lada.test.land.MessungTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 import de.intevation.lada.test.land.MesswertTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 import de.intevation.lada.test.land.OrtszuordnungTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 import de.intevation.lada.test.land.ProbeTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 import de.intevation.lada.test.land.QueryTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 import de.intevation.lada.test.land.StatusTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 import de.intevation.lada.test.land.ZusatzwertTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 * Class to test the Lada server 'land' services.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 *
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 @RunWith(Arquillian.class)
979
7a6985fbb3c8 Deactivate tests for validators and land-interfaces.
Tom Gottfried <tom@intevation.de>
parents: 832
diff changeset
59 @Ignore
7a6985fbb3c8 Deactivate tests for validators and land-interfaces.
Tom Gottfried <tom@intevation.de>
parents: 832
diff changeset
60 // TODO: make tests independent of test data which do not exist anymore
832
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 public class LandTest extends BaseTest {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 @Inject
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 Logger internalLogger;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 @PersistenceContext(unitName="land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 EntityManager em;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 private ProbeTest probeTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 private MessungTest messungTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 private KommentarMTest mkommentarTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 private KommentarPTest pkommentarTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 private OrtszuordnungTest ortszuordnungTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 private ZusatzwertTest zusatzwertTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 private MesswertTest messwertTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 private StatusTest statusTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 private MessprogrammTest messprogrammTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 private QueryTest queryTest;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 public LandTest() {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 probeTest = new ProbeTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 messungTest = new MessungTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 mkommentarTest = new KommentarMTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 pkommentarTest = new KommentarPTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 ortszuordnungTest = new OrtszuordnungTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 zusatzwertTest = new ZusatzwertTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 messwertTest = new MesswertTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 statusTest = new StatusTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 messprogrammTest = new MessprogrammTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 queryTest = new QueryTest();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 testProtocol = new ArrayList<Protocol>();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 verboseLogging = false;
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 @BeforeClass
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 public static void beforeTests() {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 /*------ REST service tests ------*/
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 * Tests for probe operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 @InSequence(2)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 public final void testProbe(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 probeTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 probeTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 * Tests for pkommentar operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 @InSequence(4)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 public final void testPkommentar(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 pkommentarTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 pkommentarTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 * Tests for ortszurodnung operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 @InSequence(6)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 public final void testOrtszuordnung(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 ortszuordnungTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 ortszuordnungTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 * Tests for zustzwert operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 @InSequence(8)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 public final void testZusatzwert(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 zusatzwertTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 zusatzwertTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 * Tests for messung operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
151 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 @InSequence(10)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154 public final void testMessung(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 messungTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 messungTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 * Tests for mkommentar operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 @InSequence(12)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 public final void testMkommentar(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 mkommentarTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 mkommentarTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 * Tests for mkommentar operations
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
174 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
175 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 @InSequence(14)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178 public final void testMesswert(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
180 messwertTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
181 messwertTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
182 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
183
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
184 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
185 @InSequence(16)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
187 public final void testStatus(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
188 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
189 statusTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
190 statusTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
191 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
192
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
193 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
194 @InSequence(18)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
195 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
196 public final void testMessprogramm(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
197 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
198 messprogrammTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
199 messprogrammTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
200 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
201
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
202 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
203 @InSequence(20)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
204 @RunAsClient
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
205 public final void testQuery(@ArquillianResource URL baseUrl)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
206 throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
207 queryTest.init(baseUrl, testProtocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
208 queryTest.execute();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
209 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
210
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
211 /*------ Database operations ------*/
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
212
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
213 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
214 * Insert a probe object into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
215 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
216 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
217 @InSequence(1)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
218 @UsingDataSet("datasets/dbUnit_probe.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
219 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
220 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
221 public final void prepareDatabaseProbe() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
222 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
223 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
224 protocol.setType("insert probe");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
225 protocol.addInfo("database", "Insert Probe into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
226 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
227 LProbe probe = em.find(LProbe.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
228 Assert.assertNotNull(probe);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
229 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
230 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
231
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
232 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
233 * Insert a probe kommentar into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
234 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
235 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
236 @InSequence(3)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
237 @UsingDataSet("datasets/dbUnit_pkommentar.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
238 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
239 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
240 public final void prepareDatabaseKommentarP() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
241 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
242 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
243 protocol.setType("insert kommentar_p");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
244 protocol.addInfo("database", "Insert KommentarP into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
245 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
246 LKommentarP kommentar = em.find(LKommentarP.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
247 Assert.assertNotNull(kommentar);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
248 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
249 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
250
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
251 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
252 * Insert a ortszuordnung into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
253 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
254 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
255 @InSequence(5)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
256 @UsingDataSet("datasets/dbUnit_ortszuordnung.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
257 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
258 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
259 public final void prepareDatabaseOrtszuordnung() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
260 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
261 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
262 protocol.setType("insert ortszuordnung");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
263 protocol.addInfo("database", "Insert Ortszuordnung into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
264 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
265 LOrtszuordnung ortszuordnung = em.find(LOrtszuordnung.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
266 Assert.assertNotNull(ortszuordnung);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
267 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
268 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
269
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
270 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
271 * Insert a zusatzwert into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
272 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
273 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
274 @InSequence(7)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
275 @UsingDataSet("datasets/dbUnit_zusatzwert.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
276 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
277 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
278 public final void prepareDatabaseZusatzwert() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
279 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
280 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
281 protocol.setType("insert zusatzwert");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
282 protocol.addInfo("database", "Insert Zusatzwert into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
283 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
284 LZusatzWert zusatzwert = em.find(LZusatzWert.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
285 Assert.assertNotNull(zusatzwert);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
286 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
287 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
288
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
289 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
290 * Insert a messung object into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
291 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
292 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
293 @InSequence(9)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
294 @UsingDataSet("datasets/dbUnit_messung.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
295 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
296 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
297 public final void prepareDatabaseMessung() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
298 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
299 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
300 protocol.setType("insert messung");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
301 protocol.addInfo("database", "Insert Messung into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
302 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
303 LMessung messung = em.find(LMessung.class, 1200);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
304 messung.setStatus(1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
305 em.merge(messung);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
306 Assert.assertNotNull(messung);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
307 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
308 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
309
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
310 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
311 * Insert a messungs kommentar into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
312 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
313 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
314 @InSequence(11)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
315 @UsingDataSet("datasets/dbUnit_mkommentar.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
316 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
317 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
318 public final void prepareDatabaseKommentarM() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
319 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
320 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
321 protocol.setType("insert kommentar_m");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
322 protocol.addInfo("database", "Insert KommentarM into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
323 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
324 LKommentarM kommentar = em.find(LKommentarM.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
325 Assert.assertNotNull(kommentar);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
326 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
327 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
328
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
329 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
330 * Insert a messwert into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
331 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
332 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
333 @InSequence(13)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
334 @UsingDataSet("datasets/dbUnit_messwert.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
335 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
336 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
337 public final void prepareDatabaseMesswert() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
338 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
339 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
340 protocol.setType("insert messwert");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
341 protocol.addInfo("database", "Insert Messwert into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
342 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
343 LMesswert messwert = em.find(LMesswert.class, 10000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
344 Assert.assertNotNull(messwert);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
345 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
346 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
347
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
348 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
349 * Insert a messprogramm into the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
350 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
351 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
352 @InSequence(17)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
353 @UsingDataSet("datasets/dbUnit_messprogramm.json")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
354 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
355 @Cleanup(phase=TestExecutionPhase.NONE)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
356 public final void prepareDatabaseMessprogramm() throws Exception {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
357 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
358 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
359 protocol.setType("insert messprogramm");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
360 protocol.addInfo("database", "Insert Messprogramm into database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
361 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
362 Messprogramm messprogramm = em.find(Messprogramm.class, 1000);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
363 Assert.assertNotNull(messprogramm);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
364 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
365 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
366 /**
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
367 * Cleanup the database.
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
368 */
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
369 @Test
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
370 @InSequence(19)
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
371 @DataSource("java:jboss/lada-land")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
372 @CleanupUsingScript("datasets/cleanup.sql")
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
373 public final void cleanUp() {
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
374 Protocol protocol = new Protocol();
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
375 protocol.addInfo("database", "Cleaning the database.");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
376 protocol.setName("database");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
377 protocol.setType("cleanup");
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
378 protocol.setPassed(true);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
379 testProtocol.add(protocol);
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
380 }
59c51da59b30 Refactored test environment.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
381 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)