testmarshaller.java
来自「OR Mapping工具」· Java 代码 · 共 38 行
JAVA
38 行
package org.ephman.junit;import junit.framework.TestCase;import org.ephman.abra.database.*;import org.ephman.junit.generated.*;import java.sql.*;import java.io.*;import java.util.*;/** a test to try features in the marshaller * @author Paul Bethe */public class TestMarshaller extends DatabaseTest { public TestMarshaller (String name) { super (name); } protected void setUp () throws Exception { super.setUp (); } public void testMarshaller () throws Throwable { // createBadBook (); XMLTest xt = new XMLTest (); xt.setWriter (new Poet ()); marshaller.setWriteRunTimeTypes (true); // for inheritance// String output = marshaller.marshal (xt); System.out.println (output); XMLTest xt_two = (XMLTest)marshaller.unmarshal (new java.io.StringReader(output)); assertTrue ("correct run-time type", xt_two.getWriter () instanceof Poet); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?