Good test fails
The pupil went to the master programmer and said:
“All my tests pass all the time. Don’t I deserve a raise?”
The master slapped the pupil and replied:
“If all your tests pass, all the time, you need to write better tests.”
With a red cheek, the pupil went to HR to complain.
But that’s another story.
Enjoy the way of testivus in www.junitfactory.com . Write tests write tests tests tests...........
Monday, December 24, 2007
Wednesday, December 19, 2007
Interesting java compiler errors#1
public class Test2 {
public enum Dogs {collie, harrier, shepherd};
public static void main(String [] args) {
Dogs myDog = Dogs.shepherd;
switch (myDog) {
case Dogs.collie:
System.out.print("collie ");
default:
System.out.print("retriever ");
case harrier:
System.out.print("harrier ");
}
}
}
what is the error?
an enum switch case label must be the unqualified name of an enumeration constant
public enum Dogs {collie, harrier, shepherd};
public static void main(String [] args) {
Dogs myDog = Dogs.shepherd;
switch (myDog) {
case Dogs.collie:
System.out.print("collie ");
default:
System.out.print("retriever ");
case harrier:
System.out.print("harrier ");
}
}
}
what is the error?
an enum switch case label must be the unqualified name of an enumeration constant
Etiketler:
java compiler
Subscribe to:
Posts (Atom)