Package com.basho.riak.client.api.convert

Examples of com.basho.riak.client.api.convert.ConverterFactory


{
   
    @Before
    public void setup()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        factory.unregisterConverterForClass(Pojo.class);
        //factory.setDefaultConverter(JSONConverter.class);
    }
View Full Code Here


    }
   
    @Test
    public void getDefaultConverter()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        //TypeReference tr = new TypeReference<Pojo>(){};
        Converter<Pojo> converter = factory.getConverter(Pojo.class);
       
        assertTrue(converter instanceof JSONConverter);
   
        Pojo pojo = new Pojo();
        pojo.foo = "foo_value";
View Full Code Here

    }
   
    @Test
    public void stringConverter()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        Converter<String> converter = factory.getConverter(String.class);
       
        assertTrue(converter instanceof StringConverter);
    }
View Full Code Here

    }
   
    @Test
    public void riakObjectConverter()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        Converter<RiakObject> converter = factory.getConverter(RiakObject.class);
       
        assertTrue(converter instanceof PassThroughConverter);
       
        RiakObject o = new RiakObject();
       
View Full Code Here

    }
    
    @Test
    public void registerConverterClass()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        factory.registerConverterForClass(Pojo.class, new MyConverter());
       
        Converter<Pojo> converter = factory.getConverter(Pojo.class);
       
        assertTrue(converter instanceof MyConverter);
       
    }
View Full Code Here

    }
   
    @Test
    public void registerConverterInstance()
    {
        ConverterFactory factory = ConverterFactory.getInstance();
        MyConverter converter = new MyConverter();
        factory.registerConverterForClass(Pojo.class, converter);
       
        Converter<Pojo> converter2 = factory.getConverter(Pojo.class);
        assertTrue(converter2 instanceof MyConverter);
        assertEquals(converter, converter2);
       
       
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.api.convert.ConverterFactory

Copyright © 2018 www.massapicom. 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.