From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23725 invoked by alias); 5 Feb 2007 20:57:37 -0000 Received: (qmail 23716 invoked by uid 22791); 5 Feb 2007 20:57:36 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Feb 2007 20:57:32 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l15KvTpE023753 for ; Mon, 5 Feb 2007 15:57:29 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l15KvSKZ010984 for ; Mon, 5 Feb 2007 15:57:28 -0500 Received: from opsy.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by pobox.corp.redhat.com (8.13.1/8.12.8) with ESMTP id l15KvOqA027966; Mon, 5 Feb 2007 15:57:25 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 0F58E37839B; Mon, 5 Feb 2007 11:46:08 -0700 (MST) To: Mauve Patch List Subject: Patch: FYI: ProcessBuilder test From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Mon, 05 Feb 2007 20:57:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact mauve-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-patches-owner@sourceware.org X-SW-Source: 2007/txt/msg00007.txt.bz2 Here's a little ProcessBuilder test case. Tom Index: ChangeLog from Tom Tromey * gnu/testlet/java/lang/ProcessBuilder/simple.java: New file. Index: gnu/testlet/java/lang/ProcessBuilder/simple.java =================================================================== RCS file: gnu/testlet/java/lang/ProcessBuilder/simple.java diff -N gnu/testlet/java/lang/ProcessBuilder/simple.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/testlet/java/lang/ProcessBuilder/simple.java 5 Feb 2007 20:57:01 -0000 @@ -0,0 +1,45 @@ +// Copyright (C) 2007 Red Hat, Inc. + +// Tags: JDK1.5 + +// This file is part of Mauve. + +// Mauve is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. + +// Mauve is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Mauve; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +package gnu.testlet.java.lang.ProcessBuilder; + +import gnu.testlet.Testlet; +import gnu.testlet.TestHarness; +import java.io.IOException; + +public class simple implements Testlet +{ + public void test(TestHarness harness) + { + try + { + ProcessBuilder p1 = new ProcessBuilder("ls", "/nosuchdirectory"); + p1.redirectErrorStream(true); + Process p = p1.start(); + byte[] buffer = new byte[1024]; + harness.check(p.getInputStream().read(buffer) != -1); + } + catch (IOException _) + { + harness.check(false); + } + } +}