Package info.archinnov.achilles.test.integration.entity

Examples of info.archinnov.achilles.test.integration.entity.EntityWithEnumeratedConfig


        //Given
        Long id = RandomUtils.nextLong(0,Long.MAX_VALUE);
        final List<ElementType> elementTypes = asList(FIELD, METHOD);
        final ImmutableMap<RetentionPolicy, ElementType> retentionPolicies = ImmutableMap.of(SOURCE, ANNOTATION_TYPE, RUNTIME, CONSTRUCTOR);

        manager.insert(new EntityWithEnumeratedConfig(id, ConsistencyLevel.LOCAL_ONE, elementTypes, retentionPolicies));

        final EntityWithEnumeratedConfig found = manager.find(EntityWithEnumeratedConfig.class, id);
        assertThat(found.getConsistencyLevel()).isEqualTo(ConsistencyLevel.LOCAL_ONE);
        assertThat(found.getElementTypes()).containsExactly(FIELD, METHOD);
        assertThat(found.getRetentionPolicies()).contains(entry(SOURCE, ANNOTATION_TYPE), entry(RUNTIME, CONSTRUCTOR));
    }
View Full Code Here


        //Given
        Long id = RandomUtils.nextLong(0,Long.MAX_VALUE);
        final List<ElementType> elementTypes = asList(FIELD, METHOD);
        final ImmutableMap<RetentionPolicy, ElementType> retentionPolicies = ImmutableMap.of(SOURCE, ANNOTATION_TYPE, RUNTIME, CONSTRUCTOR);

        manager.insert(new EntityWithEnumeratedConfig(id, ConsistencyLevel.LOCAL_ONE, elementTypes, retentionPolicies));

        //When
        final Where statement = select().from(TABLE_NAME).where(eq("id", bindMarker("id")));

        final TypedMap found = manager.nativeQuery(statement, id).first();
View Full Code Here

                .value("retention_policies", ImmutableMap.of(0, ANNOTATION_TYPE.name(), 2, CONSTRUCTOR.name()));

        manager.nativeQuery(insert).execute();

        //When
        final EntityWithEnumeratedConfig found = manager.find(EntityWithEnumeratedConfig.class, id);

        //Then
        assertThat(found.getConsistencyLevel()).isEqualTo(ConsistencyLevel.LOCAL_ONE);
        assertThat(found.getElementTypes()).containsExactly(FIELD, METHOD);
        assertThat(found.getRetentionPolicies()).contains(entry(SOURCE, ANNOTATION_TYPE), entry(RUNTIME, CONSTRUCTOR));
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.test.integration.entity.EntityWithEnumeratedConfig

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.