Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22841 invoked from network); 26 Jun 2005 09:58:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2005 09:58:38 -0000 Received: (qmail 13156 invoked by uid 500); 26 Jun 2005 09:57:40 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 12502 invoked by uid 500); 26 Jun 2005 09:57:36 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 10845 invoked by uid 500); 26 Jun 2005 09:57:26 -0000 Received: (qmail 10738 invoked by uid 99); 26 Jun 2005 09:57:25 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 26 Jun 2005 02:57:25 -0700 Received: (qmail 19438 invoked by uid 1569); 26 Jun 2005 09:57:24 -0000 Message-ID: <20050626095724.19437.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r201762 - /jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java Date: Sun, 26 Jun 2005 09:57:24 -0000 To: commons-cvs@jakarta.apache.org From: tobrien@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tobrien Date: Sat Jun 25 09:27:24 2005 New Revision: 201762 URL: http://svn.apache.org/viewcvs?rev=201762&view=rev Log: A simple test case for ClassLoaderObjectInputStream that simply tests the expected behavior of an ObjectInputStream. To test the functionality of CLOIS, we will probably need to figure out how to create a transient class loader in the test case. Added: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java Added: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java?rev=201762&view=auto ============================================================================== --- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java (added) +++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java Sat Jun 25 09:27:24 2005 @@ -0,0 +1,58 @@ +/* + * Copyright 2003-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.io.input; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.ObjectOutputStream; + +import junit.framework.TestCase; + +/** + * Tests the CountingInputStream. + * + * @version $Id: CountingInputStreamTest.java 160202 2005-04-05 17:22:21Z roxspring $ + */ +public class ClassLoaderObjectInputStreamTest extends TestCase { + + public ClassLoaderObjectInputStreamTest(String name) { + super(name); + } + + /* Note: This test case tests the simplest functionality of + * ObjectInputStream. IF we really wanted to test ClassLoaderObjectInputStream + * we would probably need to create a transient Class Loader. -TO + */ + + + public void testExpected() throws Exception { + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + + oos.writeObject( Boolean.FALSE ); + + InputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ClassLoaderObjectInputStream clois = + new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais); + Boolean result = (Boolean) clois.readObject(); + + assertTrue( !result.booleanValue() ); + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org