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

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


    private Long id = RandomUtils.nextLong(0,Long.MAX_VALUE);

    @Test
    public void should_throw_exception_when_persisting_with_two_consistency() throws Exception {
        EntityWithTwoConsistency bean = new EntityWithTwoConsistency();
        bean.setId(id);
        bean.setName("name");

        expectedEx.expect(UnavailableException.class);
        expectedEx.expectMessage("Not enough replica available for query at consistency TWO (2 required but only 1 alive)");

        manager.insert(bean);
View Full Code Here


                .buildPersistenceManager();

        try {
            //When
            logAsserter.prepareLogLevel();
            final EntityWithTwoConsistency entity = new EntityWithTwoConsistency();
            entity.setId(RandomUtils.nextLong(0,Long.MAX_VALUE));

            pm.insert(entity);
            //Then
            assertThat(pm.find(EntityWithTwoConsistency.class, entity.getId())).isNotNull();
            logAsserter.assertConsistencyLevels(ONE, QUORUM);
        } finally {
            pm.getNativeSession().close();
        }
View Full Code Here

TOP

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

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.