[Lada-commits] [PATCH 4 of 7] Updated unit tests to fit the new data model

Wald Commits scm-commit at wald.intevation.org
Mon Sep 5 10:20:05 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1472817805 -7200
# Branch schema-update
# Node ID ea550e9a09a3c3a68a367a80753119fdf486b4ba
# Parent  7339dd0f8a670d0564426631882e8b31f25efa5a
Updated unit tests to fit the new data model.

diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/java/de/intevation/lada/StammdatenTest.java
--- a/src/test/java/de/intevation/lada/StammdatenTest.java	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/java/de/intevation/lada/StammdatenTest.java	Fri Sep 02 14:03:25 2016 +0200
@@ -246,7 +246,7 @@
     @Test
     @RunAsClient
     public final void testMessmethodeById(@ArquillianResource URL baseUrl) {
-        stammdatenTest.getById(baseUrl, "messmethode", "GI", testProtocol);
+        stammdatenTest.getById(baseUrl, "messmethode", "A3", testProtocol);
     }
 
     @Test
@@ -282,7 +282,7 @@
     @Test
     @RunAsClient
     public final void testPflichtmessgroesseById(@ArquillianResource URL baseUrl) {
-        stammdatenTest.getById(baseUrl, "pflichtmessgroesse", 33, testProtocol);
+        stammdatenTest.getById(baseUrl, "pflichtmessgroesse", "A3", testProtocol);
     }
 
     @Test
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/java/de/intevation/lada/test/ServiceTest.java
--- a/src/test/java/de/intevation/lada/test/ServiceTest.java	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/java/de/intevation/lada/test/ServiceTest.java	Fri Sep 02 14:03:25 2016 +0200
@@ -164,7 +164,8 @@
             JsonObject object = content.getJsonObject("data");
             for (Entry<String, JsonValue> entry : expected.entrySet()) {
                 if (entry.getKey().equals("parentModified") ||
-                    entry.getKey().equals("treeModified")) {
+                    entry.getKey().equals("treeModified") ||
+                    entry.getKey().equals("letzteAenderung")) {
                     continue;
                 }
                 Assert.assertEquals(entry.getValue(), object.get(entry.getKey()));
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/java/de/intevation/lada/test/stamm/Stammdaten.java
--- a/src/test/java/de/intevation/lada/test/stamm/Stammdaten.java	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/java/de/intevation/lada/test/stamm/Stammdaten.java	Fri Sep 02 14:03:25 2016 +0200
@@ -87,8 +87,7 @@
                 "idfNetzbetreiber",
                 "isBmn",
                 "mailverteiler",
-                "netzbetreiber",
-                "zustMstId"
+                "netzbetreiber"
             )
         );
 
@@ -97,8 +96,8 @@
                 "id",
                 "messgroesseId",
                 "datenbasisId",
-                "mmtId",
-                "umweltId"
+                "messMethodeId",
+                "umwId"
             )
         );
 
@@ -117,7 +116,7 @@
                 "beschreibung",
                 "eudfKeyword",
                 "zusatzwert",
-                "mehId"
+                "messEinheitId"
             )
         );
 
@@ -156,7 +155,7 @@
                 "staat",
                 "staatIso",
                 "staatKurz",
-                "koordinatenartId"
+                "kdaId"
             )
         );
 
@@ -181,7 +180,7 @@
                 "nuts",
                 "plz",
                 "regbezirk",
-                "koordinatenartId"
+                "kdaId"
             )
         );
     }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/META-INF/test-persistence.xml
--- a/src/test/resources/META-INF/test-persistence.xml	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/META-INF/test-persistence.xml	Fri Sep 02 14:03:25 2016 +0200
@@ -2,17 +2,6 @@
 <persistence version="2.1"
    xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
-    <persistence-unit name="bund" transaction-type="JTA">
-        <jta-data-source>java:jboss/lada-bund</jta-data-source>
-        <exclude-unlisted-classes>false</exclude-unlisted-classes>
-        <properties>
-            <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/bund"/>
-            <property name="hibernate.show_sql" value="false" />
-            <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
-            <property name="hibernate.hbm2ddl.auto" value="none"/>
-            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> 
-       </properties>
-   	</persistence-unit>
    	<persistence-unit name="land">
    	    <provider>org.hibernate.ejb.HibernatePersistence</provider>
         <jta-data-source>java:jboss/lada-land</jta-data-source>
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/clean_and_seed.sql
--- a/src/test/resources/datasets/clean_and_seed.sql	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/clean_and_seed.sql	Fri Sep 02 14:03:25 2016 +0200
@@ -27,10 +27,10 @@
 INSERT INTO datenbasis (id) VALUES (9);
 INSERT INTO mess_einheit (id) VALUES (207);
 INSERT INTO messgroesse (id, messgroesse) VALUES (56, 'Mangan');
-INSERT INTO mess_methode (id) VALUES ('GI');
+INSERT INTO mess_methode (id) VALUES ('A3');
 INSERT INTO netz_betreiber (id) VALUES ('06');
 INSERT INTO mess_stelle (id, netzbetreiber_id) VALUES ('06010', '06');
-INSERT INTO pflicht_messgroesse (id, datenbasis_id) VALUES (33, 9);
+INSERT INTO pflicht_messgroesse (id, mmt_id, datenbasis_id) VALUES (33, 'A3', 9);
 INSERT INTO probenart (id, probenart, probenart_eudf_id) VALUES (1, 'E', 'A');
 INSERT INTO proben_zusatz (id, beschreibung, zusatzwert)
        VALUES ('A74', 'Volumenstrom', 'VOLSTR');
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/datensatzerzeuger.json
--- a/src/test/resources/datasets/datensatzerzeuger.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/datensatzerzeuger.json	Fri Sep 02 14:03:25 2016 +0200
@@ -1,5 +1,5 @@
 {
-    "daErzeugerId": "07",
+    "datensatzErzeugerId": "07",
     "letzteAenderung": 1381413048800,
     "mstId": "06010",
     "bezeichnung": "Test 1",
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/dbUnit_datensatzerzeuger.json
--- a/src/test/resources/datasets/dbUnit_datensatzerzeuger.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/dbUnit_datensatzerzeuger.json	Fri Sep 02 14:03:25 2016 +0200
@@ -4,7 +4,6 @@
         "bezeichnung": "Testbezeichnung",
         "netzbetreiber_id": "06",
         "mst_id": "06010",
-        "da_erzeuger_id": "06",
-        "letzte_aenderung": "2015-03-01 12:00:00"
+        "datensatz_erzeuger_id": "06"
     }]
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/dbUnit_messprogramm.json
--- a/src/test/resources/datasets/dbUnit_messprogramm.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/dbUnit_messprogramm.json	Fri Sep 02 14:03:25 2016 +0200
@@ -3,7 +3,6 @@
         "id": 1000,
         "name": "testprogramm",
         "test": false,
-        "netzbetreiber_id": "06",
         "mst_id": "06010",
         "labor_mst_id": "06010",
         "datenbasis_id": 2,
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/dbUnit_messprogrammkategorie.json
--- a/src/test/resources/datasets/dbUnit_messprogrammkategorie.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/dbUnit_messprogrammkategorie.json	Fri Sep 02 14:03:25 2016 +0200
@@ -2,7 +2,7 @@
     "stammdaten.messprogramm_kategorie": [{
         "id": 1000,
         "netzbetreiber_id": "06",
-        "mpl_id": "mp2",
+        "code": "mp2",
         "bezeichnung": "Testbezeichnung",
         "letzte_aenderung": "2015-03-01 12:00:00"
     }]
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/dbUnit_messung.json
--- a/src/test/resources/datasets/dbUnit_messung.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/dbUnit_messung.json	Fri Sep 02 14:03:25 2016 +0200
@@ -3,6 +3,7 @@
         "id": 1200,
         "probe_id": 1000,
         "nebenproben_nr": "T100",
+        "id_alt": 453,
         "mmt_id": "G1",
         "messdauer": 3600,
         "messzeitpunkt": "2012-05-06 14:00:00",
@@ -11,19 +12,13 @@
         "geplant": true,
         "tree_modified": "2012-05-09 12:00:00"
     }],
-    "land.messung_translation": [{
-        "id": 1200,
-        "messungs_id": 1200,
-        "messungs_id_alt": 453
-    }],
     "land.status_protokoll": [{
         "id": 1000,
         "erzeuger": "06010",
         "datum": "2012-05-08 11:00:00",
         "text": "Initialer Status",
         "messungs_id": 1200,
-        "status_stufe": 1,
-        "status_wert": 0,
+        "status_kombi": 1,
         "tree_modified": "2012-05-09 12:00:00"
     }]
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/dbUnit_probe.json
--- a/src/test/resources/datasets/dbUnit_probe.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/dbUnit_probe.json	Fri Sep 02 14:03:25 2016 +0200
@@ -1,6 +1,7 @@
 {
     "land.probe": [{
         "id": 1000,
+        "id_alt": "T001",
         "ba_id": "1",
         "datenbasis_id": 2,
         "letzte_aenderung": "2012-05-05 11:12:00",
@@ -8,7 +9,6 @@
         "media_desk": "D: 59 04 01 00 05 05 01 02 00 00 00 00",
         "mst_id": "06010",
         "labor_mst_id": "06010",
-        "netzbetreiber_id": "06",
         "probeentnahme_beginn": "2012-05-03 13:07:00",
         "probenart_id": 1,
         "test": false,
@@ -20,10 +20,5 @@
         "solldatum_beginn": "2012-05-01 16:00:00",
         "solldatum_ende": "2012-05-05 16:00:00",
         "tree_modified": "2012-05-08 10:00:00"
-    }],
-    "land.probe_translation": [{
-        "id": 1100,
-        "probe_id": 1000,
-        "probe_id_alt": "T001"
     }]
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/messprogramm.json
--- a/src/test/resources/datasets/messprogramm.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/messprogramm.json	Fri Sep 02 14:03:25 2016 +0200
@@ -10,7 +10,6 @@
     "mstId": "06010",
     "laborMstId": "06010",
     "name": "Test 1",
-    "netzbetreiberId": "06",
     "ortId": null,
     "probeKommentar": null,
     "probeNehmerId": null,
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/messprogrammkategorie.json
--- a/src/test/resources/datasets/messprogrammkategorie.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/messprogrammkategorie.json	Fri Sep 02 14:03:25 2016 +0200
@@ -1,5 +1,5 @@
 {
     "bezeichnung": "Testbezeichnung",
     "netzbetreiberId": "06",
-    "mplId": "mp5"
+    "code": "mp5"
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/probe.json
--- a/src/test/resources/datasets/probe.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/probe.json	Fri Sep 02 14:03:25 2016 +0200
@@ -11,7 +11,6 @@
     "mprId":"",
     "mstId":"06010",
     "laborMstId":"06010",
-    "netzbetreiberId":"11",
     "probeNehmerId":3,
     "probenartId":1,
     "test":true,
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/probenehmer.json
--- a/src/test/resources/datasets/probenehmer.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/probenehmer.json	Fri Sep 02 14:03:25 2016 +0200
@@ -11,6 +11,5 @@
     "strasse": "Teststrasse",
     "telefon": "01100011",
     "tp": "kpt",
-    "typ": "a",
-    "letzteAenderung": "2015-03-01T12:00:00"
+    "typ": "a"
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/datasets/status.json
--- a/src/test/resources/datasets/status.json	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/datasets/status.json	Fri Sep 02 14:03:25 2016 +0200
@@ -1,8 +1,7 @@
 {
     "erzeuger": "06010",
     "messungsId": 1200,
-    "statusStufe":1,
-    "statusWert":2,
+    "statusKombi":1,
     "datum": "2012-05-10T09:09:00",
     "text": "Status geändert"
 }
diff -r 7339dd0f8a67 -r ea550e9a09a3 src/test/resources/log4j.properties
--- a/src/test/resources/log4j.properties	Fri Sep 02 14:02:54 2016 +0200
+++ b/src/test/resources/log4j.properties	Fri Sep 02 14:03:25 2016 +0200
@@ -3,7 +3,7 @@
 log4j.logger.org.xnio=WARN
 log4j.logger.org.hibernate=INFO
 log4j.appender.lada=org.apache.log4j.RollingFileAppender
-log4j.appender.lada.File=log/lada-server-test.log
+log4j.appender.lada.File=/var/log/wildfly/lada-server-test.log
 log4j.appender.lada.MaxFileSize=5MB
 log4j.appender.lada.MaxBackupIndex=5
 log4j.appender.lada.layout=org.apache.log4j.PatternLayout


More information about the Lada-commits mailing list