Package wpn.hdri.ss.client

Examples of wpn.hdri.ss.client.ClientFactory


        doReturn(true).when(client).checkAttribute(anyString());
        doThrow(new RuntimeException("Holy mother of God!")).when(client).readAttribute(anyString());
        doReturn(String.class).when(client).getAttributeClass(anyString());


        ClientsManager clientsManager = new ClientsManager(new ClientFactory() {
            @Override
            public Client createClient(String deviceName) {
                return client;
            }
        }) {
View Full Code Here


public class ITTangoClientTest {
    private final String name = "Test.Device";

    @Test(expected = ClientException.class)
    public void testReadAttr_Failed() throws Exception {
        ClientFactory factory = new ClientFactory();
        Client client = factory.createClient("sys/tg_test/1");

        client.readAttribute("throw_exception");
    }
View Full Code Here

        client.readAttribute("throw_exception");
    }

    //@Test
    public void testReadAttr_Position() throws Exception {
        ClientFactory factory = new ClientFactory();
        Client client = factory.createClient("tango://hasgksspp07oh1.desy.de:10000/p07/dcmmotor/dcm_2nd_yaw");
        for (int i = 0; i < 1000; i++) {
            Map.Entry<Double, Timestamp> result = client.<Double>readAttribute("Position");
            System.out.println(result.getKey());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testCheckAttribute_Success() {
        ClientFactory factory = new ClientFactory();
        Client client = factory.createClient("sys/tg_test/1");

        boolean result = client.checkAttribute("double_scalar_w");

        assertTrue(result);
    }
View Full Code Here

        assertTrue(result);
    }

    @Test
    public void testCheckAttribute_Failure() {
        ClientFactory factory = new ClientFactory();
        Client client = factory.createClient("sys/tg_test/1");

        boolean result = client.checkAttribute("double_scalar_wXXX");

        assertFalse(result);
    }
View Full Code Here

            throw new EngineInitializationException("Unable to initialize Engine:", e);
        }
    }

    public ClientsManager initializeClients() {
        ClientsManager clientsManager = new ClientsManager(new ClientFactory());
        for (Device dev : configuration.getDevices()) {
            String devName = dev.getName();
            try {
                LOGGER.info("Initializing client " + devName);
                clientsManager.initializeClient(devName);
View Full Code Here

    private Engine engine;

    public void bootstrap() {
        StatusServerConfiguration configuration = new ConfigurationBuilder().addDevice("fake").addAttributeToDevice("fake", "double", "poll", "last", 1, 0).build();

        ClientsManager clientsManager = new ClientsManager(new ClientFactory() {
            @Override
            public Client createClient(String deviceName) {
                Client client = mock(Client.class);
                try {
                    doReturn(true).when(client).checkAttribute("double");
View Full Code Here

TOP

Related Classes of wpn.hdri.ss.client.ClientFactory

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.