|
@@ -1,65 +0,0 @@
|
1
|
|
-/*
|
2
|
|
- * Copyright (c) 2006-2012 DMDirc Developers
|
3
|
|
- *
|
4
|
|
- * Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
|
- * of this software and associated documentation files (the "Software"), to deal
|
6
|
|
- * in the Software without restriction, including without limitation the rights
|
7
|
|
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
|
- * copies of the Software, and to permit persons to whom the Software is
|
9
|
|
- * furnished to do so, subject to the following conditions:
|
10
|
|
- *
|
11
|
|
- * The above copyright notice and this permission notice shall be included in
|
12
|
|
- * all copies or substantial portions of the Software.
|
13
|
|
- *
|
14
|
|
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
|
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
|
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
|
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
|
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
|
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
|
- * SOFTWARE.
|
21
|
|
- */
|
22
|
|
-
|
23
|
|
-package com.dmdirc.addons.redirect;
|
24
|
|
-
|
25
|
|
-import com.dmdirc.TestMain;
|
26
|
|
-import com.dmdirc.MessageTarget;
|
27
|
|
-import com.dmdirc.commandparser.CommandArguments;
|
28
|
|
-import com.dmdirc.commandparser.CommandManager;
|
29
|
|
-import com.dmdirc.commandparser.commands.context.ChatCommandContext;
|
30
|
|
-import com.dmdirc.commandparser.commands.global.Echo;
|
31
|
|
-import com.dmdirc.config.IdentityManager;
|
32
|
|
-import com.dmdirc.config.InvalidIdentityFileException;
|
33
|
|
-import com.dmdirc.interfaces.ui.InputWindow;
|
34
|
|
-
|
35
|
|
-import org.junit.BeforeClass;
|
36
|
|
-import org.junit.Ignore;
|
37
|
|
-import org.junit.Test;
|
38
|
|
-
|
39
|
|
-import static org.mockito.Mockito.*;
|
40
|
|
-
|
41
|
|
-public class RedirectCommandTest {
|
42
|
|
-
|
43
|
|
- @BeforeClass
|
44
|
|
- public static void setupClass() throws InvalidIdentityFileException {
|
45
|
|
- TestMain.getTestMain();
|
46
|
|
- CommandManager.getCommandManager().registerCommand(new Echo(), Echo.INFO);
|
47
|
|
- }
|
48
|
|
-
|
49
|
|
- @Ignore
|
50
|
|
- @Test
|
51
|
|
- public void testExecute() {
|
52
|
|
- final RedirectCommand command = new RedirectCommand();
|
53
|
|
- final MessageTarget target = mock(MessageTarget.class);
|
54
|
|
- final InputWindow window = mock(InputWindow.class);
|
55
|
|
- //when(window.getCommandParser()).thenReturn(parser);
|
56
|
|
- when(window.getContainer().getConfigManager()).thenReturn(
|
57
|
|
- IdentityManager.getIdentityManager().getGlobalConfiguration());
|
58
|
|
-
|
59
|
|
- command.execute(target, new CommandArguments("/redirect /echo test"),
|
60
|
|
- new ChatCommandContext(window.getContainer(), RedirectCommand.INFO, target));
|
61
|
|
-
|
62
|
|
- verify(target).sendLine("test");
|
63
|
|
- }
|
64
|
|
-
|
65
|
|
-}
|