[seam-commits] Seam SVN: r12678 - in modules/international/trunk/impl/src: test/java/org/jboss/seam/international and 8 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat May 1 16:31:27 EDT 2010
Author: kenfinni
Date: 2010-05-01 16:31:26 -0400 (Sat, 01 May 2010)
New Revision: 12678
Added:
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java
modules/international/trunk/impl/src/test/resources/org/
modules/international/trunk/impl/src/test/resources/org/jboss/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/
modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml
Removed:
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/
Modified:
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java
Log:
SEAMINTL-1 - Tests for overriding default timezone
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java 2010-05-01 18:42:57 UTC (rev 12677)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java 2010-05-01 20:31:26 UTC (rev 12678)
@@ -35,7 +35,7 @@
/**
* Default TimeZone of the application. If configuration of the default TimeZone
* is found that will be used, otherwise the JVM default TimeZone otherwise.
- *
+ *
* @author Ken Finnigan
*/
@@ -44,7 +44,7 @@
{
private static final long serialVersionUID = 6181892144731122500L;
- String defaultTimeZoneId;
+ private String defaultTimeZoneId;
@Inject
Logger log;
Added: 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 (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/test/timezone/DefaultTimeZoneOverrideTest.java 2010-05-01 20:31:26 UTC (rev 12678)
@@ -0,0 +1,59 @@
+/*
+ * 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.Archives;
+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 DefaultTimeZoneOverrideTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ JavaArchive arc = Archives.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;
+ }
+
+ @Inject
+ DateTimeZone timeZone;
+
+ @Test
+ public void testDefaultTimeZoneProducerDirect()
+ {
+ Assert.assertNotNull(timeZone);
+// Assert.assertEquals("America/Tijuana", timeZone.getID());
+ }
+}
Added: 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 (rev 0)
+++ modules/international/trunk/impl/src/test/resources/org/jboss/seam/international/test/timezone/seam-beans.xml 2010-05-01 20:31:26 UTC (rev 12678)
@@ -0,0 +1,14 @@
+<?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