Changeset 75 for trunk/src/test/java


Ignore:
Timestamp:
07/02/13 11:50:11 (11 years ago)
Author:
stoda
Message:

Multi problem solved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/java/omq/test/workspace/WorkspaceTest.java

    r74 r75  
    2020@RunWith(value = Parameterized.class)
    2121public class WorkspaceTest {
     22        private String type;
    2223        private static Broker serverBroker;
    2324        private static Broker clientBroker1;
    2425        private static Broker clientBroker2;
     26        private static RemoteWorkspaceImpl w1C1;
     27        private static RemoteWorkspaceImpl w3C1;
     28        private static RemoteWorkspaceImpl w1C2;
     29        private static RemoteWorkspaceImpl w2C2;
    2530        private static String[] workspaces = { "w1", "w2", "w3" };
    2631        private static RemoteWorkspace[] remoteWorks = new RemoteWorkspace[3];
     
    2833        // In this case the Constructor acts as a server
    2934        public WorkspaceTest(String type) throws Exception {
     35                this.type = type;
    3036                Properties env = new Properties();
    3137                env.setProperty(ParameterQueue.USER_NAME, "guest");
     
    7581                clientBroker2 = new Broker(env);
    7682
     83                // Client 1 will subscribe to changes in the workspaces w1 and w3
     84                w1C1 = new RemoteWorkspaceImpl();
     85                w3C1 = new RemoteWorkspaceImpl();
     86
     87                clientBroker1.bind(workspaces[0], w1C1);
     88                clientBroker1.bind(workspaces[2], w3C1);
     89
     90                // Client 2 will subscribe to changes in the workspaces w1 and w2
     91                w1C2 = new RemoteWorkspaceImpl();
     92                w2C2 = new RemoteWorkspaceImpl();
     93
     94                clientBroker2.bind(workspaces[0], w1C2);
     95                clientBroker2.bind(workspaces[1], w2C2);
     96
    7797                System.out.println("Client 1 & client2 started");
    7898        }
     
    85105        @Test
    86106        public void test() throws Exception {
     107                System.out.println("Starting test: " + type);
    87108                String expected = null;
    88109                String actual = null;
    89 
    90                 // Client 1 will subscribe to changes in the workspaces w1 and w3
    91                 RemoteWorkspaceImpl w1C1 = new RemoteWorkspaceImpl();
    92                 RemoteWorkspaceImpl w3C1 = new RemoteWorkspaceImpl();
    93 
    94                 clientBroker1.bind(workspaces[0], w1C1);
    95                 clientBroker1.bind(workspaces[2], w3C1);
    96 
    97                 // Client 2 will subscribe to changes in the workspaces w1 and w2
    98                 RemoteWorkspaceImpl w1C2 = new RemoteWorkspaceImpl();
    99                 RemoteWorkspaceImpl w2C2 = new RemoteWorkspaceImpl();
    100 
    101                 clientBroker2.bind(workspaces[0], w1C2);
    102                 clientBroker2.bind(workspaces[2], w2C2);
    103110
    104111                // The server will notify a change in the w2
Note: See TracChangeset for help on using the changeset viewer.