Package statechum.analysis.Erlang

Examples of statechum.analysis.Erlang.ErlangModule


    while(num.contains(n))
      n = rnd.nextInt();
    wr.write("handle_call("+n+",_,_)->{reply,ok,5}.\n");
   
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 45, ok",config);
    checkFailureFor("call, [45], ok", config);
    checkFailureFor("call, {45}, ok", config);
    checkFailureFor("call, aa, ok", config);
View Full Code Here


        wr.write("handle_call("+i+",_,_)->{reply,ok,5};\n");
     
    wr.write("handle_call("+56+",_,_)->{reply,ok,5}.\n");
   
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 98, ok",config);
    checkFailureFor("call, [45], ok", config);
    checkFailureFor("call, {45}, ok", config);
    checkFailureFor("call, aa, ok", config);
View Full Code Here

  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call("+1+",_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
/*    OtpErlangObject funcDescr = ErlangLabel.parseText(mod.sigs.get("call").toErlangTerm().replace("boundaries", "positive"));
    System.out.println(funcDescr);*/
    mod.sigs.put("funcPositive", new FuncSignature(defaultConfig,
        ErlangLabel.parseText("{\"testFile.erl\",3,handle_call,1,"+
        "{'Func',[],[{'Int',[positive]}],{'Atom',[],[ok]}}}"),
View Full Code Here

  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call("+1+",_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
    mod.sigs.put("funcNegative", new FuncSignature(defaultConfig,
        ErlangLabel.parseText("{\"testFile.erl\",3,handle_call,1,"+
        "{'Func',[],[{'Int',[negative]}],{'Atom',[],[ok]}}}"),
      null));
   
View Full Code Here

  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call("+1+",_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
    mod.sigs.put("funcNonnegative", new FuncSignature(defaultConfig,
        ErlangLabel.parseText("{\"testFile.erl\",3,handle_call,1,"+
        "{'Func',[],[{'Int',[nonnegative]}],{'Atom',[],[ok]}}}"),
      null));
   
View Full Code Here

  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call([67,1900,atom],_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 256, ok",config);
    createLabel("call, [67], ok",config);
    createLabel("call, [atom,67,67,1900], ok",config);
    checkFailureFor("call, 67, ok", config);
View Full Code Here

    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call([67,1900,atom|junk],_,_)->{reply,ok,5};\n");
    wr.write("handle_call([\"str\"|55],_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    final Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 256, ok",config);
    checkFailureFor("call, [\"rrr\"], ok",config);
    checkFailureFor("call, [atom,67,67,1900], ok",config); // proper list
    checkFailureFor("call, 67, ok", config);
View Full Code Here

    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call([67,1900,atom|junk],_,_)->{reply,ok,5};\n");
    wr.write("handle_call([\"str\"],_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    final Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);

    createLabel("call, 256, ok",config);
    createLabel("call, [\"rrr\"], ok",config);
    createLabel("call, [atom,67,67,1900], ok",config); // proper list
    checkFailureFor("call, 67, ok", config);
View Full Code Here

  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");
    wr.write("handle_call([67,1900,atom|junk],_,_)->{reply,ok,5};\n");
    wr.write("handle_call("+256+",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    final Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 256, ok",config);
    ErlangLabel.erlangObjectToLabel(ErlangRunner.getRunner().evaluateString("{call, [atom|junk], ok}"),config);
    ErlangLabel.erlangObjectToLabel(ErlangRunner.getRunner().evaluateString("{call, [atom |junk], ok}"),config);
    checkForCorrectException(new whatToRun() { public @Override void run() {
View Full Code Here

  @Test
  public void testTypeCompatibility1() throws IOException
  {
    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n"+
    "\nhandle_call(45,_,_)->{reply,ok,5}.\n");wr.write(otherMethods);wr.close();
    ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
   
    createLabel("call, 45, ok",config);
    checkFailureFor("call, [45], ok", config);
    checkFailureFor("call, {45}, ok", config);
    checkFailureFor("call, aa, ok", config);
View Full Code Here

TOP

Related Classes of statechum.analysis.Erlang.ErlangModule

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.