Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2007, 08:37 PM
Member
 
Join Date: Apr 2007
Location: Pennsylvania,USA
Posts: 46
sandor is on a distinguished road
TRying to use jUnit for Tesing
I have this code and the test is just not working. Can anyone help me?
Code:
public class QueryBuilderTest extends TestCase { private String[] variablesChosen = new String[0]; public void buildingPhenoTypeQuery() { String[] displayItemsChosen = getDisplayItems(); QueryBuilder builder = new QueryBuilder(); String query = builder.buildPhenotypeQuery(displayItemsChosen); String result = "from edu.iu.ms.ped.matrixweb.domain.Category cat where cat.displayOrder > 0 AND cat.phenoCat='Y' AND (cat.id in(66,68,70) OR cat.id in (select distinct(c.parent) from edu.iu.ms.ped.matrixweb.domain.Category c where c.id in(66,68,70))) order by cat.displayOrder"; assertNotNull(query); assertEquals(query, result); } private String[] getDisplayItems() { String[] displayItemsChosen = new String[3]; displayItemsChosen[0] = "66"; displayItemsChosen[1] = "68"; displayItemsChosen[2] = "70"; return displayItemsChosen; } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-07-2007, 08:39 PM
Member
 
Join Date: Apr 2007
Location: USA
Posts: 50
derrickD is on a distinguished road
When you are using junit , you must start each test method with the actual word "test". So, you method named "buildingPhenoTypeQuery" needs to be
"testBuildingPhenoTypeQuery". Then it will work.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-18-2007, 09:28 AM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
Not only test but it has to be " public void " also, Fortunately it is correct here
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-19-2007, 01:17 AM
Member
 
Join Date: Apr 2007
Location: USA
Posts: 50
derrickD is on a distinguished road
Since he already had public void I did not think there was any reason to mention it, snce that had nothing to do with why it was failing.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Junit Azndaddy New To Java 6 06-15-2008 08:47 AM
Testing JUnit PDE with Ant keynan Eclipse 0 02-15-2008 01:35 AM
Creating JUnit Test Cases using NetBeans JavaForums Java Blogs 0 08-06-2007 07:30 PM
Using Junit In Eclipse JavaForums Eclipse 0 05-06-2007 05:41 PM


All times are GMT +3. The time now is 10:16 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org