Package org.jboss.mobicents.seam

Examples of org.jboss.mobicents.seam.Product


    @Test
    public void testRequiredAttributes()
        throws Exception
    {
        Product p = new Product();

        EntityManager em = em();
        try {
            em.persist(p);
            fail("empty product persisted");
View Full Code Here


    @Test
    public void testCreateDelete() {
        EntityManager em = em();

        Product p = new Product();
        p.setTitle("test");

        em.getTransaction().begin();
        em.persist(p);
        em.getTransaction().commit();

        long id = p.getProductId();
        assertTrue("product id set", id != 0);
       
        p = em.find(Product.class ,id);
        assertNotNull("find by id", p);
        assertEquals("id", id, p.getProductId());
        assertEquals("title", "test", p.getTitle());

        em.getTransaction().begin();
        em.remove(p);
        em.getTransaction().commit();
       
View Full Code Here

                setParameter("id", "41");
            }

            @Override
            protected void renderResponse() throws Exception {
                Product dvd = (Product) getValue("#{dvd}");
                assert dvd != null;
                assert dvd.getProductId() == 41;                              
            }
        }.run();
    }
View Full Code Here

                List<Product> products = (List<Product>) getValue("#{topProducts}");

                assertNotNull("topProducts", products);
                assertEquals("topProducts size"8, products.size());              

                Product prev = null;
                for (Product p: products) {
                    if (prev != null) {
                        assertTrue("descending order",
                                p.getInventory().getSales() <= prev.getInventory().getSales());
                    }

                    prev = p;
                }
View Full Code Here

TOP

Related Classes of org.jboss.mobicents.seam.Product

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.