Package org.apache.deltaspike.data.test.domain

Examples of org.apache.deltaspike.data.test.domain.Simple


    public void should_count_by_like()
    {
        // given
        createSimple("testFindAll1");
        createSimple("testFindAll2");
        Simple example = new Simple("test");

        // when
        Long count = repo.countLike(example, Simple_.name);

        // then
View Full Code Here


    @Test
    public void should_remove()
    {
        // given
        Simple simple = createSimple("testRemove");

        // when
        repo.remove(simple);
        repo.flush();
        Simple lookup = entityManager.find(Simple.class, simple.getId());

        // then
        assertNull(lookup);
    }
View Full Code Here

        return createSimple(name, null);
    }

    private Simple createSimple(String name, Integer counter)
    {
        Simple result = new Simple(name);
        result.setCounter(counter);
        entityManager.persist(result);
        entityManager.flush();
        return result;
    }
View Full Code Here

        // given
        final String name = "should_query_optional";
        builder.createSimple(name);

        // when
        Simple result1 = repo.queryResultWithNamed(name).getOptionalResult();
        Simple result2 = repo.queryResultWithNamed("this_does_not_exist").getOptionalResult();

        // then
        assertNotNull(result1);
        assertEquals(name, result1.getName());
        assertNull(result2);
View Full Code Here

        final String name = "should_query_any";
        builder.createSimple(name);
        builder.createSimple(name);

        // when
        Simple result1 = repo.queryResultWithNamed(name).getAnyResult();
        Simple result2 = repo.queryResultWithNamed("this_does_not_exist").getAnyResult();

        // then
        assertNotNull(result1);
        assertEquals(name, result1.getName());
        assertNull(result2);
View Full Code Here

TOP

Related Classes of org.apache.deltaspike.data.test.domain.Simple

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.