01: /*
02: * Copyright (C) 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 07. October 2007 by Guilherme Silveira
10: */
11: package com.thoughtworks.acceptance.annotations;
12:
13: import com.thoughtworks.acceptance.AbstractBuilderAcceptanceTest;
14: import com.thoughtworks.xstream.annotations.XStreamAlias;
15: import com.thoughtworks.xstream.builder.XStreamBuilder;
16:
17: public class XStreamBuilderAnnotationsTest extends
18: AbstractBuilderAcceptanceTest {
19:
20: @XStreamAlias("annotated")
21: public static class Annotated {
22: }
23:
24: public void testHandleCorrectlyAnnotatedClasses() {
25:
26: XStreamBuilder builder = new XStreamBuilder() {
27: {
28: handle(Annotated.class).with(annotated());
29: }
30: };
31:
32: Annotated root = new Annotated();
33: String expected = "<annotated/>";
34:
35: assertBothWays(builder.buildXStream(), root, expected);
36:
37: }
38:
39: }
|