`
rogerhunt
  • 浏览: 57697 次
  • 性别: Icon_minigender_1
  • 来自: 新加坡
社区版块
存档分类
最新评论

Basic15TypesTest

阅读更多
/*
* Copyright (C) 2008 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 04. January 2008 by Joerg Schaible
*/
package com.thoughtworks.acceptance;

import java.util.UUID;

public class Basic15TypesTest extends AbstractAcceptanceTest {

    public void testUUID() {
        UUID uuid = UUID.randomUUID();
        assertBothWays(uuid, "<uuid>" + uuid + "</uuid>");
    }

    public void testStringBuilder() {
        StringBuilder builder = new StringBuilder();
        builder.append("woo");
        String xml = xstream.toXML(builder);
        assertEquals(xml, "<string-builder>woo</string-builder>");
        StringBuilder out = (StringBuilder) xstream.fromXML(xml);
        assertEquals("woo", out.toString());
    }
}


http://osdir.com/ml/java.xstream.cvs/2008-01/msg00025.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics