FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Testing JPA controllers in IDE

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
bajith



Joined: 06 Jul 2009
Posts: 1

PostPosted: Mon Jul 06, 2009 3:09 pm    Post subject: Testing JPA controllers in IDE Reply with quote

Hello Guys,

I have created netbeans project that uses hibernate and Jsf libraries. The following steps are taken to create project.

1. Created user table (id,firstname,lastname)
2. Created entity class for this table using "Netbeans IDE wizard for creating entities from database"
3. Created JPA controller for this class using "Netbeans IDE wizard for creating JAP controller from entities"
4. Created JSF pages from entities using wizard
5. Project RUN on app server and ran successfully on browser
6. I have created Test class for User JPA controller by rightclick->tools->create JUnit tests

I have the following test case,

@Test
public void testCreate() throws Exception {
System.out.println("create");
User user= new USer();
user.setFirstName("Rob");
user.setFirstName("Martin");
UserJpaController instance = new UserJpaController();
instance.create(user);

}


When I ran the above test case it keep complaining that it can not get Entitymanager from controller. I dont how to configure Junit in Netbeans to obtain persistence environment.\

Could you please assist me how to validate all test cases for JPA controller classes with in IDE?

It is taking a lot of time to verify in browser for all the changes made to controller classes.

Any help would be greatly appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB