Package net.ex337.scriptus.model.api

Examples of net.ex337.scriptus.model.api.Message


        p.save();

        final ThreadLocal<String> tweetId = new ThreadLocal<String>();

        ScriptusFacade f = new ScriptusFacade(datastore, c, m, config) {

            @Override
            public void registerMessageCorrelation(MessageCorrelation cid) {
                tweetId.set(cid.getMessageId());
                super.registerMessageCorrelation(cid);
View Full Code Here


        p.save();

//        final ThreadLocal<String> tweetId = new ThreadLocal<String>();

        ScriptusFacade f = new ScriptusFacade(datastore, c, m, config) {

            @Override
            public void registerMessageCorrelation(MessageCorrelation cid) {
//                tweetId.set(cid.getMessageId());
                super.registerMessageCorrelation(cid);
View Full Code Here

    p.save();

    Get g = (Get) r;
   
    g.visit(new ScriptusFacade(datastore, c, m, conf), p);
   
    p = datastore.getProcess(p.getPid());
   
    assertTrue("got content", p.getState() instanceof String);
   
View Full Code Here

       
        assertTrue("Correct result", r instanceof NormalTermination);
       
        NormalTermination n = (NormalTermination) r;

        r.visit(new ScriptusFacade(datastore, c, m, conf), p); //sould say

        assertEquals("Correct result", "result", n.getResult());
       
    }
View Full Code Here

       
        assertTrue("Correct result", r instanceof NormalTermination);
       
        NormalTermination n = (NormalTermination) r;

        r.visit(new ScriptusFacade(datastore, c, m, conf), p); //sould say

        assertEquals("Correct result", "aaarghs", n.getResult());
       
    }
View Full Code Here

   
    assertTrue("Correct result", r instanceof NormalTermination);
   
    NormalTermination n = (NormalTermination) r;

    r.visit(new ScriptusFacade(datastore, c, m, conf), p); //sould say

    assertEquals("Correct result", "result", n.getResult());
   
  }
View Full Code Here

  }

  @Override
  protected void setUp() throws Exception {
     
      ScriptusConfig c = new ScriptusConfig();
      c.init();
     
//      System.setProperty("DatastoreType", c.getDatastoreType().toString());

      appContext = new ClassPathXmlApplicationContext(new String[]{getConfigFile()}, false);
      appContext.getEnvironment().getPropertySources().addFirst(c.new ScriptusConfigPropertySource("ScriptusConfig", c));
View Full Code Here

       
    }
 
  public void test_encryptDecrypt() throws IOException {
   
      ScriptusConfig c = (ScriptusConfig) appContext.getBean("config");
   
      String s = UUID.randomUUID().toString();
     
      String k = c.getLatestKeyId();
     
      assertEquals("latest key chosen", "999999999999", k);
     
      byte[] ct = c.encrypt(s, k);
     
      String pt = c.decrypt(ct, k);
     
      assertEquals("encrypt-decrypt OK", s, pt);
   
  }
View Full Code Here

  }

  public void test_scheduleTask() throws IOException {
   
    ScriptusDatastore datastore = (ScriptusDatastore) appContext.getBean("datastore");
   
    Calendar then = Calendar.getInstance();
    then.add(Calendar.HOUR, 3);
   
    Wake w = new Wake(UUID.randomUUID(), 1234, then.getTimeInMillis());
   
    datastore.saveScheduledTask(w);
   
    List<ScheduledScriptAction> actions = datastore.getScheduledTasks(Calendar.getInstance());
   
    assertFalse("doesnt contain task in future", actions.contains(w));
   
    actions = datastore.getScheduledTasks(then);
   
    assertTrue("contains task in future",  actions.contains(w));
   
    boolean found = false;
   
    Wake neww = null;
   
    for(ScheduledScriptAction t : actions){
      if(t.equals(w)) {
        neww = (Wake) t;
        found = true;
        break;
      }
    }
   
    assertTrue("retrieved task", found);
   
    then.add(Calendar.HOUR, 1);
   
    actions = datastore.getScheduledTasks(then);
   
    assertTrue("list not empty",  ! actions.isEmpty());
   
    found = false;
   
    for(ScheduledScriptAction t : actions){
      if(t.equals(w)) {
        found = true;
        break;
      }
    }
   
    datastore.deleteScheduledTask(neww.getPid(), neww.getNonce());

    actions = datastore.getScheduledTasks(then);
   
    found = false;
   
    for(ScheduledScriptAction t : actions){
      if(t.equals(w)) {
View Full Code Here

public class Testcase_BootSpring extends BaseTestCase {

 
  public void test_doNothing() throws IOException {
    ScriptusDatastore datastore = (ScriptusDatastore) appContext.getBean("datastore");
  }
View Full Code Here

TOP

Related Classes of net.ex337.scriptus.model.api.Message

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.