commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r202283 - /jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java
Date Tue, 28 Jun 2005 21:23:51 GMT
Author: rdonkin
Date: Tue Jun 28 14:23:50 2005
New Revision: 202283

URL: http://svn.apache.org/viewcvs?rev=202283&view=rev
Log:
Unit test for bug in RC1

Added:
    jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java

Added: jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java?rev=202283&view=auto
==============================================================================
--- jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java
(added)
+++ jakarta/commons/proper/betwixt/branches/RELEASE_0_7_BRANCH/src/test/org/apache/commons/betwixt/io/TestWriteIDs.java
Tue Jun 28 14:23:50 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */ 
+package org.apache.commons.betwixt.io;
+
+import java.io.StringWriter;
+
+import org.apache.commons.betwixt.AbstractTestCase;
+
+/**
+ */
+public class TestWriteIDs extends AbstractTestCase {
+
+    public TestWriteIDs(String testName) {
+        super(testName);
+    }
+    public void testTest() throws Exception
+    {
+        PersonBean bean = new PersonBean();
+        StringWriter out = new StringWriter();
+        out.write("<?xml version='1.0'?>");
+        BeanWriter beanWriter = new BeanWriter(out);
+        beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(true);
+        beanWriter.getBindingConfiguration().setMapIDs(true);
+        beanWriter.enablePrettyPrint();
+        beanWriter.write("bean", bean);
+        
+        String expected = "<?xml version='1.0'?><bean id='1'/>";
+        xmlAssertIsomorphic(parseString(expected), parseString(out), true);
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message