Package info.archinnov.achilles.type

Examples of info.archinnov.achilles.type.TypedMap


     *            list of tables to truncate before, after or before and after
     *            tests, depending on the 'cleanUpSteps' parameters
     */
    public AchillesInternalCQLResource(Steps cleanUpSteps, String... tables) {
        super(cleanUpSteps, tables);
        final TypedMap config = buildConfigMap();
        final ConfigMap achillesConfig = buildAchillesConfigMap();

        server = new CassandraEmbeddedServer(config, achillesConfig);
        pmf = server.getPersistenceManagerFactory(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
        manager = server.getPersistenceManager(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
View Full Code Here


     *            tests, depending on the 'cleanUpSteps' parameters
     */
    public AchillesInternalCQLResource(Steps cleanUpSteps, InsertStrategy insertStrategy, String... tables) {
        super(cleanUpSteps, tables);
        this.insertStrategy = insertStrategy;
        final TypedMap config = buildConfigMap();
        final ConfigMap achillesConfig = buildAchillesConfigMap();

        server = new CassandraEmbeddedServer(config, achillesConfig);
        pmf = server.getPersistenceManagerFactory(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
        manager = server.getPersistenceManager(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
View Full Code Here

        }
    }

    private TypedMap buildConfigMap() {
        setCleanDataFiles();
        final TypedMap config = new TypedMap();
        config.put(CLEAN_CASSANDRA_DATA_FILES, cleanDataFiles);
        config.put(KEYSPACE_DURABLE_WRITE, false);
        return config;
    }
View Full Code Here

        final AchillesFuture<List<TypedMap>> future1 = manager.nativeQuery(statement, entity1.getId()).asyncGet(successCallBack);
        final AchillesFuture<List<TypedMap>> future2 = manager.nativeQuery(statement, entity2.getId()).asyncGet();

        final List<TypedMap> typedMaps1 = future1.get();
        assertThat(typedMaps1).hasSize(1);
        TypedMap typedMap1 = typedMaps1.get(0);

        final List<TypedMap> typedMaps2 = future2.get();
        assertThat(typedMaps2).hasSize(1);
        TypedMap typedMap2 = typedMaps2.get(0);

        assertThat(typedMap1.get("name")).isEqualTo("DuyHai");
        assertThat(typedMap1.get("age_in_years")).isEqualTo(35L);
        assertThat(typedMap1.<List<String>>getTyped("friends")).containsExactly("foo", "bar");
        assertThat(typedMap1.<Set<String>>getTyped("followers")).contains("George", "Paul");
        Map<Integer, String> preferences1 = typedMap1.getTyped("preferences");
        assertThat(preferences1.get(1)).isEqualTo("FR");
        assertThat(preferences1.get(2)).isEqualTo("Paris");
        assertThat(preferences1.get(3)).isEqualTo("75014");

        assertThat(typedMap2.get("name")).isEqualTo("John DOO");
        assertThat(typedMap2.get("age_in_years")).isEqualTo(35L);
        assertThat(typedMap2.<List<String>>getTyped("friends")).containsExactly("qux", "twix");
        assertThat(typedMap2.<Set<String>>getTyped("followers")).contains("Isaac", "Lara");
        Map<Integer, String> preferences2 = typedMap2.getTyped("preferences");
        assertThat(preferences2.get(1)).isEqualTo("US");
        assertThat(preferences2.get(2)).isEqualTo("NewYork");

        latch.await();
        assertThat(successSpy.get()).isNotNull().isInstanceOf(List.class);
View Full Code Here

        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();

        //Then
        assertThat(found.getTyped("id")).isEqualTo(id);
        assertThat(found.getTyped("consistency_level")).isEqualTo(ConsistencyLevel.LOCAL_ONE.ordinal());
        assertThat(found.<List<String>>getTyped("element_types")).containsExactly(FIELD.name(), METHOD.name());
        assertThat(found.<Map<Integer,String>>getTyped("retention_policies")).contains(entry(0, ANNOTATION_TYPE.name()), entry(2, CONSTRUCTOR.name()));
    }
View Full Code Here

        //Then
        assertThat(error.get()).isTrue();
        assertThat(result.get()).isNotNull();

        final TypedMap currentValues = result.get().currentValues();

        assertThat(currentValues.getTyped("id")).isEqualTo(entity.getId());
        assertThat(currentValues.getTyped("name")).isEqualTo("name1000");

    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.type.TypedMap

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.