473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

ClassCastException in junit 4.5 AllTests

I downloaded Junit 4.5 and am using the TestRunner class to test the AllTests class in the junit/tests package. I am issuing the following command at a DOS prompt:
java -classpath junit-4.5.jar;. junit.textui.TestRunner junit.tests.AllTests

I get an Error:
java.lang.ClassCastException: class junit.tests.AllTests

These classes are already compiled though.
Any help would be appreciated.
Nov 17 '08 #1
4 4066
JosAH
11,448 Expert 8TB
That's a runtime error: your code tries to cast an AllTests object to something
else but it can't do that. Without seeing your code we can't say much more.

kind regards,

Jos
Nov 17 '08 #2
There is not code to see. Simply because I'm tesing my Junit installation. Hence, there is no code to show.
Jan 23 '09 #3
jkmyoung
2,057 Expert 2GB
Just tried downloading it and got the same message. I don't get this with JUnit 4.0. Probably an environment variable out of place somewhere.
By any chance do you have multiple JUnit installs on your computer?
Jan 23 '09 #4
Try this..

java -classpath junit-4.5.jar;. org.junit.runner.JUnitCore junit.tests.AllTests
Jul 15 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Captain | last post by:
How do you junit test a container managed security (2.3. Servlet) environment within Tomcat 4.1.x using JUnit?? I.e. form based authentication. I had expected the following to work... but alas...
0
by: Linus Nikander | last post by:
Browsing peoples comments at amazon might be rewarding, but it sure takes a lot of time. I'm trying to find good (best) books for a couple of java-related areas. As most people who subscribe to...
0
by: Jake | last post by:
I am using ant 1.5.4 I have optional.jar in $ANT_HOME/lib (the one that was distributed with said version of ant) so for example with regards to junit I have junit.jar in $ANT_HOME/lib there...
3
by: Jon-Paul Dobson | last post by:
Hi, We have an applet that implements the MouseListener interface but when trying to add the applet to the glasspane of another applet a classcastexception is thrown. This all seemed to work...
5
by: Casper B | last post by:
Since I am only able to pass simple beans around using my Web Service framework, I wonder how to incorporate business logic around these beans. My idea was to let my Beans be the base class and...
3
by: knightsmastergeneral | last post by:
Hi, I'm currently working on getting junit and junireport to take some java files, convert it to xml and then display error messages / success rates etc in html which is one of the features of...
2
by: star111792 | last post by:
helo all, i am working with JSP and EJBs. i have written a simple code for verifying username and password of user by using session beans. my problem is that i m getting exception named...
1
by: Abhishek Bhatt | last post by:
Ours is a J2EE project(JSP, Struts, EJB, Websphere). One of the requirement of our project is to implement Junit without Cactus framework. We have implemented Junit with Cactus framework. Can someone...
1
by: kokababu | last post by:
HI, I am new in Junit testing. I don't know how to test EJB with Junit. I have found people using mock object to test EJB, I am not clear about it. Can anyone give me some advice from where I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.