The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem in "Thinking in Java 3trd edtion"

2 replies on 1 page. Most recent reply: Jun 22, 2005 5:58 AM by Ilario

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 2 replies on 1 page
ziyuan

Posts: 2
Nickname: ziyuan
Registered: Jun, 2005

Problem in "Thinking in Java 3trd edtion" Posted: Jun 10, 2005 8:47 AM
Reply to this message Reply
Advertisement
I can't complie the package simpletest sucessfully,in which the chapter 15.

I think that there may be some problem with the class:Test & OutputVerifiers.

Help me!


barron

Posts: 13
Nickname: toniblair
Registered: May, 2005

Re: Problem in "Thinking in Java 3trd edtion" Posted: Jun 13, 2005 6:33 AM
Reply to this message Reply
Please post some code to assist. And remember to enclose the code in " tags...

Ilario

Posts: 4
Nickname: karim2
Registered: May, 2005

Re: Problem in "Thinking in Java 3trd edtion" Posted: Jun 22, 2005 5:58 AM
Reply to this message Reply
What jdk are u using?
if u are using jdk 1.5 (or later) the problem is in OutputVerifier.java line 45:

((String) out).compareTo(expected)...

The problem is that expected[].toString() method is not automatically called (probably due by generics implementation); so what you have to do is to call the toString() method:

((String) out).compareTo(expected.toString()) < 0
? "output: <" + out + ">"
: "expected: <" + expected + ">");

Flat View: This topic has 2 replies on 1 page
Topic: a test for signature Kdwoijrngik Previous Topic   Next Topic Topic: Socket Programming

Sponsored Links



Google
  Web Artima.com   

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