01: /*
02: * Copyright (C) 2006, 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 13. February 2006 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.mapper;
12:
13: import com.thoughtworks.acceptance.objects.SampleDynamicProxy;
14: import com.thoughtworks.xstream.core.util.CompositeClassLoader;
15:
16: import junit.framework.TestCase;
17:
18: public class XmlFriendlyMapperTest extends TestCase {
19:
20: private Mapper mapper;
21:
22: public void testPrefixesIllegalXmlElementNamesWithValue() {
23: mapper = new XmlFriendlyMapper(new DefaultMapper(
24: new CompositeClassLoader()));
25: Class proxyCls = SampleDynamicProxy.newInstance().getClass();
26: String aliasedName = mapper.serializedClass(proxyCls);
27: assertTrue("Does not start with 'default-Proxy' : <"
28: + aliasedName + ">", aliasedName
29: .startsWith("default-Proxy"));
30: assertEquals(proxyCls, mapper.realClass(aliasedName));
31: }
32:
33: }
|