Package statechum.Helper

Examples of statechum.Helper.whatToRun


    dumper.topElement.appendChild(initElement);dumper.close();
    xmlData = output.toString();

    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    loader.config = Configuration.getDefaultConfiguration();
    checkForCorrectException(new whatToRun() { public void run() {
      loader.readInitialData(loader.expectNextElement(ELEM_KINDS.ELEM_INIT.name()));
    }},IllegalArgumentException.class,"duplicate graph");
  }
View Full Code Here


  public final void testLoadInit_fail8()
  {
    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(
        removeTagFromString(xmlData,ELEM_KINDS.ATTR_POSITIVE_SIZE).getBytes()),false);
    loader.config = Configuration.getDefaultConfiguration();
    checkForCorrectException(new whatToRun() { public void run() {
      loader.readInitialData(loader.expectNextElement(ELEM_KINDS.ELEM_INIT.name()));
    }},IllegalArgumentException.class,"missing positive size");
  }
View Full Code Here

  }
 
  @Test
  public void testGetNameFail()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ErlangRunner.getName(new File("  aa/bb....   "),ERL.BEAM, true);
    }},IllegalArgumentException.class,"Invalid module");

  }
View Full Code Here

  }
 
  @Test
  public void testCompileFailure0a()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() throws IOException {
      ErlangRunner.compileErl(new File("junk"),null,true);
    }},IllegalArgumentException.class,"Invalid module");
  }
View Full Code Here

  }
 
  @Test
  public void testCompileFailure1a()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() throws IOException {
      ErlangRunner.compileErl(new File("junk.erl"),null,true);
    }},IllegalArgumentException.class,"does not have a parent directory");
  }
View Full Code Here

 
  @Test
  public void testCompileFailure2a() throws IOException
  {
    Writer wr = new FileWriter(output);wr.write(someErlang);wr.write("someJunk");wr.close();
    checkForCorrectException(new whatToRun() { public @Override void run() throws IOException {
      ErlangRunner.compileErl(output,null,true);
    }},IllegalArgumentException.class,"Failure running erlc");
  }
View Full Code Here

 
  @Test
  public void testCompileFailure2b() throws IOException
  {
    Writer wr = new FileWriter(output);wr.write(someErlang);wr.write("someJunk");wr.close();
    checkForCorrectException(new whatToRun() { public @Override void run() throws IOException {
      ErlangRunner.compileErl(output,erlRuntime.createNewRunner(),true);
    }},IllegalArgumentException.class,"failedToCompile");// error message returned by Erlang code
  }
View Full Code Here

    Assert.assertTrue(registeredProcessExists(runner));

    final ErlangRunner r = new ErlangRunner(erlRuntime.traceRunnerNode);
    Assert.assertFalse(r.mboxOpen);
   
    checkForCorrectException(new whatToRun() { public @Override void run() {
      r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
    }},IllegalArgumentException.class,"is closed");
    Assert.assertFalse(registeredProcessExists(r));

    r.initRunner();
    Assert.assertTrue(r.mboxOpen);
 
    OtpErlangTuple response = (OtpErlangTuple)r.call(new OtpErlangObject[]{new OtpErlangAtom("echo"),
        new OtpErlangList(new OtpErlangObject[]{ new OtpErlangAtom(dataHead)})},
        0);
    Assert.assertEquals(dataHead,((OtpErlangAtom)response.elementAt(0)).atomValue());

    Assert.assertTrue(registeredProcessExists(r));

    checkForCorrectException(new whatToRun() { public @Override void run() {
      r.initRunner();// this will fail because the corresponding process is already running.
    }},IllegalArgumentException.class,"already_started");
    Assert.assertFalse(r.mboxOpen);
    Assert.assertFalse(registeredProcessExists(r));
   
    // verify failure
    checkForCorrectException(new whatToRun() { public @Override void run() {
      r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
    }},IllegalArgumentException.class,"is closed");
   
  }
View Full Code Here

    Assert.assertTrue(registeredProcessExists(runner));

    final ErlangRunner r = new ErlangRunner(erlRuntime.traceRunnerNode);
    Assert.assertFalse(r.mboxOpen);
   
    checkForCorrectException(new whatToRun() { public @Override void run() {
      r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
    }},IllegalArgumentException.class,"is closed");
    Assert.assertFalse(registeredProcessExists(r));
  }
View Full Code Here

    r.close();
    Assert.assertFalse(r.mboxOpen);
    Assert.assertFalse(registeredProcessExists(r));
   
    // verify failure
    checkForCorrectException(new whatToRun() { public @Override void run() {
      r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
    }},IllegalArgumentException.class,"is closed");
   
  }
View Full Code Here

TOP

Related Classes of statechum.Helper.whatToRun

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.