|
| 1 | +/* |
| 2 | + * Copyright (C)2009 - SSHJ Contributors |
| 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 net.schmizz.sshj.sftp |
| 17 | + |
| 18 | +import spock.lang.Specification |
| 19 | +import spock.lang.Unroll |
| 20 | + |
| 21 | +class ResponseStatusCodeSpec extends Specification { |
| 22 | + |
| 23 | + @Unroll |
| 24 | + def "status #status should have status code #code"() { |
| 25 | + expect: |
| 26 | + code == status.getCode() |
| 27 | + |
| 28 | + where: |
| 29 | + status || code |
| 30 | + Response.StatusCode.UNKNOWN || -1 |
| 31 | + Response.StatusCode.OK || 0 |
| 32 | + Response.StatusCode.EOF || 1 |
| 33 | + Response.StatusCode.NO_SUCH_FILE || 2 |
| 34 | + Response.StatusCode.PERMISSION_DENIED || 3 |
| 35 | + Response.StatusCode.FAILURE || 4 |
| 36 | + Response.StatusCode.BAD_MESSAGE || 5 |
| 37 | + Response.StatusCode.NO_CONNECTION || 6 |
| 38 | + Response.StatusCode.CONNECITON_LOST || 7 |
| 39 | + Response.StatusCode.OP_UNSUPPORTED || 8 |
| 40 | + Response.StatusCode.INVALID_HANDLE || 9 |
| 41 | + Response.StatusCode.NO_SUCH_PATH || 10 |
| 42 | + Response.StatusCode.FILE_ALREADY_EXISTS || 11 |
| 43 | + Response.StatusCode.WRITE_PROTECT || 12 |
| 44 | + Response.StatusCode.NO_MEDIA || 13 |
| 45 | + Response.StatusCode.NO_SPACE_ON_FILESYSTEM || 14 |
| 46 | + Response.StatusCode.QUOTA_EXCEEDED || 15 |
| 47 | + Response.StatusCode.UNKNOWN_PRINCIPAL || 16 |
| 48 | + Response.StatusCode.LOCK_CONFLICT || 17 |
| 49 | + Response.StatusCode.DIR_NOT_EMPTY || 18 |
| 50 | + Response.StatusCode.NOT_A_DIRECTORY || 19 |
| 51 | + Response.StatusCode.INVALID_FILENAME || 20 |
| 52 | + Response.StatusCode.LINK_LOOP || 21 |
| 53 | + Response.StatusCode.CANNOT_DELETE || 22 |
| 54 | + Response.StatusCode.INVALID_PARAMETER || 23 |
| 55 | + Response.StatusCode.FILE_IS_A_DIRECTORY || 24 |
| 56 | + Response.StatusCode.BYTE_RANGE_LOCK_CONFLICT || 25 |
| 57 | + Response.StatusCode.BYTE_RANGE_LOCK_REFUSED || 26 |
| 58 | + Response.StatusCode.DELETE_PENDING || 27 |
| 59 | + Response.StatusCode.FILE_CORRUPT || 28 |
| 60 | + Response.StatusCode.OWNER_INVALID || 29 |
| 61 | + Response.StatusCode.GROUP_INVALID || 30 |
| 62 | + Response.StatusCode.NO_MATCHING_BYTE_RANGE_LOCK || 31 |
| 63 | + } |
| 64 | +} |
0 commit comments