chrismair | 00dc7bd | 2014-05-11 21:21:28 +0000 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright 2007 the original author or authors.
|
| 3 | *
|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 | * you may not use this file except in compliance with the License.
|
| 6 | * You may obtain a copy of the License at
|
| 7 | *
|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 9 | *
|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 | * See the License for the specific language governing permissions and
|
| 14 | * limitations under the License.
|
| 15 | */
|
| 16 | package org.mockftpserver.core.command;
|
| 17 |
|
| 18 | /**
|
| 19 | * Tests for the UnsupportedCommandHandler class
|
| 20 | *
|
| 21 | * @author Chris Mair
|
| 22 | * @version $Revision$ - $Date$
|
| 23 | */
|
| 24 | public final class UnsupportedCommandHandlerTest extends AbstractCommandHandlerTestCase {
|
| 25 |
|
| 26 | private UnsupportedCommandHandler commandHandler;
|
| 27 | private Command command1;
|
| 28 |
|
| 29 | public void testHandleCommand() throws Exception {
|
| 30 |
|
| 31 | session.sendReply(ReplyCodes.COMMAND_NOT_SUPPORTED, replyTextFor(ReplyCodes.COMMAND_NOT_SUPPORTED));
|
| 32 | replay(session);
|
| 33 |
|
| 34 | commandHandler.handleCommand(command1, session);
|
| 35 | verify(session);
|
| 36 |
|
| 37 | verifyNumberOfInvocations(commandHandler, 1);
|
| 38 | verifyNoDataElements(commandHandler.getInvocation(0));
|
| 39 | }
|
| 40 |
|
| 41 | protected void setUp() throws Exception {
|
| 42 | super.setUp();
|
| 43 | commandHandler = new UnsupportedCommandHandler();
|
| 44 | commandHandler.setReplyTextBundle(replyTextBundle);
|
| 45 | command1 = new Command("XXXX", EMPTY);
|
| 46 | }
|
| 47 |
|
| 48 | } |