Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Bundle-Name: NetCDF MSD Tests
Bundle-SymbolicName: net.openchrom.msd.converter.supplier.cdf.fragment.test
Bundle-Version: 1.6.25.qualifier
Fragment-Host: net.openchrom.msd.converter.supplier.cdf;bundle-version="1.6.13"
Import-Package: org.junit.jupiter.api;version="[6.0.0,7.0.0)"
Import-Package: org.junit.jupiter.api;version="[6.0.0,7.0.0)",
org.junit.jupiter.api.util;version="[6.1.0,7.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.eclipse.chemclipse.xxd.converter.supplier.ocx;bundle-version="0.9.0"
Bundle-Vendor: OpenChrom
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2025 Lablicate GmbH.
* Copyright (c) 2013, 2026 Lablicate GmbH.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -18,34 +18,19 @@
import java.util.Date;
import java.util.TimeZone;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.util.DefaultTimeZone;

@DefaultTimeZone("CET")
@TestInstance(Lifecycle.PER_CLASS)
public class DateSupport_1_Test {

private TimeZone defaultTimeZone;

@BeforeAll
public void setUp() {

defaultTimeZone = TimeZone.getDefault();
}

@AfterAll
public void tearDown() {

TimeZone.setDefault(defaultTimeZone); // restore
}

@Test
public void testGetActualDate_1() {

// 12 Nov 2008 7:41 ! CET > +0100
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date date = new Date(1226472095160l);
assertEquals("20081112074135+0100", DateSupport.getDate(date), "12 Nov 08 7:41");
}
Expand All @@ -55,7 +40,6 @@ public void testGetDate_1() throws ParseException {

// 12 Jan 2006 18:47 ! CET > +0100
String agilentDate = "20060112184700+0100";
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date test = new Date(1137088020000l);
Date date = DateSupport.getDate(agilentDate);
assertEquals(test, date, agilentDate);
Expand All @@ -66,7 +50,6 @@ public void testGetDate_2() throws ParseException {

// 18 Feb 2006 16:18 ! CET > +0100
String agilentDate = "20060218161800+0100";
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date test = new Date(1140275880000l);
Date date = DateSupport.getDate(agilentDate);
assertEquals(test, date, agilentDate);
Expand All @@ -77,7 +60,6 @@ public void testGetDate_3() throws ParseException {

// 3 Mar 2006 14:26 ! CET > +0100
String agilentDate = "20060303142600+0100";
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date test = new Date(1141392360000l);
Date date = DateSupport.getDate(agilentDate);
assertEquals(test, date, agilentDate);
Expand Down Expand Up @@ -165,7 +147,6 @@ public void testGetDate_11() throws ParseException {

// 9 Nov 2008 20:34 ! CET > +0100
String agilentDate = "20081109203400+0100";
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date test = new Date(1226259240000l);
Date date = DateSupport.getDate(agilentDate);
assertEquals(test, date, agilentDate);
Expand All @@ -176,7 +157,6 @@ public void testGetDate_12() throws ParseException {

// 22 Dec 2007 6:51 ! CET > +0100
String agilentDate = "20071222065100+0100";
TimeZone.setDefault(TimeZone.getTimeZone("CET"));
Date test = new Date(1198302660000l);
Date date = DateSupport.getDate(agilentDate);
assertEquals(test, date, agilentDate);
Expand Down