All pastes #160946 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-04 21:01 UTC
rendered paste body
package org.jamescarr.payfuse.fit;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

import junit.framework.TestCase;

public class PayFuseTest extends TestCase {
	public void testInput() throws IOException{
		String command = "php  /home/jamescarr/workspace/Payfuse/src/core/php/cliInput.php";
		Process payfuseInterface = Runtime.getRuntime().exec(command);


		BufferedReader err= new BufferedReader(new InputStreamReader(payfuseInterface.getErrorStream()));

		BufferedReader in = new BufferedReader(new InputStreamReader(payfuseInterface.getInputStream()));
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter((payfuseInterface.getOutputStream())));

		out.write("populate field");
		out.newLine();
		out.write("foo:bar");
		out.newLine();
		out.write("save");
		out.newLine();
		out.write("/home/jamescarr/out.xml");
		out.newLine();
		out.write("exit");
		out.newLine();

		while(in.ready()){
		System.out.println(in.readLine());
		System.out.println("\n");
		}

		while(err.ready()){
			System.out.println(err.readLine());
			System.out.println("\n");

			}
			payfuseInterface.destroy();
	}
}