1 | // Module : $RCSfile: CMDlistCommandsTest.java,v $ |
---|
2 | // Version : $Revision: 0.0 $ $Author: pharms $ $Date: 28.08.2012 $ |
---|
3 | // Project : quest-ui-core-test |
---|
4 | // Creation : 2012 by pharms |
---|
5 | // Copyright : Patrick Harms, 2012 |
---|
6 | package de.ugoe.cs.util.console.defaultcommands; |
---|
7 | |
---|
8 | import static org.junit.Assert.*; |
---|
9 | |
---|
10 | import java.util.ArrayList; |
---|
11 | import java.util.List; |
---|
12 | |
---|
13 | import org.junit.Before; |
---|
14 | import org.junit.Test; |
---|
15 | |
---|
16 | import de.ugoe.cs.util.console.CommandExecuter; |
---|
17 | import de.ugoe.cs.util.console.Console; |
---|
18 | import de.ugoe.cs.util.console.defaultcommands.CMDlistCommands; |
---|
19 | import de.ugoe.cs.util.console.listener.IOutputListener; |
---|
20 | |
---|
21 | /** |
---|
22 | * <p> |
---|
23 | * TODO comment |
---|
24 | * </p> |
---|
25 | * |
---|
26 | * @version $Revision: $ $Date: 28.08.2012$ |
---|
27 | * @author 2012, last modified by $Author: pharms$ |
---|
28 | */ |
---|
29 | public class CMDlistCommandsTest implements IOutputListener { |
---|
30 | |
---|
31 | /** */ |
---|
32 | private List<String> commands = new ArrayList<String>(); |
---|
33 | |
---|
34 | /** |
---|
35 | * |
---|
36 | */ |
---|
37 | @Before |
---|
38 | public void setUp() throws Exception { |
---|
39 | Console.getInstance().registerOutputListener(this); |
---|
40 | } |
---|
41 | |
---|
42 | /** |
---|
43 | * <p> |
---|
44 | * TODO: comment |
---|
45 | * </p> |
---|
46 | * |
---|
47 | */ |
---|
48 | @Test |
---|
49 | public void test() { |
---|
50 | CommandExecuter.getInstance().addCommandPackage("de.ugoe.cs.util.console.defaultcommands"); |
---|
51 | CMDlistCommands command = new CMDlistCommands(); |
---|
52 | command.run(null); |
---|
53 | |
---|
54 | assertTrue(commands.size() > 0); |
---|
55 | |
---|
56 | for (String cmd : commands) { |
---|
57 | assertNotNull(cmd); |
---|
58 | assertTrue(cmd.length() > 0); |
---|
59 | System.out.print(cmd); |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | /* (non-Javadoc) |
---|
64 | * @see de.ugoe.cs.util.console.listener.IOutputListener#outputMsg(java.lang.String) |
---|
65 | */ |
---|
66 | @Override |
---|
67 | public void outputMsg(String newMessage) { |
---|
68 | commands.add(newMessage); |
---|
69 | } |
---|
70 | |
---|
71 | } |
---|