Examples of ErlangModule


Examples of statechum.analysis.Erlang.ErlangModule

    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.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
/*    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

Examples of statechum.analysis.Erlang.ErlangModule

    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.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    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

Examples of statechum.analysis.Erlang.ErlangModule

    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.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    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

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call({\"this is a test\",\"aa\"},_,_)->{reply,\"yy\",5};\n");
    wr.write("handle_call(\"more interesting things\",_,_)->{reply,ok,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    createLabel("call, \"ttt\",ok",config);
    createLabel("call, \"ttt\",\"y\"",config);
    createLabel("call, {\"ttt\",\"a\"},\"y\"",config);
    createLabel("call, {\"\",\"\"},\"y\"",config);
    createLabel("call, {\"\",\"\"},\"\"",config);
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(F,_,_) when F == [] -> {reply,wr(F),5}.\n");
    wr.write("wr([]) -> 1.");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    mod.sigs.put("strA", new FuncSignature(defaultConfig, ErlangLabel.parseText(
      "{\"testFile.erl\",3,handle_call,1,{'Func',[],[{'String',[],[[],\"strA\"]}],{'Int',[values],[1]}}}"),
      null));
    mod.sigs.put("strB", new FuncSignature(defaultConfig, ErlangLabel.parseText(
      "{\"testFile.erl\",3,handle_call,1,{'Func',[],[{'String',[],[\"strB\"]}],{'Int',[values],[1]}}}"),
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(F,_,_) when F == [] -> {reply,wr(F),5}.\n");
    wr.write("wr([]) -> 1.");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    mod.sigs.put("strNonEmpty", new FuncSignature(defaultConfig, ErlangLabel.parseText(
      "{\"testFile.erl\",3,handle_call,1,{'Func',[],[{'String',[],[[]]}],{'Int',[values],[1]}}}"),
      null));
    mod.sigs.put("strNonEmpty", new FuncSignature(defaultConfig, ErlangLabel.parseText(
      "{\"testFile.erl\",3,handle_call,1,{'Func',[],[{'String',[],[[]]}],{'Int',[values],[1]}}}"),
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(_,_,_) -> {reply,<< 4:2,5:6 >>,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
    ErlangModule mod = ErlangModule.loadModule(config);
    Assert.assertEquals("[{?F(),'call','AnyWibble',<< 34, 56>>},{?F(),'cast','AnyWibble',5},{?F(),'info','AnyWibble',{'noreply',5}},{?F(),'init','AnyWibble','ok'}]",getAlphabetAsString(mod));
    createLabel("call, 4.7,<< 45>> ",config);
    checkFailureFor("call, 4,1",config);
  }
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(F,_,_) when F == {4,f} -> {reply,wr(F),5}.\n");
    wr.write("wr(A) -> A+1.");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
    ErlangModule mod = ErlangModule.loadModule(config);
    Assert.assertEquals("[{?F(),'cast','AnyWibble',5},{?F(),'info','AnyWibble',{'noreply',5}},{?F(),'init','AnyWibble','ok'}]",getAlphabetAsString(mod));
  }
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    Writer wr = new FileWriter(erlangFile);wr.write("-module(testFile).\n-behaviour(gen_server).\n");

    wr.write("handle_call([false,true],_,_) -> {reply,1,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    ErlangModule mod = ErlangModule.loadModule(config);
    mod.sigs.put("bool", new FuncSignature(defaultConfig, ErlangLabel.parseText(
      "{\"testFile.erl\",3,handle_call,1,{'Func',[],[{'Boolean',[]}],{'Int',[values],[1]}}}"),
      null));
   
    createLabel("bool, true,1",config);
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(#st{processNum=33}=Arg,_,_) -> {reply,11,5};\n");
    wr.write("handle_call(#st{smth=\"whatever\"}=Arg,_,_) -> {reply,12,5}.\n");
    wr.write(otherMethods);wr.close();
    ErlangModule.setupErlangConfiguration(config,new File(erlangFile));
    config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
    ErlangModule mod = ErlangModule.loadModule(config);

    checkFailureFor("call, afalse,11",config);
    Assert.assertEquals("["+
        "{"+ErlangLabel.missingFunction+",'call',{'st'},11},"+
        "{"+ErlangLabel.missingFunction+",'cast','AnyWibble',5},"+
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.