Mercurial > hg > RemoteEditor > REPSessionManager
view test/mergertest/TestUserSimulator.java @ 471:d2762d669617
sleep command to wait for singleton prevention
author | one |
---|---|
date | Tue, 12 Oct 2010 10:19:59 +0900 |
parents | 5c95a9020e31 |
children |
line wrap: on
line source
package test.mergertest; import java.util.LinkedList; import test.editortest.Logger; public class TestUserSimulator { /** * @param args */ public static void main(String[] args) { Logger.print(Thread.currentThread()); int en = 3; // int cn = 3; LinkedList<UserSimulator> userList = new LinkedList<UserSimulator>(); LinkedList<RemoteEditorSimulator> editorList = new LinkedList<RemoteEditorSimulator>(); for(int i = 0; i < en; i++){ RemoteEditorSimulator editor = new RemoteEditorSimulator(i); editorList.add(editor); userList.add(new UserSimulator(editor)); } for(UserSimulator user : userList){ user.start(); } for(UserSimulator user : userList){ try { user.join(); } catch (InterruptedException e) { e.printStackTrace(); } } for(RemoteEditorSimulator editor : editorList){ editor.display(); } } }