From: "Patrick Ellis" <Patrick.Ellis@sas.com>
To: <mauve-discuss@sources.redhat.com>
Subject: Questions about exception error with gnu.testlet.java.io.PrintWriter.jdk11 & gnu.testlet.java.io.FilterWriter.write
Date: Thu, 10 Apr 2003 20:41:00 -0000 [thread overview]
Message-ID: <F2E670D5036BE14E89473A3FAEDE6ACE428FB7@merc18.na.sas.com> (raw)
I get the following exceptions when trying to compile gnu.testlet.java.io.PrintWriter.jdk11 & gnu.testlet.java.io.FilterWriter.write.
Is there anything in the code missing or is the URLpackage missing?
*********************** Code for gnu.testlet.java.io.FilterWriter.write
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA. */
package gnu.testlet.java.io.FilterWriter;
import java.io.CharArrayWriter;
import java.io.FilterWriter;
import java.io.Writer;
import java.io.*;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
public class write extends FilterWriter implements Testlet
{
public write()
{
this(null);
}
write (CharArrayWriter caw)
{
super((Writer) caw);
}
public void test (TestHarness harness)
{
CharArrayWriter caw = new CharArrayWriter();
write tfw = new write(caw);
try {
tfw.write('A'); // A
harness.check(true, "write(int)");
char[] ba = {'A', 'B', 'C', 'D'};
tfw.write(ba, 1, 2); // ABC
harness.check(true, "write(buf,off,len)");
tfw.write("CDEF", 1, 3); // ABCDEF
harness.check(caw.toString(), "ABCDEF", "wrote all characters okay");
tfw.flush();
harness.check(true, "flush()");
tfw.close();
harness.check(true, "close()");
}
catch (IOException e) {
harness.fail("IOException unexpected");
}
}
}
******************************* Code for gnu.testlet.java.io.PrintWriter.jdk11
// Tags: JDK1.1
package gnu.testlet.java.io.PrintWriter;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
import java.io.PrintWriter;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.CharArrayWriter;
public class jdk11 extends PrintWriter implements Testlet
{
public jdk11()
{
this(null);
}
jdk11(OutputStream os)
{
super(os);
}
public void print(int i, boolean err)
{
if (err)
{
this.setError();
}
}
public String toString()
{
return ("ObjectString");
}
public void
test(TestHarness harness)
{
// Test constructors first
ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
PrintWriter pw1 = new PrintWriter(baos1);
harness.check(pw1 != null, "PrintWriter(OutputStream)");
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
PrintWriter pw2 = new PrintWriter(baos2, true);
harness.check(pw2 != null, "PrintWriter(OutputStream, boolean)");
CharArrayWriter caw1 = new CharArrayWriter();
PrintWriter pw3 = new PrintWriter(caw1);
harness.check(pw3 != null, "PrintWriter(Writer)");
CharArrayWriter caw2 = new CharArrayWriter();
PrintWriter pw4 = new PrintWriter(caw2);
harness.check(pw4 != null, "PrintWriter(Writer)");
// Now test the methods
pw1.print(true);
pw1.print(false);
pw1.print('X');
char[] ca = {'A', 'B', 'C'};
pw1.print(ca);
double x = 3.14;
pw1.print(x);
float y = (float) 1.414;
pw1.print(y);
int i = 37;
pw1.print(i);
long l = 65537L;
pw1.print(l);
pw1.print(new jdk11());
pw1.print("XYZ");
pw1.write(ca);
pw1.write(ca,0,2);
pw1.write('Q');
pw1.write("JKL");
pw1.write("MNOPQ", 1, 2);
pw1.println();
pw1.println(true);
pw1.println(false);
pw1.println('X');
pw1.println(ca);
pw1.println(x);
pw1.println(y);
pw1.println(i);
pw1.println(l);
pw1.println(new jdk11());
pw1.println("XYZ");
pw1.flush();
harness.check(true, "flush()");
pw1.close();
harness.check(true, "close()");
String tst = "truefalseXABC3.141.4143765537ObjectStringXYZABCABQJKLNO\n" +
"true\nfalse\nX\nABC\n3.14\n1.414\n37\n65537\nObjectString\nXYZ\n";
harness.check(baos1.toString(), tst, "All characters printed okay");
harness.debug("Final output:" + baos1.toString());
// Set up to test setError() and checkError()
ByteArrayOutputStream baos3 = new ByteArrayOutputStream();
jdk11 tpw = new jdk11(baos3);
harness.check(!tpw.checkError(), "checkError");
tpw.print(3, true); // forces call to setError
harness.check(tpw.checkError(), "setError");
}
} // class Test
java.lang.ClassNotFoundException: gnu.testlet.java.io.FilterWriter.write
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:195)
at gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:349)
FAIL: uncaught exception loading gnu.testlet.java.io.PrintWriter.jdk11
java.lang.ClassNotFoundException: gnu.testlet.java.io.PrintWriter.jdk11
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:195)
at gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:349)
Pat Ellis
SDE Build and Test Team
Phone: (919) 531-0355
R2263 Patrick.Ellis@sas.com
SAS... The Power to Know
next reply other threads:[~2003-04-10 20:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-10 20:41 Patrick Ellis [this message]
2003-04-11 12:39 ` Brian Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F2E670D5036BE14E89473A3FAEDE6ACE428FB7@merc18.na.sas.com \
--to=patrick.ellis@sas.com \
--cc=mauve-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).