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(<< 4:2,5:6 >>,_,_) -> {reply,1,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);
    checkFailureFor("call, 4,1",config);
  }
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();
    Configuration config = ErlangModule.setupErlangConfiguration(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();
    Configuration config = ErlangModule.setupErlangConfiguration(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(true,_,_) -> {reply,1,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, true,1",config);
    checkFailureFor("call, afalse,1",config);
    checkFailureFor("call, false,1",config);
  }
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 mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(new File(erlangFile)));
    final Configuration config = Configuration.getDefaultConfiguration().copy();config.setErlangModuleName(mod.getName());config.setLabelKind(LABELKIND.LABEL_ERLANG);
    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();
    Configuration config = ErlangModule.setupErlangConfiguration(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

Examples of statechum.analysis.Erlang.ErlangModule

    wr.write("handle_call(#st{processNum=33,smth=\"whatever\"}=Arg,_,_) -> {reply,11,5};\n");
    wr.write("handle_call(#st{processNum=11,smth=\"Awhatever\"}=Arg,_,_) -> {reply,12,5}.\n");
    wr.write(otherMethods);wr.close();
    Configuration config = ErlangModule.setupErlangConfiguration(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,[]},11},"+
        "{"+ErlangLabel.missingFunction+",'call',{'st',11,[65]},11}," +
View Full Code Here

Examples of statechum.analysis.Erlang.ErlangModule

  @Test
  public void testLearningFromErlangTraceFile2() throws IOException
  {
    Configuration config = ErlangModule.setupErlangConfiguration(new File(lockerFile));
        config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
    ErlangModule mod = ErlangModule.loadModule(config);
    Set<ErlangLabel> alphabetA = new TreeSet<ErlangLabel>();alphabetA.addAll(mod.behaviour.getAlphabet());
    ErlangModule.flushRegistry();
    config = ErlangModule.setupErlangConfiguration(new File(lockerFile));
        config.setErlangAlphabetAnyElements(EXPANSIONOFANY.ANY_WIBBLE);
    ErlangModule modSame = ErlangModule.loadModule(config);
    Assert.assertTrue(alphabetA.equals(modSame.behaviour.getAlphabet()));// check that the same alphabet will be loaded second time.
    ErlangModule.flushRegistry();
   
    ErlangOracleLearner learner = ErlangQSMOracle.createLearner(null,"resources/earlier_failure2.txt");
    Set<ErlangLabel> alphabetFull = new TreeSet<ErlangLabel>();alphabetFull.addAll(ErlangModule.findModule("locker").behaviour.getAlphabet());
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(\"this is a test\",_,_)->{reply,ok,5};\n");
    wr.write("handle_call(\"more interesting things\",_,_)->{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, \"ttt\",ok",config);
    createLabel("call, \"ttt\"",config);
    checkFailureFor("call, \"ttt\", \"ttt\"",config);
    checkFailureFor("call, 256, ok",config);
  }
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({\"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 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, \"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
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.