Commit 69bedec9 authored by Uwe Peuker's avatar Uwe Peuker

Testkomponenten wieder integriert

git-svn-id: svn://ntoserver/Datenverteiler/VRZ3/trunk/de.bsvrz.dua.progglaette@62739 40c0be50-5d29-0410-901d-fb59edb5cafc
parent ea80e9c3
......@@ -83,6 +83,14 @@
<artifactId>de.bsvrz.sys.funclib.bitctrl.dua</artifactId>
<version>[1.4.0,)</version>
</dependency>
<dependency>
<groupId>de.bsvrz.dua</groupId>
<artifactId>de.bsvrz.dua.tests</artifactId>
<version>2.0.0</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......@@ -244,6 +252,20 @@
</descriptors>
</configuration>
</execution>
<execution>
<id>swe-test</id>
<goals>
<goal>single</goal>
</goals>
<phase>verify</phase>
<configuration>
<finalName>SWE_${project.artifactId}.tests_${project.status}_V${project.version}_D${project.standDatum}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/test/assembly/swe.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
......
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>swe</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/dist</directory>
<outputDirectory>${project.artifactId}</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/dependencies</directory>
<outputDirectory>${project.artifactId}/lib</outputDirectory>
<includes>
<include>*</include>
</includes>
<excludes>
<exclude>de.bsvrz.*</exclude>
<exclude>com.bitctrl*</exclude>
</excludes>
</fileSet>
</fileSets>
<files>
<!--
<file>
<source>${project.build.directory}/${artifactId}-runtime.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}.jar</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-doc-api-javadoc.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-doc-api.zip</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-doc-design-javadoc.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-doc-design.zip</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-sources.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-src.zip</destName>
</file>
<file>
<source>LICENSE.txt</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-Lizenz.txt</destName>
</file>
-->
<file>
<source>README.txt</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-Build-Report.txt</destName>
<filtered>true</filtered>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-tests.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-test.jar</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-doc-api-test-javadoc.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-test-doc-api.zip</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-doc-design-test-javadoc.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-test-doc-design.zip</destName>
</file>
<file>
<source>${project.build.directory}/${artifactId}-${version}-test-sources.jar</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-test-src.zip</destName>
</file>
<file>
<source>LICENSE.txt</source>
<outputDirectory>${artifactId}</outputDirectory>
<destName>${artifactId}-test-Lizenz.txt</destName>
</file>
</files>
</assembly>
/*
* Copyright 2016 by Kappich Systemberatung Aachen
*
* This file is part of de.bsvrz.dua.progglaette.tests.
*
* de.bsvrz.dua.progglaette.tests is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* de.bsvrz.dua.progglaette.tests is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with de.bsvrz.dua.progglaette.tests. If not, see <http://www.gnu.org/licenses/>.
* Contact Information:
* Kappich Systemberatung
* Martin-Luther-Straße 14
* 52062 Aachen, Germany
* phone: +49 241 4090 436
* mail: <info@kappich.de>
*/
package de.bsvrz.dua.progglaette.tests;
import de.bsvrz.dav.daf.main.ResultData;
import de.bsvrz.dav.daf.main.SendSubscriptionNotConfirmed;
import de.bsvrz.dua.progglaette.progglaette.GlaetteWarnungUndPrognose;
import de.bsvrz.dua.tests.DuATestBase;
import de.bsvrz.sys.funclib.commandLineArgs.ArgumentList;
import org.junit.After;
import org.junit.Before;
/**
* TBD Dokumentation
*
* @author Kappich Systemberatung
*/
public class DuAProgGlaetteTestBase extends DuATestBase {
protected static GlaetteWarnungUndPrognose _glaetteWarnungUndPrognose;
protected String[] getUfdArgs() {
return new String[]{"-KonfigurationsBereichsPid=kb.duaTestUfd"};
}
@Override
protected String[] getConfigurationAreas() {
return new String[]{"kb.duaTestUfd"};
}
@Before
public void setUp() throws Exception {
super.setUp();
_glaetteWarnungUndPrognose = new GlaetteWarnungUndPrognose();
_glaetteWarnungUndPrognose.parseArguments(new ArgumentList(getUfdArgs()));
_glaetteWarnungUndPrognose.initialize(_connection);
}
@After
public void tearDown() throws Exception {
super.tearDown();
}
@Override
public void sendData(final ResultData... resultDatas) throws SendSubscriptionNotConfirmed {
_glaetteWarnungUndPrognose.update(resultDatas);
}
}
package de.bsvrz.dua.progglaette.tests;
public class PackageRuntimeInfo {
public static String getLicence() { return "GPL";}
public static String getRelease() { return "DuA Version 2.0.0";}
public static String getVersion() { return "2.0.0";}
public static String getRevision() { return "861d8fc820b8df226e60bf608bf03b1f31ce60db";}
public static String getCompileTime() { return "31.05.2016 17:14:29";}
public static String getDependsOnCompiled() { return "de.bsvrz.dav.daf, de.bsvrz.dav.dav, de.bsvrz.sys.funclib.commandLineArgs, de.bsvrz.sys.funclib.debug, de.bsvrz.sys.funclib.application, de.bsvrz.sys.funclib.operatingMessage, de.bsvrz.dua.guete, de.bsvrz.sys.funclib.bitctrl.dua, de.bsvrz.sys.funclib.bitctrl, de.bsvrz.dua.progglaette, de.bsvrz.dua.tests";}
public static String getDependsOnSource() { return "";}
public static String getDependsOnLib() { return "";}
public static String getJvmVersion() { return "1.8";}
}
\ No newline at end of file
/*
* Copyright 2016 by Kappich Systemberatung Aachen
*
* This file is part of de.bsvrz.dua.progglaette.tests.
*
* de.bsvrz.dua.progglaette.tests is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* de.bsvrz.dua.progglaette.tests is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with de.bsvrz.dua.progglaette.tests. If not, see <http://www.gnu.org/licenses/>.
* Contact Information:
* Kappich Systemberatung
* Martin-Luther-Straße 14
* 52062 Aachen, Germany
* phone: +49 241 4090 436
* mail: <info@kappich.de>
*/
package de.bsvrz.dua.progglaette.tests;
import de.bsvrz.dav.daf.main.Data;
import de.bsvrz.dav.daf.main.DataDescription;
import de.bsvrz.dav.daf.main.ResultData;
import de.bsvrz.dav.daf.main.config.Aspect;
import de.bsvrz.dav.daf.main.config.AttributeGroup;
import de.bsvrz.dav.daf.main.config.SystemObject;
import de.bsvrz.sys.funclib.bitctrl.dua.DUAKonstanten;
import de.kappich.pat.testumg.util.DavTestUtil;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicLong;
/**
* TBD Dokumentation
*
* @author Kappich Systemberatung
*/
public class TestDuAProgGlaette extends DuAProgGlaetteTestBase {
private SystemObject _tpt;
private SystemObject _fbz;
private SystemObject _lt;
private SystemObject _rlf;
private SystemObject _fbt;
private SystemObject _messstelle;
private AttributeGroup _atgtpt;
private AttributeGroup _atgfbz;
private AttributeGroup _atglt;
private AttributeGroup _atgrlf;
private AttributeGroup _atgfbt;
private Aspect _aspAnalyse;
private AttributeGroup _atgGlaette;
private AttributeGroup _atgtptAna;
private DataDescription _ddGlaette;
private Aspect _aspPrognose;
private static final AtomicLong _timestamp = new AtomicLong(60000);
@Override
@Before
public void setUp() throws Exception {
super.setUp();
_tpt = _dataModel.getObject("ufd.tpt");
_fbz = _dataModel.getObject("ufd.fbz");
_lt = _dataModel.getObject("ufd.lt");
_rlf = _dataModel.getObject("ufd.rlf");
_fbt = _dataModel.getObject("ufd.fbt");
_messstelle = _dataModel.getObject("ufdm.1");
_atgtpt = _dataModel.getAttributeGroup("atg.ufds" + "TaupunktTemperatur");
_atgfbz = _dataModel.getAttributeGroup("atg.ufds" + "FahrBahnOberFlächenZustand");
_atglt = _dataModel.getAttributeGroup("atg.ufds" + "LuftTemperatur");
_atgrlf = _dataModel.getAttributeGroup("atg.ufds" + "RelativeLuftFeuchte");
_atgfbt = _dataModel.getAttributeGroup("atg.ufds" + "FahrBahnOberFlächenTemperatur");
_atgtptAna = _dataModel.getAttributeGroup("atg.ufdmsTaupunktTemperaturFahrBahn");
_atgGlaette = _dataModel.getAttributeGroup("atg.ufdmsGlätte");
_aspAnalyse = _dataModel.getAspect(DUAKonstanten.ASP_ANALYSE);
_aspPrognose = _dataModel.getAspect("asp.prognose");
_ddGlaette = new DataDescription(_atgGlaette, _aspPrognose);
_timestamp.set(60000);
DavTestUtil.startRead(_messstelle, _ddGlaette);
}
@Test
public void testProgGlaette() throws Exception {
expect(null);
sendData(fbt(5.1), lt(2.0), tpt(0.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag möglich");
nextInterval();
sendData(fbt(5.1), lt(2.1), tpt(0.0), fbz("trocken"));
expect("Keine Glättegefahr");
nextInterval();
sendData(fbt(5.0), lt(2.1), tpt(0.0), fbz("trocken"));
expect("Glättegefahr bei Wetteränderung möglich");
nextInterval();
sendData(fbt(3.0), lt(2.1), tpt(0.0), fbz("trocken"));
expect("Glättegefahr bei Wetteränderung möglich");
nextInterval();
sendData(fbt(3.0), lt(2.1), tpt(0.0), fbz("feucht"));
expect("Eisglätte möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt(0.0), fbz("feucht"));
expect("Eisglätte sofort möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt(0.0), fbz("nass"));
expect("Eisglätte sofort möglich");
nextInterval();
sendData(fbt(1.0), lt(2.1), tpt(0.0), fbz("Eis"));
expect("Glätte vorhanden");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt(0.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sofort sowie Reifglätte möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt(-1.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sofort möglich");
nextInterval();
sendData(fbt(-3.0), lt(2.1), tpt(-1.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sowie Reifglätte sofort möglich");
nextInterval();
}
@Test
public void testProgGlaetteTptAnalyse() throws Exception {
expect(null);
sendData(fbt(5.1), lt(2.0), tpt("fehlerhaft"), tptAna(0.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag möglich");
nextInterval();
sendData(fbt(5.1), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("trocken"));
expect("Keine Glättegefahr");
nextInterval();
sendData(fbt(5.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("trocken"));
expect("Glättegefahr bei Wetteränderung möglich");
nextInterval();
sendData(fbt(3.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("trocken"));
expect("Glättegefahr bei Wetteränderung möglich");
nextInterval();
sendData(fbt(3.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("feucht"));
expect("Eisglätte möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("feucht"));
expect("Eisglätte sofort möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("nass"));
expect("Eisglätte sofort möglich");
nextInterval();
sendData(fbt(1.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("Eis"));
expect("Glätte vorhanden");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt("fehlerhaft"), tptAna(0.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sofort sowie Reifglätte möglich");
nextInterval();
sendData(fbt(2.0), lt(2.1), tpt("fehlerhaft"), tptAna(-1.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sofort möglich");
nextInterval();
sendData(fbt(-3.0), lt(2.1), tpt("fehlerhaft"), tptAna(-1.0), fbz("trocken"));
expect("Schneeglätte oder Glatteis bei Niederschlag sowie Reifglätte sofort möglich");
nextInterval();
}
private void expect(final String expected) throws InterruptedException {
ResultData read = DavTestUtil.readData(_messstelle, _ddGlaette);
System.out.println(read.getData());
if(expected == null){
if(read.hasData()){
Assert.fail("Erwartet: Leer, aber war: " + read.getData());
}
}
else {
if(!read.hasData()){
Assert.fail("Erwartet: " + expected + ", aber war leer.");
}
Assert.assertEquals(expected, read.getData().getTextValue("AktuellerZustand").getText());
}
}
private ResultData fbt(final Object value) {
Data data = _connection.createData(_atgfbt);
resetMyData(data);
if(value == null) {
data = null;
}
else {
data.getItem("FahrBahnOberFlächenTemperatur").getTextValue("Wert").setText(value.toString());
}
return new ResultData(_fbt, new DataDescription(_atgfbt, _aspAnalyse), _timestamp.get(), data);
}
private ResultData fbz(final Object value) {
Data data = _connection.createData(_atgfbz);
resetMyData(data);
if(value == null) {
data = null;
}
else {
data.getItem("FahrBahnOberFlächenZustand").getTextValue("Wert").setText(value.toString());
}
return new ResultData(_fbz, new DataDescription(_atgfbz, _aspAnalyse), _timestamp.get(), data);
}
private ResultData lt(final Object value) {
Data data = _connection.createData(_atglt);
resetMyData(data);
if(value == null) {
data = null;
}
else {
data.getItem("LuftTemperatur").getTextValue("Wert").setText(value.toString());
}
return new ResultData(_lt, new DataDescription(_atglt, _aspAnalyse), _timestamp.get(), data);
}
private ResultData tpt(final Object value) {
Data data = _connection.createData(_atgtpt);
resetMyData(data);
if(value == null) {
data = null;
}
else {
data.getItem("TaupunktTemperatur").getTextValue("Wert").setText(value.toString());
}
return new ResultData(_tpt, new DataDescription(_atgtpt, _aspAnalyse), _timestamp.get(), data);
}
private ResultData tptAna(final Object value) {
Data data = _connection.createData(_atgtptAna);
if(value == null) {
data = null;
}
else {
data.getTextValue("TaupunktTemperaturFahrBahn").setText(value.toString());
}
return new ResultData(_tpt, new DataDescription(_atgtptAna, _aspAnalyse), _timestamp.get(), data);
}
private void nextInterval() {
_timestamp.getAndAdd(60000);
}
public void resetMyData(final Data data) {
resetData(data);
data.getTimeValue("T").setMillis(60000);
}
}
<html>
<body>
Implementation der SWE 4.14 <em>Glttewarnung und -prognose</em>.
<h2>Segment 4 Datenbernahme und Aufbereitung, SWE 4.14 Glttewarnung und -prognose</h2>
<p><b>Copyright (C) 2007 BitCtrl Systems GmbH</b></p>
<br>
<p>This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.</p>
<p>This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
<p><u>Contact Information:</u></p>
<p>BitCtrl Systems GmbH<br>
Weienfelser Strae 67<br>
04229 Leipzig<br>
Phone: +49 341-490670<br>
mailto: info@bitctrl.de</p>
<h2>Abh&auml;ngigkeiten</h2>
<p>Folgende Pakete werden von dieser SWE ben&ouml;tigt:</p>
<ul>
<li><code>de.bsvrz.sys.funclib</code></li>
</ul>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment