[jboss-svn-commits] JBoss Common SVN: r2351 - in jbossxb/branches/1_0: src/main/java/org/jboss/xb/binding and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Apr 3 06:29:23 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-04-03 06:29:23 -0400 (Tue, 03 Apr 2007)
New Revision: 2351
Modified:
jbossxb/branches/1_0/pom.xml
jbossxb/branches/1_0/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java
jbossxb/branches/1_0/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java
Log:
JBXB-99
Modified: jbossxb/branches/1_0/pom.xml
===================================================================
--- jbossxb/branches/1_0/pom.xml 2007-04-03 10:07:57 UTC (rev 2350)
+++ jbossxb/branches/1_0/pom.xml 2007-04-03 10:29:23 UTC (rev 2351)
@@ -1,5 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>1</version>
+ </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>jboss.jbossxb</groupId>
<artifactId>jbossxb</artifactId>
@@ -30,93 +35,38 @@
</snapshots>
</repository>
</repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>jbosspluginrepo</id>
- <name>jboss plugin repository</name>
- <url>http://repository.jboss.com/maven2</url>
- <layout>default</layout>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>central</id>
- <name>LSU maven2 mirror</name>
- <url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>
- <layout>default</layout>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
<build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <plugins>
-
+ <finalName>jboss-xml-binding</finalName>
+ <plugins>
<!-- define how we want compilation to take place
- here, we accept most of the defaults but say that we want the
- optimization flag set, and define the source and target to be 1.4,
- these setting will be inherited by child projects -->
+ here, we accept most of the defaults but say that we want the
+ optimization flag set, and define the source and target to be 1.4,
+ these setting will be inherited by child projects -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
- <configuration>
- <optimize>true</optimize>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
+ <configuration>
+ <optimize>true</optimize>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
</plugin>
-
- <!-- define that we wish to create src jars -->
<plugin>
- <artifactId>maven-source-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- describe the jarring process -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
+ <artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <jarName>jboss-xml-binding</jarName>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>true</testFailureIgnore>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode> <!-- required to correctly run the PojoServer tests -->
</configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>true</testFailureIgnore>
- <includes>
- <include>**/**TestCase.java</include>
- </includes>
- <forkMode>pertest</forkMode> <!-- required to correctly run the PojoServer tests -->
- </configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
</plugins>
</build>
@@ -181,6 +131,12 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+ <distributionManagement>
+ <repository>
+ <id>cvs-file-repository</id>
+ <!-- Set maven.cvs.root in your settings.xml -->
+ <url>file://${maven.cvs.root}</url>
+ </repository>
+ </distributionManagement>
</project>
Modified: jbossxb/branches/1_0/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java
===================================================================
--- jbossxb/branches/1_0/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java 2007-04-03 10:07:57 UTC (rev 2350)
+++ jbossxb/branches/1_0/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java 2007-04-03 10:29:23 UTC (rev 2351)
@@ -1722,7 +1722,7 @@
*/
public static String marshalDate(Calendar value)
{
- String result = String.valueOf(value.get(Calendar.YEAR));
+ String result = marshalInt(value.get(Calendar.YEAR), 4);
result += '-';
result += marshalInt(value.get(Calendar.MONTH) + 1, 2);
result += '-';
Modified: jbossxb/branches/1_0/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java
===================================================================
--- jbossxb/branches/1_0/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java 2007-04-03 10:07:57 UTC (rev 2350)
+++ jbossxb/branches/1_0/src/test/java/org/jboss/test/xml/SimpleTypeBindingUnitTestCase.java 2007-04-03 10:29:23 UTC (rev 2351)
@@ -28,10 +28,12 @@
import javax.xml.namespace.QName;
import javax.xml.namespace.NamespaceContext;
import java.util.Calendar;
+import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
+import java.util.TimeZone;
import java.math.BigInteger;
import java.math.BigDecimal;
import java.net.URI;
@@ -393,6 +395,14 @@
assertEquals(0, cal.get(Calendar.MILLISECOND));
}
+ public void testDateMarshalling() throws Exception
+ {
+ Calendar c = new GregorianCalendar(6,5,1,10,0,0);
+ c.setTimeZone(TimeZone.getTimeZone("GMT"));
+ String marshalled = SimpleTypeBindings.marshalDate(c);
+ assertEquals("0006-06-01Z", marshalled);
+ }
+
public void testHexBinary() throws Exception
{
String s = "kloop";
More information about the jboss-svn-commits
mailing list