Package com.basho.riak.client.core.query.UserMetadata

Examples of com.basho.riak.client.core.query.UserMetadata.RiakUserMetadata


    public synchronized RiakUserMetadata getUserMeta()
    {
        // Lazy initialization of container.
        if (null == userMeta)
        {
            userMeta = new RiakUserMetadata();
        }
       
        return userMeta;
    }
View Full Code Here


          
        PojoWithAnnotatedFields obj = new PojoWithAnnotatedFields();
        obj.usermeta = userMetaData;
        obj.metaItemOne = userMetaItemOne;
       
        RiakUserMetadata meta = new RiakUserMetadata();
        AnnotationUtil.getUsermetaData(meta, obj);
               
        for (String key : userMetaData.keySet())
        {
            assertTrue(meta.containsKey(key));
            assertEquals(meta.get(key), userMetaData.get(key));
        }
       
        assertTrue(meta.containsKey(META_KEY_ONE));
        assertEquals(userMetaItemOne, meta.get(META_KEY_ONE));
    }
View Full Code Here

          
        PojoWithAnnotatedMethods obj = new PojoWithAnnotatedMethods();
        obj.setUsermeta(userMetaData);
        obj.setMetaItemOne(userMetaItemOne);
       
        RiakUserMetadata meta = new RiakUserMetadata();
        AnnotationUtil.getUsermetaData(meta, obj);       
               
        for (String key : userMetaData.keySet())
        {
            assertTrue(meta.containsKey(key));
            assertEquals(meta.get(key), userMetaData.get(key));
        }
       
        assertTrue(meta.containsKey(META_KEY_ONE));
        assertEquals(userMetaItemOne, meta.get(META_KEY_ONE));
    }
View Full Code Here

    }
   
    @Test
    public void setUserMetaField()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
        meta.put("key1", "value1");
        meta.put("key2", "value2");
        meta.put("key3", "value3");
        meta.put(META_KEY_ONE, "userMetaItemOne");
       
        PojoWithAnnotatedFields obj = new PojoWithAnnotatedFields();
        AnnotationUtil.populateUsermeta(meta, obj);
       
        assertNotNull(obj.usermeta);
        // The single annotated field is removed
        assertEquals(3, obj.usermeta.size());
       
        for (String key : obj.usermeta.keySet())
        {
            assertTrue(meta.containsKey(key));
            assertEquals(meta.get(key), obj.usermeta.get(key));
        }
       
        assertNotNull(obj.metaItemOne);
        assertEquals("userMetaItemOne", obj.metaItemOne);
       
View Full Code Here

    }
   
    @Test
    public void setUserMetaMethod()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
        meta.put("key1", "value1");
        meta.put("key2", "value2");
        meta.put("key3", "value3");
        meta.put(META_KEY_ONE, "userMetaItemOne");
       
        PojoWithAnnotatedMethods obj = new PojoWithAnnotatedMethods();
        AnnotationUtil.populateUsermeta(meta, obj);
       
        assertNotNull(obj.usermeta);
        // The single annotated field is removed
        assertEquals(3, obj.usermeta.size());
       
        for (String key : obj.usermeta.keySet())
        {
            assertTrue(meta.containsKey(key));
            assertEquals(meta.get(key), obj.usermeta.get(key));
        }
       
        assertNotNull(obj.metaItemOne);
        assertEquals("userMetaItemOne", obj.metaItemOne);
       
View Full Code Here

    }
   
    @Test
    public void illegalUserMetaFieldType()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
       
        Object o = new Object() {
            @RiakUsermeta
            Boolean meta;
        };
View Full Code Here

    }
   
    @Test
    public void illegalUserMetaGetterType()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
       
        Object o = new Object() {
            @RiakUsermeta
            public Boolean getMeta()
            {
View Full Code Here

    }
   
    @Test
    public void illegalUserMetaSetterType()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
       
        Object o = new Object() {
            @RiakUsermeta
            public Map<String,String> getMeta()
            {
View Full Code Here

   
   
    @Test
    public void singleMetaAnnotationMissingKey()
    {
        RiakUserMetadata meta = new RiakUserMetadata();
       
        Object o = new Object() {
            @RiakUsermeta
            String meta;
        };
View Full Code Here

   
    @Test
    public void annotatedMetaFieldIsNull()
    {
        PojoWithAnnotatedFields pojo = new PojoWithAnnotatedFields();
        RiakUserMetadata meta = new RiakUserMetadata();
        AnnotationUtil.getUsermetaData(meta, pojo);
       
        assertTrue(meta.isEmpty());
       
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.UserMetadata.RiakUserMetadata

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.