annotate src/test/java/de/intevation/lada/test/ServiceTest.java @ 1241:95d04f56266d

Cleanup comments.
author Tom Gottfried <tom@intevation.de>
date Thu, 15 Dec 2016 12:42:20 +0100
parents 59bdb52bac1c
children b652f4c9b75c
rev   line source
849
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
2 * Software engineering by Intevation GmbH
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
3 *
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d0a591b3eade Added missing file header.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 840
diff changeset
7 */
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8 package de.intevation.lada.test;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 import java.io.InputStream;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 import java.io.StringReader;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 import java.net.URL;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 import java.sql.Timestamp;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 import java.util.List;
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
15 import java.util.ArrayList;
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 import java.util.Map.Entry;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 import java.util.Scanner;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 import javax.json.Json;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20 import javax.json.JsonException;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 import javax.json.JsonObject;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 import javax.json.JsonObjectBuilder;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 import javax.json.JsonReader;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 import javax.json.JsonValue;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 import javax.ws.rs.client.Client;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 import javax.ws.rs.client.ClientBuilder;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 import javax.ws.rs.client.Entity;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 import javax.ws.rs.client.WebTarget;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 import javax.ws.rs.core.MediaType;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 import javax.ws.rs.core.Response;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 import org.apache.commons.lang.WordUtils;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 import org.junit.Assert;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
35 import com.vividsolutions.jts.io.ParseException;
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
36 import com.vividsolutions.jts.io.WKTReader;
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
37 import com.vividsolutions.jts.geom.Geometry;
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
38 import com.vividsolutions.jts.geom.Point;
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
39
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 import de.intevation.lada.BaseTest;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 import de.intevation.lada.Protocol;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 import de.intevation.lada.test.land.ProbeTest;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 public class ServiceTest {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
46 private static final String LAT_KEY = "latitude";
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
47 private static final String LONG_KEY = "longitude";
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
48
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 protected List<Protocol> protocol;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 protected List<String> timestampAttributes;
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
52 protected List<String> geomPointAttributes = new ArrayList<String>();
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 protected URL baseUrl;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 public void init(URL baseUrl, List<Protocol> protocol) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 this.baseUrl = baseUrl;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 this.protocol = protocol;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 /**
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 * @return The test protocol
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 public List<Protocol> getProtocol() {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 return protocol;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 protected JsonObject readJsonResource(String resource) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 InputStream stream =
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 ProbeTest.class.getResourceAsStream(resource);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 Scanner scanner = new Scanner(stream, "UTF-8");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 scanner.useDelimiter("\\A");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 String raw = scanner.next();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 scanner.close();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 JsonReader reader = Json.createReader(new StringReader(raw));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 JsonObject content = reader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 reader.close();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 protected JsonObjectBuilder convertObject(JsonObject object) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 JsonObjectBuilder builder = Json.createObjectBuilder();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 for (Entry<String, JsonValue> entry : object.entrySet()) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 String key = WordUtils.capitalize(
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 entry.getKey(), new char[]{'_'}).replaceAll("_","");
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
86 key = key.replaceFirst(
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
87 key.substring(0, 1), key.substring(0, 1).toLowerCase());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 if (timestampAttributes.contains(key)) {
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
89 Timestamp timestamp = Timestamp.valueOf(
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
90 entry.getValue().toString().replaceAll("\"", ""));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 builder.add(key, timestamp.getTime());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 }
1239
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
93 else if (geomPointAttributes.contains(key)) {
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
94 // Convert EWKT to latitude and longitude
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
95 String wkt = entry.getValue().toString().split(";")[1];
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
96 try {
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
97 Geometry geom = new WKTReader().read(wkt);
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
98 if (!(geom instanceof Point)) {
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
99 throw new IllegalArgumentException(
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
100 "WKT does not represent a point");
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
101 }
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
102 Point point = (Point)geom;
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
103 builder.add(LONG_KEY, point.getX());
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
104 builder.add(LAT_KEY, point.getY());
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
105 } catch (ParseException | IllegalArgumentException e) {
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
106 Protocol prot = new Protocol();
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
107 prot.addInfo("exception", e.getMessage());
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
108 protocol.add(prot);
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
109 Assert.fail("Exception while parsing WKT '"
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
110 + wkt + "':\n"
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
111 + e.getMessage());
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
112 }
59bdb52bac1c Test output latitude and longitude against input geometry.
Tom Gottfried <tom@intevation.de>
parents: 1097
diff changeset
113 }
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 else {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 builder.add(key, entry.getValue());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 return builder;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 public JsonObject getAll(String name, String parameter) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 prot.setType("get all");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127 protocol.add(prot);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 /* Create a client*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 Client client = ClientBuilder.newClient();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 WebTarget target = client.target(baseUrl + parameter);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 /* Request all objects*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132 Response response = target.request()
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 .header("X-SHIB-user", BaseTest.TEST_USER)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 .get();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 String entity = response.readEntity(String.class);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 try{
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 JsonReader reader = Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140 JsonObject content = reader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
142 Assert.assertTrue("Unsuccessful response object:\n" + content,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
143 content.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 prot.addInfo("success", content.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 Assert.assertEquals("200", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 prot.addInfo("message", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147 Assert.assertNotNull(content.getJsonArray("data"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148 prot.addInfo("objects", content.getJsonArray("data").size());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
151 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 prot.addInfo("exception", je.getMessage());
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
154 Assert.fail("Exception while parsing '" + entity + "':\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
155 + je.getMessage());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 /**
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 * Test the GET Service by requesting a single object by id.
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 *
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 public JsonObject getById(
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164 String name,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 String parameter,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 JsonObject expected
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 ) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 prot.setType("get by Id");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 protocol.add(prot);
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
174 /* Create a client*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
175 Client client = ClientBuilder.newClient();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
176 WebTarget target = client.target(baseUrl + parameter);
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
177 prot.addInfo("parameter", parameter);
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
178 /* Request a object by id*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
179 Response response = target.request()
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
180 .header("X-SHIB-user", BaseTest.TEST_USER)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
181 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
182 .get();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
183 String entity = response.readEntity(String.class);
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
184 try {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
185 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 JsonReader fromServiceReader =
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
187 Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
188 JsonObject content = fromServiceReader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
189 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
190 Assert.assertTrue("Unsuccessful response object:\n" + content,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
191 content.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
192 prot.addInfo("success", content.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
193 Assert.assertEquals("200", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
194 prot.addInfo("message", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
195 Assert.assertFalse(content.getJsonObject("data").isEmpty());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
196 JsonObject object = content.getJsonObject("data");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
197 for (Entry<String, JsonValue> entry : expected.entrySet()) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
198 if (entry.getKey().equals("parentModified") ||
1097
186d602e031a Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 973
diff changeset
199 entry.getKey().equals("treeModified") ||
186d602e031a Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 973
diff changeset
200 entry.getKey().equals("letzteAenderung")) {
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
201 continue;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
202 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
203 Assert.assertEquals(entry.getValue(), object.get(entry.getKey()));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
204 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
205 prot.addInfo("object", "equals");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
206 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
207 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
208 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
209 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
210 prot.addInfo("exception",je.getMessage());
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
211 Assert.fail("Exception while parsing '" + entity + "':\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
212 + je.getMessage());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
213 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
214 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
215 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
216
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
217 /**
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
218 * Test the GET service using filters.
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
219 *
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
220 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
221 public JsonObject filter(String name, String parameter) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
222 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
223 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
224 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
225 prot.setType("filter");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
226 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
227 protocol.add(prot);
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
228 /* Create a client*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
229 Client client = ClientBuilder.newClient();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
230 WebTarget target =
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
231 client.target(baseUrl + parameter);
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
232 prot.addInfo("filter", parameter);
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
233 /* Request the objects using the filter*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
234 Response response = target.request()
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
235 .header("X-SHIB-user", BaseTest.TEST_USER)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
236 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
237 .get();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
238 String entity = response.readEntity(String.class);
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
239 try {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
240 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
241 JsonReader reader = Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
242 JsonObject content = reader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
243 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
244 Assert.assertTrue("Unsuccessful response object:\n" + content,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
245 content.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
246 prot.addInfo("success", content.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
247 Assert.assertEquals("200", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
248 prot.addInfo("message", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
249 Assert.assertNotNull(content.getJsonArray("data"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
250 prot.addInfo("objects", content.getJsonArray("data").size());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
251 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
252 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
253 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
254 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
255 prot.addInfo("exception", je.getMessage());
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
256 Assert.fail("Exception while parsing '" + entity + "':\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
257 + je.getMessage());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
258 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
259 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
260 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
261
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
262 /**
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
263 * Test the CREATE Service.
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
264 *
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
265 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
266 public JsonObject create(String name, String parameter, JsonObject create) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
267 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
268 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
269 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
270 prot.setType("create");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
271 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
272 protocol.add(prot);
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
273 /* Create a client*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
274 Client client = ClientBuilder.newClient();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
275 WebTarget target = client.target(baseUrl + parameter);
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
276 /* Send a post request containing a new object*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
277 Response response = target.request()
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
278 .header("X-SHIB-user", BaseTest.TEST_USER)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
279 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
280 .post(Entity.entity(create.toString(), MediaType.APPLICATION_JSON));
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
281 String entity = response.readEntity(String.class);
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
282 try {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
283 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
284 JsonReader fromServiceReader =
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
285 Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
286 JsonObject content = fromServiceReader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
287 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
288 Assert.assertTrue("Unsuccessful response object:\n" + content,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
289 content.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
290 prot.addInfo("success", content.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
291 Assert.assertEquals("200", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
292 prot.addInfo("message", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
293 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
294 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
295 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
296 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
297 prot.addInfo("exception", je.getMessage());
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
298 Assert.fail("Exception while parsing '" + entity + "':\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
299 + je.getMessage());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
300 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
301 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
302 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
303
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
304 /**
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
305 * Test an update service.
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
306 *
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
307 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
308 public JsonObject update(
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
309 String name,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
310 String parameter,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
311 String updateAttribute,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
312 String oldValue,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
313 String newValue
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
314 ) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
315 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
316 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
317 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
318 prot.setType("update");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
319 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
320 protocol.add(prot);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
321 try {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
322 /* Create a client*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
323 Client client = ClientBuilder.newClient();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
324 WebTarget target = client.target(baseUrl + parameter);
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
325 /* Request object corresponding to id in URL */
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
326 Response response = target.request()
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
327 .header("X-SHIB-user", BaseTest.TEST_USER)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
328 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
329 .get();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
330 String entity = response.readEntity(String.class);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
331 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
332 JsonReader reader = Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
333 JsonObject oldObject = reader.readObject().getJsonObject("data");
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
334
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
335 /* Value replacement */
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
336 String updatedEntity =
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
337 oldObject.toString().replace(oldValue, newValue);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
338 prot.addInfo("updated datafield", updateAttribute);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
339 prot.addInfo("updated value", oldValue);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
340 prot.addInfo("updated to", newValue);
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
341
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
342 /* Send modified object via put request*/
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
343 WebTarget putTarget = client.target(baseUrl + parameter);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
344 Response updated = putTarget.request()
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
345 .header("X-SHIB-user", BaseTest.TEST_USER)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
346 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
347 .put(Entity.entity(updatedEntity, MediaType.APPLICATION_JSON));
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
348
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
349 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
350 JsonReader updatedReader = Json.createReader(
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
351 new StringReader(updated.readEntity(String.class)));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
352 JsonObject updatedObject = updatedReader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
353 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
354 Assert.assertTrue("Unsuccessful response object:\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
355 + updatedObject,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
356 updatedObject.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
357 prot.addInfo("success", updatedObject.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
358 Assert.assertEquals("200", updatedObject.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
359 prot.addInfo("message", updatedObject.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
360 Assert.assertEquals(newValue,
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
361 updatedObject.getJsonObject("data").getString(updateAttribute));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
362 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
363 return updatedObject;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
364 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
365 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
366 prot.addInfo("exception", je.getMessage());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
367 Assert.fail(je.getMessage());
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
368 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
369 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
370 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
371
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
372 /**
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
373 * Test the DELETE Service.
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
374 *
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
375 */
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
376 public JsonObject delete(String name, String parameter) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
377 System.out.print(".");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
378 Protocol prot = new Protocol();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
379 prot.setName(name + " service");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
380 prot.setType("delete");
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
381 prot.setPassed(false);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
382 protocol.add(prot);
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
383 /* Create a client*/
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
384 Client client = ClientBuilder.newClient();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
385 WebTarget target =
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
386 client.target(baseUrl + parameter);
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
387 prot.addInfo("parameter", parameter);
1241
95d04f56266d Cleanup comments.
Tom Gottfried <tom@intevation.de>
parents: 1239
diff changeset
388 /* Delete object with ID given in URL */
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
389 Response response = target.request()
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
390 .header("X-SHIB-user", BaseTest.TEST_USER)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
391 .header("X-SHIB-roles", BaseTest.TEST_ROLES)
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
392 .delete();
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
393 String entity = response.readEntity(String.class);
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
394 try {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
395 /* Try to parse the response*/
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
396 JsonReader reader = Json.createReader(new StringReader(entity));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
397 JsonObject content = reader.readObject();
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
398 /* Verify the response*/
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
399 Assert.assertTrue("Unsuccessful response object:\n" + content,
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
400 content.getBoolean("success"));
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
401 prot.addInfo("success", content.getBoolean("success"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
402 Assert.assertEquals("200", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
403 prot.addInfo("message", content.getString("message"));
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
404 prot.setPassed(true);
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
405 return content;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
406 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
407 catch(JsonException je) {
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
408 prot.addInfo("exception", je.getMessage());
973
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
409 Assert.fail("Exception while parsing '" + entity + "':\n"
4b5f5e253cab Make tests more verbose on failure.
Tom Gottfried <tom@intevation.de>
parents: 851
diff changeset
410 + je.getMessage());
834
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
411 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
412 return null;
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
413 }
cb1cfc8c81ed Moved base class for tests to package 'test'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
414 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)