Package info.archinnov.achilles.internal.metadata.holder

Examples of info.archinnov.achilles.internal.metadata.holder.PropertyMeta


    }

    @Test
    public void should_get_state() throws Exception {
        //Given
        PropertyMeta nameMeta = PropertyMetaTestBuilder.completeBean(Void.class, String.class).propertyName("name").accessors().build();
        PropertyMeta counterMeta = PropertyMetaTestBuilder.completeBean(Void.class, Counter.class).propertyName("count").accessors().build();

        when(meta.structure().isClusteredCounter()).thenReturn(true);
        when(meta.getAllCounterMetas()).thenReturn(asList(counterMeta));
        when(meta.getAllMetasExceptCounters()).thenReturn(asList(nameMeta));
View Full Code Here


            }
        }

        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("name"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.getPropertyName()).isEqualTo("name");
        assertThat(meta.<String>getValueClass()).isEqualTo(String.class);

        assertThat(meta.getGetter().getName()).isEqualTo("getName");
        assertThat((Class<String>) meta.getGetter().getReturnType()).isEqualTo(String.class);
        assertThat(meta.getSetter().getName()).isEqualTo("setName");
        assertThat((Class<String>) meta.getSetter().getParameterTypes()[0]).isEqualTo(String.class);

        assertThat(meta.type()).isEqualTo(PropertyType.SIMPLE);

        assertThat(context.getPropertyMetas().get("name")).isSameAs(meta);

    }
View Full Code Here

                this.customId = customId;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("customId"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.getCQL3ColumnName()).isEqualTo("my_custom_id");
    }
View Full Code Here

                this.name = name;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("name"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.getCQL3ColumnName()).isEqualTo("firstname");
    }
View Full Code Here

                this.firstName = name;
            }
        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("firstName"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.getCQL3ColumnName()).isEqualTo("first_name");
    }
View Full Code Here

            }
        }

        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("name"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.structure().isStaticColumn()).isTrue();
    }
View Full Code Here

            }
        }

        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("date"));

        PropertyMeta meta = parser.parse(context);

        assertThat(meta.structure().isTimeUUID()).isTrue();
    }
View Full Code Here

                this.active = active;
            }

        }
        PropertyParsingContext context = newContext(Test.class, Test.class.getDeclaredField("active"));
        PropertyMeta meta = parser.parse(context);

        assertThat(meta.<Boolean>getValueClass()).isEqualTo(boolean.class);
    }
View Full Code Here


    // Simple counter
    @Test
    public void should_bind_for_simple_counter_increment() throws Exception {
        PropertyMeta counterMeta = new PropertyMeta();

        facade.bindForSimpleCounterIncrement(counterMeta, 11L);

        verify(daoContext).bindForSimpleCounterIncrement(context.daoFacade, counterMeta, 11L);
    }
View Full Code Here

    @Test
    public void should_get_cache_for_simple_field() throws Exception {
        EntityMeta meta = new EntityMeta();

        PropertyMeta pm = PropertyMetaTestBuilder.valueClass(String.class)
                .propertyName("name").cqlColumnName("name").type(SIMPLE)
                .build();

        when(context.<CompleteBean>getEntityClass()).thenReturn(CompleteBean.class);
        when(context.getEntityMeta()).thenReturn(meta);
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.internal.metadata.holder.PropertyMeta

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.