diff options
author | Bruno Jofret <bruno.jofret@scilab.org> | 2007-06-19 06:27:48 +0000 |
---|---|---|
committer | Bruno Jofret <bruno.jofret@scilab.org> | 2007-06-19 06:27:48 +0000 |
commit | 4cfbb4bd837e9a5658b81c6611aada62a61cabdd (patch) | |
tree | a89c16d52fb5b61760581f0ba1b5d7b6cfecb3b6 /tests | |
parent | b0592276bcb6f6912eb1d7931d775a2716aaf3ef (diff) | |
download | scilab-4cfbb4bd837e9a5658b81c6611aada62a61cabdd.zip scilab-4cfbb4bd837e9a5658b81c6611aada62a61cabdd.tar.gz |
Moving tests for better mangement,
I'm not checkstyle-compliant now... But i'll do my best :-P
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GUI/addmember/AddMemberTest.java | 29 | ||||
-rw-r--r-- | tests/GUI/overview/Scilab.java (renamed from tests/GUI/Scilab.java) | 12 | ||||
-rw-r--r-- | tests/GUI/overview/ScilabConsoleTest.java (renamed from tests/GUI/ScilabConsoleTest.java) | 16 |
3 files changed, 42 insertions, 15 deletions
diff --git a/tests/GUI/addmember/AddMemberTest.java b/tests/GUI/addmember/AddMemberTest.java index 560b3e7..961d3af 100644 --- a/tests/GUI/addmember/AddMemberTest.java +++ b/tests/GUI/addmember/AddMemberTest.java | |||
@@ -22,15 +22,28 @@ import org.scilab.modules.gui.tab.Tab; | |||
22 | */ | 22 | */ |
23 | public class AddMemberTest { | 23 | public class AddMemberTest { |
24 | 24 | ||
25 | |||
26 | private static final String TAB_DEFAULT_TITLE = "Tab"; | ||
27 | private static final String START_BANNER = "-*- Starting Program -*-"; | ||
28 | private static final String STOP_BANNER = "-*- Stoping Program -*-"; | ||
29 | |||
30 | /** | ||
31 | * | ||
32 | */ | ||
33 | protected AddMemberTest() { | ||
34 | super(); | ||
35 | // TODO Auto-generated constructor stub | ||
36 | } | ||
37 | |||
25 | /** | 38 | /** |
26 | * We want to be able to add a Frame in a Tab | 39 | * We want to be able to add a Frame in a Tab |
27 | */ | 40 | */ |
28 | @Test | 41 | @Test |
29 | public void addFrameInTab() { | 42 | public void addFrameInTab() { |
30 | System.out.println("-*- Starting Program -*-"); | 43 | System.out.println(START_BANNER); |
31 | 44 | ||
32 | /* Tab Creation */ | 45 | /* Tab Creation */ |
33 | Tab tab = ScilabTab.createTab("Tab"); | 46 | Tab tab = ScilabTab.createTab(TAB_DEFAULT_TITLE); |
34 | 47 | ||
35 | /* Frame creation */ | 48 | /* Frame creation */ |
36 | Frame frame = ScilabFrame.createFrame(); | 49 | Frame frame = ScilabFrame.createFrame(); |
@@ -38,7 +51,7 @@ public class AddMemberTest { | |||
38 | // Try to add a Frame in a Tab | 51 | // Try to add a Frame in a Tab |
39 | assertTrue("_MUST_ be able to add a Frame in a Tab", tab.addMember(frame) != -1); | 52 | assertTrue("_MUST_ be able to add a Frame in a Tab", tab.addMember(frame) != -1); |
40 | assertTrue("_MUST_ be able to add a Frame in a Tab (Through the Bridge)", ScilabBridge.addMember(tab, frame) != -1); | 53 | assertTrue("_MUST_ be able to add a Frame in a Tab (Through the Bridge)", ScilabBridge.addMember(tab, frame) != -1); |
41 | System.out.println("-*- Stoping Program -*-"); | 54 | System.out.println(STOP_BANNER); |
42 | } | 55 | } |
43 | 56 | ||
44 | /** | 57 | /** |
@@ -46,7 +59,7 @@ public class AddMemberTest { | |||
46 | */ | 59 | */ |
47 | @Test | 60 | @Test |
48 | public void addConsoleInFrame() { | 61 | public void addConsoleInFrame() { |
49 | System.out.println("-*- Starting Program -*-"); | 62 | System.out.println(START_BANNER); |
50 | 63 | ||
51 | /* Frame creation */ | 64 | /* Frame creation */ |
52 | Frame frame = ScilabFrame.createFrame(); | 65 | Frame frame = ScilabFrame.createFrame(); |
@@ -57,7 +70,7 @@ public class AddMemberTest { | |||
57 | // Try to add a Console in a Frame | 70 | // Try to add a Console in a Frame |
58 | assertTrue("_MUST_NOT_ be able to add a Console in a Frame", frame.addMember(console) == -1); | 71 | assertTrue("_MUST_NOT_ be able to add a Console in a Frame", frame.addMember(console) == -1); |
59 | assertTrue("_MUST_ be able to add a Console in a Frame (Through the Bridge)", ScilabBridge.addMember(frame, console) != -1); | 72 | assertTrue("_MUST_ be able to add a Console in a Frame (Through the Bridge)", ScilabBridge.addMember(frame, console) != -1); |
60 | System.out.println("-*- Stoping Program -*-"); | 73 | System.out.println(STOP_BANNER); |
61 | } | 74 | } |
62 | 75 | ||
63 | /** | 76 | /** |
@@ -65,10 +78,10 @@ public class AddMemberTest { | |||
65 | */ | 78 | */ |
66 | @Test | 79 | @Test |
67 | public void addConsoleInTab() { | 80 | public void addConsoleInTab() { |
68 | System.out.println("-*- Starting Program -*-"); | 81 | System.out.println(START_BANNER); |
69 | 82 | ||
70 | /* Tab creation */ | 83 | /* Tab creation */ |
71 | Tab tab = ScilabTab.createTab("Tab"); | 84 | Tab tab = ScilabTab.createTab(TAB_DEFAULT_TITLE); |
72 | 85 | ||
73 | /* Console creation */ | 86 | /* Console creation */ |
74 | Console console = ScilabConsole.createConsole(); | 87 | Console console = ScilabConsole.createConsole(); |
@@ -76,7 +89,7 @@ public class AddMemberTest { | |||
76 | // Try to add a Console in a Tab | 89 | // Try to add a Console in a Tab |
77 | assertTrue("_MUST_ be able to add a Console in a Tab", tab.addMember(console) != -1); | 90 | assertTrue("_MUST_ be able to add a Console in a Tab", tab.addMember(console) != -1); |
78 | assertTrue("_MUST_ be able to add a Console in a Tab(Through the Bridge)", ScilabBridge.addMember(tab, console) != -1); | 91 | assertTrue("_MUST_ be able to add a Console in a Tab(Through the Bridge)", ScilabBridge.addMember(tab, console) != -1); |
79 | System.out.println("-*- Stoping Program -*-"); | 92 | System.out.println(STOP_BANNER); |
80 | } | 93 | } |
81 | 94 | ||
82 | } | 95 | } |
diff --git a/tests/GUI/Scilab.java b/tests/GUI/overview/Scilab.java index ac9ba0c..494e26a 100644 --- a/tests/GUI/Scilab.java +++ b/tests/GUI/overview/Scilab.java | |||
@@ -2,6 +2,7 @@ | |||
2 | /* Copyright INRIA 2007 */ | 2 | /* Copyright INRIA 2007 */ |
3 | 3 | ||
4 | 4 | ||
5 | package overview; | ||
5 | 6 | ||
6 | import java.awt.EventQueue; | 7 | import java.awt.EventQueue; |
7 | 8 | ||
@@ -36,6 +37,9 @@ public class Scilab { | |||
36 | private static final int DEFAULTWIDTH = 500; | 37 | private static final int DEFAULTWIDTH = 500; |
37 | private static final int DEFAULTHEIGHT = 500; | 38 | private static final int DEFAULTHEIGHT = 500; |
38 | 39 | ||
40 | private static final String X = "x"; | ||
41 | private static final String AND_Y_EQUAL = "and y="; | ||
42 | |||
39 | /** | 43 | /** |
40 | * Constructor | 44 | * Constructor |
41 | */ | 45 | */ |
@@ -71,24 +75,24 @@ public class Scilab { | |||
71 | /* DIMENSIONS */ | 75 | /* DIMENSIONS */ |
72 | /* Defaut dimensions */ | 76 | /* Defaut dimensions */ |
73 | Size windowSize = mainView.getDims(); | 77 | Size windowSize = mainView.getDims(); |
74 | System.out.println("Window Size = " + windowSize.getWidth() + "x" + windowSize.getHeight()); | 78 | System.out.println("Window Size = " + windowSize.getWidth() + X + windowSize.getHeight()); |
75 | /* User defined dimensions */ | 79 | /* User defined dimensions */ |
76 | Size newWindowSize = new Size(NEWWIDTH, NEWHEIGHT); | 80 | Size newWindowSize = new Size(NEWWIDTH, NEWHEIGHT); |
77 | mainView.setDims(newWindowSize); | 81 | mainView.setDims(newWindowSize); |
78 | windowSize = mainView.getDims(); | 82 | windowSize = mainView.getDims(); |
79 | System.out.println("-*- Has size changed ??? -*-"); | 83 | System.out.println("-*- Has size changed ??? -*-"); |
80 | System.out.println("Window Size: " + windowSize.getWidth() + "x" + windowSize.getHeight()); | 84 | System.out.println("Window Size: " + windowSize.getWidth() + X + windowSize.getHeight()); |
81 | 85 | ||
82 | /* POSITION */ | 86 | /* POSITION */ |
83 | /* Default position */ | 87 | /* Default position */ |
84 | Position windowPosition = mainView.getPosition(); | 88 | Position windowPosition = mainView.getPosition(); |
85 | System.out.println("Window Position: x=" + windowPosition.getX() + " and y=" + windowPosition.getY()); | 89 | System.out.println("Window Position: x=" + windowPosition.getX() + AND_Y_EQUAL + windowPosition.getY()); |
86 | /* User defined position */ | 90 | /* User defined position */ |
87 | Position newWindowPosition = new Position(NEWXPOSITION, NEWYPOSITION); | 91 | Position newWindowPosition = new Position(NEWXPOSITION, NEWYPOSITION); |
88 | mainView.setPosition(newWindowPosition); | 92 | mainView.setPosition(newWindowPosition); |
89 | windowPosition = mainView.getPosition(); | 93 | windowPosition = mainView.getPosition(); |
90 | System.out.println("-*- Has position changed ??? -*-"); | 94 | System.out.println("-*- Has position changed ??? -*-"); |
91 | System.out.println("New Window Position: x=" + windowPosition.getX() + " and y=" + windowPosition.getY()); | 95 | System.out.println("New Window Position: x=" + windowPosition.getX() + AND_Y_EQUAL + windowPosition.getY()); |
92 | 96 | ||
93 | /* TITLE */ | 97 | /* TITLE */ |
94 | System.out.println("Window Title: " + mainView.getTitle()); | 98 | System.out.println("Window Title: " + mainView.getTitle()); |
diff --git a/tests/GUI/ScilabConsoleTest.java b/tests/GUI/overview/ScilabConsoleTest.java index 30a5c83..499ce12 100644 --- a/tests/GUI/ScilabConsoleTest.java +++ b/tests/GUI/overview/ScilabConsoleTest.java | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | /* Copyright INRIA 2007 */ | 2 | /* Copyright INRIA 2007 */ |
3 | 3 | ||
4 | 4 | package overview; | |
5 | 5 | ||
6 | import java.awt.EventQueue; | 6 | import java.awt.EventQueue; |
7 | 7 | ||
@@ -27,6 +27,16 @@ import org.scilab.modules.gui.window.Window; | |||
27 | */ | 27 | */ |
28 | public class ScilabConsoleTest { | 28 | public class ScilabConsoleTest { |
29 | 29 | ||
30 | private static final int WIDTH = 200; | ||
31 | private static final int HEIGHT = 200; | ||
32 | |||
33 | /** | ||
34 | * Constructor | ||
35 | */ | ||
36 | protected ScilabConsoleTest() { | ||
37 | throw new UnsupportedOperationException(); /* Prevents calls from subclass */ | ||
38 | } | ||
39 | |||
30 | /** | 40 | /** |
31 | * Launch main Scilab | 41 | * Launch main Scilab |
32 | * @param args not used | 42 | * @param args not used |
@@ -82,9 +92,9 @@ public class ScilabConsoleTest { | |||
82 | mainView.draw(); | 92 | mainView.draw(); |
83 | 93 | ||
84 | JFrame f = new JFrame(); | 94 | JFrame f = new JFrame(); |
85 | f.setSize(200,200); | 95 | f.setSize(WIDTH, HEIGHT); |
86 | SwingScilabConsole content = new SwingScilabConsole(); | 96 | SwingScilabConsole content = new SwingScilabConsole(); |
87 | //f.add(content); | 97 | f.add(content); |
88 | f.setVisible(true); | 98 | f.setVisible(true); |
89 | 99 | ||
90 | // JyConsole console = new JyConsole(); | 100 | // JyConsole console = new JyConsole(); |