summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-16 09:46:10 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-16 09:46:10 +0000
commit4c52cefcb05233fc4d0f4934f5596110e328af36 (patch)
treeacd3e86abe81faa4397a8d6968d2b21c21885fcd
parentbb804a57102f650ab4da05d7f829e7e12315b18d (diff)
downloadEssentials-4c52cefcb05233fc4d0f4934f5596110e328af36.tar
Essentials-4c52cefcb05233fc4d0f4934f5596110e328af36.tar.gz
Essentials-4c52cefcb05233fc4d0f4934f5596110e328af36.tar.lz
Essentials-4c52cefcb05233fc4d0f4934f5596110e328af36.tar.xz
Essentials-4c52cefcb05233fc4d0f4934f5596110e328af36.zip
More testing
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1501 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/test/com/earth2me/essentials/EconomyTest.java1
-rw-r--r--Essentials/test/com/earth2me/essentials/UtilTest.java26
2 files changed, 27 insertions, 0 deletions
diff --git a/Essentials/test/com/earth2me/essentials/EconomyTest.java b/Essentials/test/com/earth2me/essentials/EconomyTest.java
index 575cff81a..511670cbb 100644
--- a/Essentials/test/com/earth2me/essentials/EconomyTest.java
+++ b/Essentials/test/com/earth2me/essentials/EconomyTest.java
@@ -83,6 +83,7 @@ public class EconomyTest extends TestCase
}
//test Format
+ assertEquals("$1000", Economy.format(1000.0));
assertEquals("$10", Economy.format(10.0));
assertEquals("$10.10", Economy.format(10.10));
assertEquals("$10.10", Economy.format(10.102));
diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java
index 1d51241d6..712d15cfe 100644
--- a/Essentials/test/com/earth2me/essentials/UtilTest.java
+++ b/Essentials/test/com/earth2me/essentials/UtilTest.java
@@ -1,5 +1,7 @@
package com.earth2me.essentials;
+import java.io.File;
+import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import junit.framework.TestCase;
@@ -8,12 +10,28 @@ import junit.framework.TestCase;
public class UtilTest extends TestCase
{
public void testFDDnow() {
+ try
+ {
+ Util.updateLocale("en_US", File.createTempFile("test1", "").getParentFile());
+ }
+ catch (IOException ex)
+ {
+ fail(ex.getMessage());
+ }
Calendar c = new GregorianCalendar();
String resp = Util.formatDateDiff(c, c);
assertEquals(resp, "now");
}
public void testFDDfuture() {
+ try
+ {
+ Util.updateLocale("en_US", File.createTempFile("test2", "").getParentFile());
+ }
+ catch (IOException ex)
+ {
+ fail(ex.getMessage());
+ }
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 10, 0, 1);
@@ -78,6 +96,14 @@ public class UtilTest extends TestCase
}
public void testFDDpast() {
+ try
+ {
+ Util.updateLocale("en_US", File.createTempFile("test3", "").getParentFile());
+ }
+ catch (IOException ex)
+ {
+ fail(ex.getMessage());
+ }
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 9, 59, 59);