Commit 3922fa97 authored by Uwe Peuker's avatar Uwe Peuker

Zeittest unabhängig von lokaler Systemzeit

parent 39de9d01
File mode changed from 100755 to 100644
<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>
</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>
</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>
/*
* Segment 2 (KEx), SWE LMS-TIC3
* Copyright (C) 2016 BitCtrl Systems GmbH
*
* Copyright (C) 2016 BitCtrl Systems GmbH
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
......@@ -31,6 +31,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Test;
......@@ -90,7 +92,10 @@ public class ZeitTest {
cal.setTimeInMillis(zeit);
final DateFormat formatter = new SimpleDateFormat();
System.out.println("Systemzeit: " + formatter.format(cal.getTime()));
Assert.assertEquals(cal.get(Calendar.HOUR), 10);
int offset = TimeZone.getDefault().getOffset(cal.get(Calendar.YEAR / 100), cal.get(Calendar.YEAR % 100), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.DAY_OF_WEEK), 0);
Assert.assertEquals(cal.get(Calendar.HOUR), 8 + TimeUnit.MILLISECONDS.toHours(offset));
} catch (final ParseException e) {
e.printStackTrace();
Assert.fail();
......
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