[seam-commits] Seam SVN: r12736 - in modules/international/trunk/impl/src/test: resources/org/jboss/seam/international/test/timezone and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sun May 16 11:22:56 EDT 2010


Author: kenfinni
Date: 2010-05-16 11:22:56 -0400 (Sun, 16 May 2010)
New Revision: 12736

Added:
   modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideFailTest.java
   modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override-fail.xml
   modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override.xml
Removed:
   modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml
Modified:
   modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java
Log:
Improve code coverage for timezone tests

Added: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideFailTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideFailTest.java	                        (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideFailTest.java	2010-05-16 15:22:56 UTC (rev 12736)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.test.timezone;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.test.MockLogger;
+import org.jboss.seam.international.timezone.DefaultTimeZoneProducer;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.joda.time.DateTimeZone;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class DefaultTimeZoneOverrideFailTest
+{
+   @Deployment
+   public static JavaArchive createTestArchive()
+   {
+      return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/timezone/override-fail.xml", ArchivePaths.create("seam-beans.xml"));
+   }
+
+   @Inject
+   DateTimeZone timeZone;
+
+   @Test
+   public void testDefaultTimeZoneProducerDirect()
+   {
+      Assert.assertNotNull(timeZone);
+      Assert.assertNotSame("America/Tijuana", timeZone.getID());
+      Assert.assertEquals(DateTimeZone.getDefault().getID(), timeZone.getID());
+   }
+}

Modified: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java	2010-05-16 14:18:38 UTC (rev 12735)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java	2010-05-16 15:22:56 UTC (rev 12736)
@@ -42,9 +42,7 @@
    @Deployment
    public static JavaArchive createTestArchive()
    {
-      JavaArchive arc = ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/timezone/seam-beans.xml", ArchivePaths.create("seam-beans.xml"));
-      System.out.println(arc.toString(true));
-      return arc;
+      return ShrinkWrap.create("test.jar", JavaArchive.class).addClasses(MockLogger.class, DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml")).addManifestResource("org/jboss/seam/international/test/timezone/override.xml", ArchivePaths.create("seam-beans.xml"));
    }
 
    @Inject

Added: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override-fail.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override-fail.xml	                        (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override-fail.xml	2010-05-16 15:22:56 UTC (rev 12736)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This 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) any later version.
+
+This software 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
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:s="urn:java:seam:core" 
+   xmlns:tz="urn:java:org.jboss.seam.international.timezone"
+   xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee 
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+    <tz:DefaultTimeZoneProducer>
+    	<s:specializes/>
+        <tz:defaultTimeZoneId>America/Tijuanas</tz:defaultTimeZoneId>
+    </tz:DefaultTimeZoneProducer>
+</beans>
\ No newline at end of file

Copied: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override.xml (from rev 12735, modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml)
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override.xml	                        (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/override.xml	2010-05-16 15:22:56 UTC (rev 12736)
@@ -0,0 +1,34 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This 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) any later version.
+
+This software 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
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns:s="urn:java:seam:core" 
+   xmlns:tz="urn:java:org.jboss.seam.international.timezone"
+   xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee 
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+    <tz:DefaultTimeZoneProducer>
+    	<s:specializes/>
+        <tz:defaultTimeZoneId>America/Tijuana</tz:defaultTimeZoneId>
+    </tz:DefaultTimeZoneProducer>
+</beans>
\ No newline at end of file

Deleted: modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml
===================================================================
--- modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml	2010-05-16 14:18:38 UTC (rev 12735)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml	2010-05-16 15:22:56 UTC (rev 12736)
@@ -1,35 +0,0 @@
-<!--
-JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc., and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This 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) any later version.
-
-This software 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
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xmlns:s="urn:java:seam:core" 
-   xmlns:tz="urn:java:org.jboss.seam.international.timezone"
-   xsi:schemaLocation="
-      http://java.sun.com/xml/ns/javaee 
-      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-
-    <tz:DefaultTimeZoneProducer>
-    	<s:specializes/>
-        <tz:defaultTimeZoneId>America/Tijuana</tz:defaultTimeZoneId>
-    </tz:DefaultTimeZoneProducer>
-</beans>
\ No newline at end of file



More information about the seam-commits mailing list