Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsliebig2008-04-09 03:25:04 -0400
committersliebig2008-04-09 03:25:04 -0400
commit7a4e503ce87842c7ed2f0164b0f408a6d9d757e9 (patch)
tree05a9a780bb84e90788b988c17c8e18c4da23c21c /bundles/org.eclipse.equinox.p2.tests.optimizers
parent94f8ebf6cbea79476505aea508d88df420077f94 (diff)
downloadrt.equinox.p2-7a4e503ce87842c7ed2f0164b0f408a6d9d757e9.tar.gz
rt.equinox.p2-7a4e503ce87842c7ed2f0164b0f408a6d9d757e9.tar.xz
rt.equinox.p2-7a4e503ce87842c7ed2f0164b0f408a6d9d757e9.zip
added time test
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.optimizers')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/AllTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/SarEntryTest.java25
2 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/AllTests.java b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/AllTests.java
index af49c8c26..a7a0b4905 100644
--- a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/AllTests.java
@@ -21,6 +21,7 @@ public class AllTests extends TestCase {
TestSuite suite = new TestSuite(AllTests.class.getName());
suite.addTestSuite(DirectByteArrayOutputStreamTest.class);
suite.addTestSuite(SarTest.class);
+ suite.addTestSuite(SarEntryTest.class);
return suite;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/SarEntryTest.java b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/SarEntryTest.java
new file mode 100644
index 000000000..192243298
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests.optimizers/src/org/eclipse/equinox/p2/tests/sar/SarEntryTest.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG (Stefan Liebig) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.sar;
+
+import junit.framework.TestCase;
+import org.eclipse.equinox.internal.p2.sar.SarEntry;
+
+public class SarEntryTest extends TestCase {
+
+ public void testJavaToDosTimeAndBack() {
+ final long minute = 1000l * 60l;
+ long now = (System.currentTimeMillis() / minute) * minute;
+ long dos = SarEntry.javaToDosTime(now);
+ assertEquals(now, SarEntry.dosToJavaTime(dos));
+ }
+
+}

Back to the top