Examples of SFSB1


Examples of org.jboss.as.test.integration.jpa.basic.SFSB1

    /**
     * Test that EntityManagerFactory can be bind to specified JNDI name
     */
    @Test
    public void testEntityManagerFactoryName() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        sfsb1.createEmployee("Sally","1 home street", 1);

      EntityManagerFactory emf = rawLookup("myEMF",EntityManagerFactory.class);
        assertNotNull("JNDI lookup of jboss.entity.manager.factory.jndi.name should return EntityManagerFactory", emf);

        EntityManager em = emf.createEntityManager();
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.basic.SFSB1

    /**
     * Test that EntityManager can be bound to specified JNDI name in persistence unit property jboss.entity.manager.jndi.name (AS7-6835)
     */
    @Test
    public void testEntityManagerName() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        sfsb1.createEmployee("Sharon","304 Bubbles Lane", 2);

      EntityManager em = rawLookup("java:/Manager1",EntityManager.class);
        assertNotNull("JNDI lookup of jboss.entity.manager.jndi.name should return EntityManager", em);

        Employee emp = em.find(Employee.class,2);
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.beanvalidation.SFSB1

     * Test that a bean validation error is not thrown
     * @throws Exception
     */
    @Test
    public void testSuccessfulBeanValidation() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        sfsb1.createEmployee("name", "address", 1);
    }
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.beanvalidation.SFSB1

     * Test that a bean validation error is thrown
     * @throws Exception
     */
    @Test
    public void testFailingBeanValidationNullAddress() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        try {
            sfsb1.createEmployee("name", null, 2);
            fail("should of thrown validation error for null address in Employee entity");
        } catch (Throwable throwable) {
            ConstraintViolationException constraintViolationException = null;
            // find the ConstraintViolationException
            while(throwable != null && ! (throwable instanceof ConstraintViolationException)) {
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.hibernate.SFSB1

    // test that we didn't break the Hibernate hibernate.session_factory_name (bind Hibernate session factory to
    // specified jndi name) functionality.
    @Test
    public void testHibernateSessionFactoryName() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        sfsb1.createEmployee("Sally","1 home street", 1);

        // check if we can look up the Hibernate session factory that should of been bound because of
        // the hibernate.session_factory_name was specified in the properties (in peristence.xml above).
        SessionFactory hibernateSessionFactory = rawLookup("modelSessionFactory",SessionFactory.class);
        assertNotNull("jndi lookup of hibernate.session_factory_name should return HibernateSessionFactory", hibernateSessionFactory);
View Full Code Here

Examples of org.jboss.as.test.integration.jpa.hibernate.SFSB1

        return interfaceType.cast(iniCtx.lookup("java:global/" + ARCHIVE_NAME + "/" + beanName + "!" + interfaceType.getName()));
    }

    @Test
    public void testhibernate_ejb_use_class_enhancer() throws Exception {
        SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
        sfsb1.createEmployee("Kelly Smith", "Watford, England", 10);
        sfsb1.createEmployee("Alex Scott", "London, England", 20);
        Employee emp = sfsb1.getEmployeeNoTX(10);

        assertTrue("was able to read database row with hibernate.ejb.use_class_enhancer enabled", emp != null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.