Package org.jgroups.stack

Examples of org.jgroups.stack.AckMcastSenderWindow$Task


      super(fp, "Task", "Create Task");
    }

    @Override
    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Task Name");
      return task;
    }
View Full Code Here


    public CreateTaskFeature(IFeatureProvider fp) {
      super(fp, "Log Task", "Create Log Task");
    }

    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Log Task");
      ArrayList<EStructuralFeature> attributes = Bpmn2Preferences
          .getAttributes(task.eClass());
      for (EStructuralFeature eStructuralFeature : attributes) {
        if (eStructuralFeature.getName().equals("taskName"))
          task.eSet(eStructuralFeature, "log");
      }
      return task;
    }
View Full Code Here

    public CreateTaskFeature(IFeatureProvider fp) {
      super(fp, "Email Task", "Create Email Task");
    }

    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Email Task");
      ArrayList<EStructuralFeature> attributes = Bpmn2Preferences
          .getAttributes(task.eClass());
      for (EStructuralFeature eStructuralFeature : attributes) {
        if (eStructuralFeature.getName().equals("taskName"))
          task.eSet(eStructuralFeature, "email");
      }
      return task;
    }
View Full Code Here

        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("sequenceFlow.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = (Process) definitions.getRootElements().get(0);
        assertTrue(process.getFlowElements().get(0) instanceof Task);
        Task task = (Task) process.getFlowElements().get(0);
        assertEquals("task1", task.getName());
        Task task2 = (Task) process.getFlowElements().get(1);
        assertEquals("task2", task2.getName());
        SequenceFlow flow = (SequenceFlow) process.getFlowElements().get(2);
        assertEquals("seqFlow", flow.getName());
        assertEquals(task, flow.getSourceRef());
        assertEquals(task2, flow.getTargetRef());
        definitions.eResource().save(System.out, Collections.emptyMap());
View Full Code Here

    public void testAssociationUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("association.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.NONE, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testAssociationUnidirectionalUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("associationOne.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.ONE, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testAssociationBidirectionalUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("associationBoth.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.BOTH, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testDoubleLaneUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("doubleLane.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        assertTrue(process.getLaneSets().size() == 1);
        assertTrue(process.getLaneSets().get(0).getLanes().size() == 1);
        Lane firstLane = process.getLaneSets().get(0).getLanes().get(0);
        assertEquals("First lane", firstLane.getName());
        Lane secondLane = firstLane.getChildLaneSet().getLanes().get(0);
View Full Code Here


    @BeforeMethod
    void setUp() throws Exception {
        _cmd=new Cmd();
        _win=new AckMcastSenderWindow(_cmd);

    }
View Full Code Here

        _win.stop();
    }


    public static void testRemove() throws UnknownHostException {
        AckMcastSenderWindow mywin=new AckMcastSenderWindow(new MyCommand(), new StaticInterval(1000, 2000, 3000));
        Address sender1=new IpAddress("127.0.0.1", 10000);
        Address sender2=new IpAddress("127.0.0.1", 10001);
        Address sender3=new IpAddress("127.0.0.1", 10002);
        Vector senders=new Vector();
        Message msg=new Message();
        long seqno=322649;

        senders.addElement(sender1);
        senders.addElement(sender2);
        senders.addElement(sender3);

        mywin.add(seqno, msg, (Vector)senders.clone()); // clone() for the fun of it...

        mywin.ack(seqno, sender1);
        mywin.ack(seqno, sender2);

        System.out.println("entry is " + mywin.printDetails(seqno));
        Assert.assertEquals(3, mywin.getNumberOfResponsesExpected(seqno));
        Assert.assertEquals(2, mywin.getNumberOfResponsesReceived(seqno));
        mywin.waitUntilAllAcksReceived(4000);
        mywin.suspect(sender3);
        Assert.assertEquals(0, mywin.size());
    }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.AckMcastSenderWindow$Task

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.