Package com.thoughtworks.xstream.converters

Examples of com.thoughtworks.xstream.converters.SingleValueConverter.canConvert()


*/
public class ToStringConverterTest extends TestCase {

    public void testClaimsCanConvertRightType() throws NoSuchMethodException {
        SingleValueConverter converter = new ToStringConverter(Foo.class);
        assertTrue(converter.canConvert(Foo.class));
    }

    public void testClaimsCantConvertWrongType() throws NoSuchMethodException {
        SingleValueConverter converter = new ToStringConverter(Foo.class);
        assertFalse(converter.canConvert(Map.class));
View Full Code Here


        assertTrue(converter.canConvert(Foo.class));
    }

    public void testClaimsCantConvertWrongType() throws NoSuchMethodException {
        SingleValueConverter converter = new ToStringConverter(Foo.class);
        assertFalse(converter.canConvert(Map.class));
    }

    public void testClaimsCantConvertWrongType2() {
        try {
            new ToStringConverter(Map.class);
View Full Code Here

    public void testCanBeUsedForCustomTypes() {
        Software software = new Software("Joe Walnes", "XStream");
        SingleValueConverter converter = new PropertyEditorCapableConverter(
            SoftwarePropertyEditor.class, Software.class);
        assertTrue(converter.canConvert(Software.class));
        assertEquals("Joe Walnes:XStream", converter.toString(software));
        assertEquals(software, converter.fromString("Joe Walnes:XStream"));
    }

    public void testConcurrentConversion() throws InterruptedException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.