*package com.declarativa.interprolog; import junit.framework.*; import java.util.*; import com.declarativa.interprolog.util.*; public class SubprocessEngineTest extends PrologEngineTest { public SubprocessEngineTest(String name){ super(name); } protected void setUp() throws java.lang.Exception{ engine = new SubprocessEngine(AllTests.startCommand/*,true*/); thisID = engine.registerJavaObject(this); loadTestFile(); engine.waitUntilAvailable(); } protected void tearDown() throws java.lang.Exception{ engine.shutdown(); } public void testDeterministicGoal(){ // crashes JNI version (and this one too) super.testDeterministicGoal(); /* try{ engine.deterministicGoal("nowaythisisdefined"); fail("should raise an IPException... with undefined predicate message"); } catch (IPException e){ // Too strict for the stream-based recognizers: // assertTrue("proper message in exception",e.toString().indexOf("Undefined")!=-1); assertTrue("No more listeners",((SubprocessEngine)engine).errorTrigger.numberListeners()==0); }*/ } public void testManyEngines(){ SubprocessEngine[] engines = new SubprocessEngine[2]; // 3 hangs on my Windows 98, at least 10 work on NT 4 Workstation for (int i=0;i