[jboss-user] [JBoss Seam] - TestNG with hibernate

cormet do-not-reply at jboss.com
Sun Jun 10 09:49:30 EDT 2007


Hi All,

I would like to ask how to create session in hibernate session using testNG.
One of example using this code below:
    
EntityManagerFactory emf = 
  |       Persistence.createEntityManagerFactory("helloworld");
  |     EntityManager em = emf.createEntityManager();

Is it code usable for hibernate session? if not, how do I create session in test file?...

here are my components.xml:


  | ?xml version="1.0" encoding="UTF-8"?>
  | <components xmlns="http://jboss.com/products/seam/components"
  | 	xmlns:core="http://jboss.com/products/seam/core"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xmlns:security="http://jboss.com/products/seam/security"
  | 	xsi:schemaLocation="http://jboss.com/products/seam/core 
  |                http://jboss.com/products/seam/core-1.1.xsd
  |                http://jboss.com/products/seam/components 
  |                http://jboss.com/products/seam/components-1.1.xsd
  |                http://jboss.com/products/seam/security 
  |                http://jboss.com/products/seam/security-1.1.xsd">
  | 
  | 	<core:init debug="true" />
  | 
  | 	<!-- <core:manager conversation-timeout="120000" /> -->
  | 	<core:manager conversation-timeout="60000"
  | 		concurrent-request-timeout="500"
  | 		conversation-id-parameter="cid"
  | 		conversation-is-long-running-parameter="clr" />
  | 	<security:identity
  | 		authenticate-method="#{authenticator.authenticate}" />
  | 
  | 	<event type="org.jboss.seam.notLoggedIn">
  | 		<action expression="#{redirect.captureCurrentView}" />
  | 	</event>
  | 
  | 	<event type="org.jboss.seam.postAuthenticate">
  | 		<action expression="#{redirect.returnToCapturedView}" />
  | 	</event>
  | 	<!-- Bootstrap Hibernate  -->
  | 	<core:hibernate-session-factory />
  | 	<core:managed-hibernate-session name="mySession" auto-create="true" />
  | 	
  | </components>
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052901#4052901

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052901



More information about the jboss-user mailing list