participate


Java Database Connectivity (JDBC) - Error With JUnit?
This question is not answered.

<<   Back to Forum  |   Give us Feedback
2 Duke Stars available
This topic has 2 replies on 1 page.
Luke_B_1
Posts:2
Registered: 12/3/08
Error With JUnit?   
Dec 3, 2008 3:21 PM
 
 
Firstly Apologies if this is situated in the wrong forum section.

I want to test my java coding, within my Eclipse environment (I am using Windows XP). I have recently downloaded Eclipse 3.4.1 (Ganymede) and Eclipse IDE for java.

I try to test some basic code first (see below):

package org.NewProject;
 
import junit.framework.TestCase;
 
public class PersonTest extends TestCase {
 
	public void testPerson() {
		fail("Not yet implemented");
	}
 
	public void testSetMaximumBooks() {
		fail("Not yet implemented");
	}
 
	public void testSetName() {
		fail("Not yet implemented");
	}
 
}


I go to Run > Run as > J Unit test.. And a Message comes up as 'Problem Launching JUnit test; No socket available'
Even though its set to fail, it should run, and produce resulting errors, however it does not run.

In my C: > program files > Java I have jre1.6.0_01 and j2re1.4.2_03 ( which I think are required), and i have also restarted my computer. Was just wondering what I am missing or if someone could point me in the right direction, as its annoying now :(

Thanks
 
duffymo
Posts:27,863
Registered: 20/02/98
Re: Error With JUnit?   
Dec 3, 2008 4:46 PM (reply 1 of 2)  (In reply to original post )
 
 
that's an old version of JUnit, probably 3.8.

i'd recommend starting with JUnit 4.4.

jre? you need the jdk, right? do you understand the difference?

using JUnit 4.4, your test would look like this:

package org.NewProject;
 
public class PersonTest extends TestCase 
{
        @Test 
	public void testPerson() {
		fail("Not yet implemented");
	}
 
        @Test 
	public void testSetMaximumBooks() {
		fail("Not yet implemented");
	}
 
        @Test 
	public void testSetName() {
		fail("Not yet implemented");
	}
}


there are some static imports that you'll have to add, too.

this doesn't answer your question, but your responses will tell a lot about you.

i find that pasting my error messages into a google search helps a lot:

http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=Bth&q=JUnit+%22No+socket+available%22&btnG=Search

%
 
jschell
Posts:38,148
Registered: 11/3/97
Re: Error With JUnit?   
Dec 3, 2008 4:55 PM (reply 2 of 2)  (In reply to original post )
 
 
Cross posted
 
This topic has 2 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums