Package crud

Examples of crud.CRUD


    }

    public void testStart() throws Exception {
        ServiceReference<CRUD> serviceReference = domain.getServiceReference(CRUD.class, "CRUDServiceComponent");
        assertNotNull(serviceReference);
        CRUD service = serviceReference.getService();
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
    }
View Full Code Here


    }

    public void testStart() throws Exception {
        ServiceReference<CRUD> serviceReference = domain.getServiceReference(CRUD.class, "CRUDServiceComponent");
        assertNotNull(serviceReference);
        CRUD service = serviceReference.getService();
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
    }
View Full Code Here

       
        // At this point the domain contains my contribution, my composite and
        // it's started, my application code can start using it
       
        // Get the CRUDServiceComponent service
        CRUD service = domain.getService(CRUD.class, "CRUDServiceComponent");
       
        // Invoke the service
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
       
        // Stop my composite
        domainHelper.stopComposite(myComposite);
       
View Full Code Here

        domain = new DefaultSCADomain(getClass().getClassLoader(), getClass().getClassLoader(),
                                      "http://localhost", ".", "crud.composite");
    }

    public void testStart() throws Exception {
        CRUD service = domain.getService(CRUD.class, "CRUDServiceComponent");
        assertNotNull(service);
    }
View Full Code Here

    protected void tearDown() throws Exception {
        scaDomain.close();
    }

    public void test() throws Exception {
        CRUD crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent");
       
        String id = crudService.create("ABC");
        Object result = crudService.retrieve(id);
        assertEquals(result, "ABC");

        crudService.update(id, "EFG");
        result = crudService.retrieve(id);
        assertEquals(result, "EFG");
       
        crudService.delete(id);
        result = crudService.retrieve(id);
        assertNull(result);
    }
View Full Code Here

public class CRUDClient {

    public static void main(String[] args) throws Exception {

        SCADomain scaDomain = SCADomain.newInstance("crud.composite");
        CRUD crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent");
       
        String id = crudService.create("ABC");
        Object result = crudService.retrieve(id);
        System.out.println("Result from create: " + result);
        crudService.update(id, "EFG");
        result = crudService.retrieve(id);
        System.out.println("Result from update: " + result);
        crudService.delete(id);
        result = crudService.retrieve(id);
        if (result == null) {
            System.out.println("Result from delete: null");
        } else {
            System.out.println("Result from delete: should be null but was " + result);
        }
View Full Code Here

    }

    public void testStart() throws Exception {
        ServiceReference<CRUD> serviceReference = domain.getServiceReference(CRUD.class, "CRUDServiceComponent");
        assertNotNull(serviceReference);
        CRUD service = serviceReference.getService();
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
    }
View Full Code Here

    }

    public void testStart() throws Exception {
        ServiceReference<CRUD> serviceReference = domain.getServiceReference(CRUD.class, "CRUDServiceComponent");
        assertNotNull(serviceReference);
        CRUD service = serviceReference.getService();
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
    }
View Full Code Here

       
        // At this point the domain contains my contribution, my composite and
        // it's started, my application code can start using it
       
        // Get the CRUDServiceComponent service
        CRUD service = domain.getService(CRUD.class, "CRUDServiceComponent");
       
        // Invoke the service
        String id = service.create("ABC");
        Object result = service.retrieve(id);
        assertEquals("ABC", result);
        service.update(id, "EFG");
        result = service.retrieve(id);
        assertEquals("EFG", result);
        service.delete(id);
        result = service.retrieve(id);
        assertNull(result);
       
        // Stop my composite
        domainHelper.stopComposite(myComposite);
       
View Full Code Here

        domain = new DefaultSCADomain(getClass().getClassLoader(), getClass().getClassLoader(),
                                      "http://localhost", ".", "crud.composite");
    }

    public void testStart() throws Exception {
        CRUD service = domain.getService(CRUD.class, "CRUDServiceComponent");
        assertNotNull(service);
    }
View Full Code Here

TOP

Related Classes of crud.CRUD

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.