• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 22284264868

22 Feb 2026 08:00PM UTC coverage: 70.75% (+0.3%) from 70.474%
22284264868

Pull #1714

github

web-flow
Merge 98f01421f into 379acdc9d
Pull Request #1714: #404: #1713: advanced logging

4063 of 6346 branches covered (64.02%)

Branch coverage included in aggregate %.

10636 of 14430 relevant lines covered (73.71%)

3.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
cli/src/main/java/com/devonfw/tools/ide/process/ProcessResult.java
1
package com.devonfw.tools.ide.process;
2

3
import java.util.List;
4
import java.util.function.Predicate;
5

6
import com.devonfw.tools.ide.cli.CliProcessException;
7
import com.devonfw.tools.ide.log.IdeLogLevel;
8

9
/**
10
 * Result of a {@link Process} execution.
11
 *
12
 * @see ProcessContext#run()
13
 */
14
public interface ProcessResult {
15

16
  /** Return code for success. */
17
  int SUCCESS = 0;
18

19
  /** Return code if IDE_HOME is required but not found. */
20
  int NO_IDE_HOME = 2;
21

22
  /** Return code if IDE_ROOT is required but not found. */
23
  int NO_IDE_ROOT = 3;
24

25
  /** Return code if tool was requested that is not installed. */
26
  int TOOL_NOT_INSTALLED = 4;
27

28
  /** Return code to exit if condition not met */
29
  int EXIT = 17;
30

31
  /**
32
   * Return code to abort gracefully.
33
   *
34
   * @see com.devonfw.tools.ide.cli.CliAbortException
35
   */
36
  int ABORT = 22;
37

38
  /**
39
   * Return code if {@link com.devonfw.tools.ide.context.IdeContext#isOffline() offline} but network is required for requested operation.
40
   *
41
   * @see com.devonfw.tools.ide.cli.CliOfflineException
42
   */
43
  int OFFLINE = 23;
44

45
  /**
46
   * @return the filename of the executable that was run (e.g. "git").
47
   * @see #getCommand()
48
   */
49
  String getExecutable();
50

51
  /**
52
   * @return the full command that was executed (e.g. "git rev-parse HEAD").
53
   */
54
  String getCommand();
55

56
  /**
57
   * @return the exit code. Will be {@link #SUCCESS} on successful completion of the {@link Process}.
58
   */
59
  int getExitCode();
60

61
  /**
62
   * @return {@code true} if the process execution was successful, {@code false} otherwise (an error occurred). By default, success means the
63
   *     {@link #getExitCode() exit code} was {@link #SUCCESS}.
64
   * @see ProcessContext#withExitCodeAcceptor(Predicate)
65
   */
66
  default boolean isSuccessful() {
67

68
    return getExitCode() == SUCCESS;
×
69
  }
70

71
  /**
72
   * @return the first captured standard out. Will be {@code null} if not captured but redirected.
73
   */
74
  default String getSingleOutput() {
75

76
    return getSingleOutput(null);
×
77
  }
78

79
  /**
80
   * @param logLevel the {@link IdeLogLevel} to use.
81
   * @return the first captured standard out. Will be {@code null} if not captured but redirected.
82
   */
83
  String getSingleOutput(IdeLogLevel logLevel);
84

85
  /**
86
   * @param logLevel the {@link IdeLogLevel} to use.
87
   * @return the first captured standard out. Will be {@code null} if not captured but redirected.
88
   */
89
  List<String> getOutput(IdeLogLevel logLevel);
90

91
  /**
92
   * @return the {@link List} with the lines captured on standard out. Will be {@code null} if not captured but redirected.
93
   */
94
  List<String> getOut();
95

96
  /**
97
   * @return the {@link List} with the lines captured on standard error. Will be {@code null} if not captured but redirected.
98
   */
99
  List<String> getErr();
100

101
  /**
102
   * @return the {@link List} with {@link OutputMessage} that captured on standard out and standard error lines. Will be {@code null} if not captured but
103
   *     redirected.
104
   */
105
  List<OutputMessage> getOutputMessages();
106

107
  /**
108
   * Logs output and error messages on the provided log level.
109
   *
110
   * @param level the {@link IdeLogLevel} to use e.g. IdeLogLevel.ERROR.
111
   */
112
  void log(IdeLogLevel level);
113

114
  /**
115
   * Logs output and error messages on the provided log level.
116
   *
117
   * @param outLevel the {@link IdeLogLevel} to use for {@link #getOut()}.
118
   * @param errorLevel the {@link IdeLogLevel} to use for {@link #getErr()}.
119
   */
120
  void log(IdeLogLevel outLevel, IdeLogLevel errorLevel);
121

122
  /**
123
   * Throws a {@link CliProcessException} if not {@link #isSuccessful() successful} and otherwise does nothing.
124
   *
125
   * @throws CliProcessException if not {@link #isSuccessful() successful}.
126
   */
127
  void failOnError() throws CliProcessException;
128
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc