Package com.basho.riak.client.api.cap

Examples of com.basho.riak.client.api.cap.BasicVClock


    @Test
    public void getVClockField()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedFields pojo = new PojoWithAnnotatedFields();
        pojo.vclock = expected;

        assertEquals(expected, AnnotationUtil.getVClock(pojo));
        assertEquals(expected, AnnotationUtil.getVClock(pojo, null));
View Full Code Here


    {
        final byte[] expected = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();   
        final PojoWithAnnotatedByteFields pojo = new PojoWithAnnotatedByteFields();
        pojo.vclock = expected;
       
        assertEquals(new BasicVClock(expected), AnnotationUtil.getVClock(pojo));
        assertEquals(new BasicVClock(expected), AnnotationUtil.getVClock(pojo, null));
       
    }
View Full Code Here

   
    @Test
    public void setVClockField()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedFields pojo = new PojoWithAnnotatedFields();
        AnnotationUtil.setVClock(pojo, expected);
       
        assertNotNull(pojo.vclock);
        assertEquals(expected, pojo.vclock);
View Full Code Here

    @Test
    public void setVClockByteField()
    {
        final byte[] expected = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final PojoWithAnnotatedByteFields pojo = new PojoWithAnnotatedByteFields();
        AnnotationUtil.setVClock(pojo, new BasicVClock(expected));
       
        assertNotNull(pojo.vclock);
        assertArrayEquals(expected, pojo.vclock);
    }
View Full Code Here

   
    @Test
    public void getVClockMethod()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedMethods pojo = new PojoWithAnnotatedMethods();
        pojo.setVClock(expected);
       
        assertEquals(expected, AnnotationUtil.getVClock(pojo));
        assertEquals(expected, AnnotationUtil.getVClock(pojo, null));
View Full Code Here

   
    @Test
    public void getVClockByteMethod()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedByteMethods pojo = new PojoWithAnnotatedByteMethods();
        pojo.setVClock(clockBytes);
       
        assertEquals(expected, AnnotationUtil.getVClock(pojo));
        assertEquals(expected, AnnotationUtil.getVClock(pojo, null));
View Full Code Here

   
    @Test
    public void setVClockMethod()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedMethods pojo = new PojoWithAnnotatedMethods();
        AnnotationUtil.setVClock(pojo, expected);
       
        assertNotNull(pojo.vClock);
        assertEquals(expected, pojo.vClock);
View Full Code Here

   
    @Test
    public void setVClockByteMethod()
    {
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        final PojoWithAnnotatedByteMethods pojo = new PojoWithAnnotatedByteMethods();
        AnnotationUtil.setVClock(pojo, expected);
       
        assertNotNull(pojo.vclock);
        assertArrayEquals(clockBytes, pojo.vclock);
View Full Code Here

            @RiakVClock
            void setVClock(Date key) {}
           
        };
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        AnnotationUtil.setVClock(o, expected);
    }
View Full Code Here

    public void noVClockFieldOrMethod()
    {
        final Object o = new Object();

        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        assertNull(AnnotationUtil.getVClock(o));
        assertNotNull(AnnotationUtil.getVClock(o, expected));
        AnnotationUtil.setVClock(o, expected); // should do nothing
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.api.cap.BasicVClock

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.