Problem creating simple test from faq document
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vijay_M
Posted On:   Wednesday, April 9, 2003 07:13 AM

I installed Junit 3.8.1, tested it as per Junit faq and found that the install was successful. However, when I tried compiling the "simple test" given in FAQ (chapter 4, item 1: How do I write and run a simple test? ), I got a compilation error as follows: D:>javac SimpleTest.java SimpleTest.java:18: Class junit.faqsamples.Collection not found in type declarat ion. Collection collection = new ArrayList(); ^ SimpleTest.java:18: Class junit.faqsamples.ArrayList not found in type declarati on. Collection collection = new ArrayList(); ^ 2 errors I have jdk1.1.8 and my classpath includes    More>>


I installed Junit 3.8.1, tested it as per Junit faq and found that the install was successful.


However, when I tried compiling the "simple test" given in FAQ (chapter 4, item 1: How do I write and run a simple test? ), I got a compilation error as follows:


			
D:>javac SimpleTest.java
SimpleTest.java:18: Class junit.faqsamples.Collection not found in type declarat
ion.
Collection collection = new ArrayList();
^
SimpleTest.java:18: Class junit.faqsamples.ArrayList not found in type declarati
on.
Collection collection = new ArrayList();
^
2 errors




I have jdk1.1.8 and my classpath includes


D:junit3.8.1junit.jar


D:jdk1.1.8libclasses.zip



Question: Where have I gone wrong ?
What is the correction ?



Thank you.

   <<Less

Re: Problem creating simple test from faq document

Posted By:   Anonymous  
Posted On:   Thursday, April 10, 2003 12:43 AM

The Collection API was introduced with JDK 1.2, so this canĀ“t work. Maybe you can update to JDK 1.4?

Re: Problem creating simple test from faq document

Posted By:   Anonymous  
Posted On:   Thursday, April 10, 2003 12:41 AM

You need to update your JDK - java.util.Collection and java.util.ArrayList were introduced with JDK 1.2
About | Sitemap | Contact