The Artima Developer Community
Sponsored Link

Java Answers Forum
No Class Test in com.bruceeckel.simpletest?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Xiao Mao

Posts: 1
Nickname: kinns
Registered: Feb, 2006

No Class Test in com.bruceeckel.simpletest? Posted: Feb 16, 2006 12:15 AM
Reply to this message Reply
Advertisement
I just typed the following example in TIJ3

import com.bruceeckel.simpletest.*;
import java.util.*;

class Shape
{
void draw(){}
void erase(){}
};

class Circle extends Shape
{
void draw(){
System.out.println("Circle.draw()");
}
void erase(){
System.out.println("Circle.erase()");
}
};

class Square extends Shape
{
void draw(){
System.out.println("Square.draw()");
}
void erase(){
System.out.println("Square.erase()");
}
};

class Triangle extends Shape
{
void draw(){
System.out.println("Triangle.draw()");
}
void erase(){
System.out.println("Triangle.erase()");
}
};

class RandomShapeGenerator
{
private Random rand = new Random();
public Shape next(){
switch(rand.nextInt(3)){
default:
case 0: return new Circle();
case 1: return new Square();
case 2: return new Triangle();
}
}
};

public class Shapes
{
private static Test monitor = new Test();
private static RandomShapeGenerator gen = new RandomShapeGenerator();
public static void main(String[] args)
{
Shape[] s = new Shape[9];
for (int i=0 ; i<s.length ; i++)
{
s[i] = gen.next();
}
for (int i=0 ; i<s.length ; i++ )
{
s[i].draw();
}
monitor.expect(new Object[]{
new TestExpression("%% (Circle|Square|Triangle)"+"\\.draw\\(\\)",s.length)
});
}
}


then when i compile it said:

---------- Java Compiler ----------
Shapes.java:55: cannot resolve symbol
symbol : class Test
location: class Shapes
private static Test monitor = new Test();
^
Shapes.java:55: cannot resolve symbol
symbol : class Test
location: class Shapes
private static Test monitor = new Test();
^
Shapes.java:69: cannot resolve symbol
symbol : class TestExpression
location: class Shapes
new TestExpression("%% (Circle|Square|Triangle)"+"\\.draw\\(\\)",s.length)
^
3 errors

And i check the com/bruceeckel/simpletest and could not find the class Test . so where is it?

Topic: Java Newbie Previous Topic   Next Topic Topic: import com.bruceeckel.simpletest.*; error

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use