View Javadoc
1   /*
2    * Copyright (C) 2010-2014 Hamburg Sud and the 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 org.aludratest.service.cmdline;
17  
18  import org.aludratest.impl.log4testing.ElementName;
19  import org.aludratest.impl.log4testing.ElementType;
20  import org.aludratest.impl.log4testing.TechnicalLocator;
21  import org.aludratest.service.Verification;
22  import org.databene.commons.Validator;
23  
24  /** {@link Verification} interface for the {@link CommandLineService}.
25   * @author Volker Bergmann */
26  public interface CommandLineVerification extends Verification {
27  
28      /** Asserts that the next line of the specified process' standard output is accepted by the {@link Validator}.
29       * @param processType the process type
30       * @param processName the process name
31       * @param processId the internal id of the process
32       * @param validator */
33      void assertNextLineOfStdOutMatches(@ElementType String processType, @ElementName String processName,
34              @TechnicalLocator int processId, Validator<String> validator);
35  
36      /** Asserts that the specified process has no more standard output.
37       * @param processType the process type
38       * @param processName the process name
39       * @param processId the internal id of the process */
40      void assertEmptyStdOut(@ElementType String processType, @ElementName String processName, @TechnicalLocator int processId);
41  
42      /** Asserts that the next line of the specified process' error output is accepted by the {@link Validator}.
43       * @param processType the process type
44       * @param processName the process name
45       * @param processId the internal id of the process
46       * @param validator */
47      void assertNextLineOfErrOutMatches(@ElementType String processType, @ElementName String processName,
48              @TechnicalLocator int processId, Validator<String> validator);
49  
50      /** Asserts that the specified process has no more error output.
51       * @param processType the process type
52       * @param processName the process name
53       * @param processId the internal id of the process */
54      void assertEmptyErrOut(@ElementType String processType, @ElementName String processName, @TechnicalLocator int processId);
55  
56      /** Asserts that the referenced process' exit value equals the expected value.
57       * @param processType the process type
58       * @param processName the process name
59       * @param processId the internal id of the process
60       * @param expectedValue */
61      void assertExitCodeEquals(@ElementType String processType, @ElementName String processName, @TechnicalLocator int processId,
62              int expectedValue);
63  
64  }