Package org.apache.karaf.instance.core.internal

Examples of org.apache.karaf.instance.core.internal.InstanceServiceImpl$Task


  @Test
  public void testUpdate() throws Exception {
    XmlObject xmlObject = XmlObject.Factory.parse(this.getClass().getResource("/update.xml"));
    Assert.assertNotNull(xmlObject);
        System.out.println(xmlObject.toString());
        Task taskElement = Task.Factory.newInstance();
        TaskMetadata metadata = taskElement.addNewMetadata();
       
        metadata.set(new TaskUnmarshaller().expectElement(xmlObject, "taskMetadata"));
        System.out.println(taskElement.getMetadata().getTaskId());
  }
View Full Code Here


        if (!dap.prepare(command, null, params)) {
            return;
        }

        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        command.setInstanceService(instanceService);
        command.execute(null);
    }
View Full Code Here

        try {
            InstanceCommandSupport mockCommand = EasyMock.createStrictMock(InstanceCommandSupport.class);
            mockCommand.setInstanceService((InstanceService) EasyMock.anyObject());
            EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
                public Object answer() throws Throwable {
                    InstanceServiceImpl instanceService = (InstanceServiceImpl) EasyMock.getCurrentArguments()[0];
                    assertEquals(tempFile, instanceService.getStorageLocation());
                    instanceServices.add(instanceService);
                    return null;
                }
            });
           
            EasyMock.expect(mockCommand.execute(null)).andAnswer(new IAnswer<Object>() {
                public Object answer() throws Throwable {
                    // The Instances Service should be initialized at this point.
                    // One way to find this out is by reading out the port number
                    InstanceServiceImpl instanceService = instanceServices.get(0);
                    Field sshField = InstanceServiceImpl.class.getDeclaredField("defaultSshPortStart");
                    sshField.setAccessible(true);
                    assertEquals(1302, sshField.get(instanceService));
                    Field rmiRegistryField = InstanceServiceImpl.class.getDeclaredField("defaultRmiRegistryPortStart");
                    rmiRegistryField.setAccessible(true);
View Full Code Here

        if (!dap.prepare(command, null, params)) {
            return;
        }
               
        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        instanceService.init();
        command.setInstanceService(instanceService);
        command.execute(null);
    }
View Full Code Here

@Services(provides = @ProvideService(InstanceService.class))
public class Activator extends BaseActivator {

    @Override
    protected void doStart() throws Exception {
        InstanceService instanceService = new InstanceServiceImpl();
        register(InstanceService.class, instanceService);

        InstancesMBeanImpl mbean = new InstancesMBeanImpl(instanceService);
        registerMBean(mbean, "type=instance");
    }
View Full Code Here

        if (!dap.prepare(command, null, params)) {
            return;
        }

        InstanceServiceImpl instanceService = new InstanceServiceImpl();
        instanceService.setStorageLocation(storageFile);
        command.setInstanceService(instanceService);
        command.execute();
    }
View Full Code Here

        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("sequenceFlow.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        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 = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("association.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = getRootProcess(definitions);
        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 = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("associationOne.json"), "").getContents().get(0));
        Process process = getRootProcess(definitions);
        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 = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("associationBoth.json"), "").getContents().get(0));
        Process process = getRootProcess(definitions);
        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

TOP

Related Classes of org.apache.karaf.instance.core.internal.InstanceServiceImpl$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.