# HG changeset patch # User kono # Date 1222637653 -32400 # Node ID 9e162e0a114f45bbf340a973630db8558e197cb3 # Parent 4b773ba03556595330896697ccf0e454fa3649a6 *** empty log message *** diff -r 4b773ba03556 -r 9e162e0a114f test/sematest/TestGUI.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sematest/TestGUI.java Mon Sep 29 06:34:13 2008 +0900 @@ -0,0 +1,49 @@ +package test.sematest; + +import java.util.LinkedList; + +import rep.Editor; +import rep.SelectButtonEvent; +import rep.Session; +import rep.SessionManagerEvent; +import rep.SessionManagerEventListener; +import rep.SessionManagerGUI; + +/** + * @author kono + * Dummy GUI for test + * + * perform auto select operation + */ + +public class TestGUI implements SessionManagerGUI { + public LinkedList slist; + public LinkedList elist; + SessionManagerEventListener manager; + int count = 0; + + public TestGUI(SessionManagerEventListener manager) { + this.manager = manager; + } + + public void invokeLater(Runnable doRun) { + doRun.run(); + } + + public void update(LinkedList slist, LinkedList elist) { + this.slist = slist; + this.elist = elist; + // fair and deterministic select session for an empty editor + if (slist.size()==0) return; + Session s = slist.get(count++ % slist.size()); + for(Editor e :elist) { + if (!e.hasSession()) { + SessionManagerEvent event = new SelectButtonEvent(e, s, manager); + System.out.println("Select session "+s.getSID()+" and editor "+e.getEID()); + manager.buttonPressed(event); + s = slist.get(count++ % slist.size()); + } + } + } + +} diff -r 4b773ba03556 -r 9e162e0a114f test/sematest/TestSessionManager.java --- a/test/sematest/TestSessionManager.java Mon Sep 29 06:33:11 2008 +0900 +++ b/test/sematest/TestSessionManager.java Mon Sep 29 06:34:13 2008 +0900 @@ -68,15 +68,11 @@ REPServerSocketChannel.isSimulation = true; TestSessionManager test = new TestSessionManager(1, 0, 2); logger.setLogLevel(5); - try { - test.startTest(); - } catch (IOException e) { - } catch (InterruptedException e) { - } + test.startTest(); } - private void startTest() throws IOException, InterruptedException { + private void startTest() { int i = 0; for(SessionManager master:sessionManagers) { i = startSessionManager(master,i, masterPort + i); diff -r 4b773ba03556 -r 9e162e0a114f test/sematest/testGUI.java --- a/test/sematest/testGUI.java Mon Sep 29 06:33:11 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -package test.sematest; - -import java.util.LinkedList; - -import rep.Editor; -import rep.SelectButtonEvent; -import rep.Session; -import rep.SessionManagerEvent; -import rep.SessionManagerEventListener; -import rep.SessionManagerGUI; - -/** - * @author kono - * Dummy GUI for test - * - * perform auto select operation - */ - -public class testGUI implements SessionManagerGUI { - public LinkedList slist; - public LinkedList elist; - SessionManagerEventListener manager; - int count = 0; - - public testGUI(SessionManagerEventListener manager) { - this.manager = manager; - } - - public void invokeLater(Runnable doRun) { - doRun.run(); - } - - public void update(LinkedList slist, LinkedList elist) { - this.slist = slist; - this.elist = elist; - // fair and deterministic select session for an empty editor - if (slist.size()==0) return; - Session s = slist.get(count++ % slist.size()); - for(Editor e :elist) { - if (!e.hasSession()) { - SessionManagerEvent event = new SelectButtonEvent(e, s, manager); - System.out.println("Select session "+s.getSID()+" and editor "+e.getEID()); - manager.buttonPressed(event); - s = slist.get(count++ % slist.size()); - } - } - } - -}