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

devonfw / IDEasy / 20003978026

07 Dec 2025 12:09PM UTC coverage: 70.101% (+0.2%) from 69.903%
20003978026

push

github

web-flow
#39: refactoring to extract package-manager logic out of node/npm (#1638)

3892 of 6090 branches covered (63.91%)

Branch coverage included in aggregate %.

9955 of 13663 relevant lines covered (72.86%)

3.15 hits per line

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

75.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

5
import com.devonfw.tools.ide.cli.CliProcessException;
6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.log.IdeLogLevel;
8
import com.devonfw.tools.ide.log.IdeSubLogger;
9

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

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

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

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

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

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

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

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

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

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

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

62
  /**
63
   * @return {@code true} if the {@link #getExitCode() exit code} indicates {@link #SUCCESS}, {@code false} otherwise (an error occurred).
64
   */
65
  default boolean isSuccessful() {
66

67
    return getExitCode() == SUCCESS;
7✔
68
  }
69

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

75
    return getSingleOutput(null);
×
76
  }
77

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

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

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

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

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

106
  /**
107
   * Logs output and error messages on the provided log level.
108
   *
109
   * @param level the {@link IdeLogLevel} to use e.g. IdeLogLevel.ERROR.
110
   * @param context the {@link IdeContext} to use.
111
   */
112
  void log(IdeLogLevel level, IdeContext context);
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 context the {@link IdeContext} to use.
119
   * @param errorLevel the {@link IdeLogLevel} to use for {@link #getErr()}.
120
   */
121
  void log(IdeLogLevel outLevel, IdeContext context, IdeLogLevel errorLevel);
122

123
  /**
124
   * Throws a {@link CliProcessException} if not {@link #isSuccessful() successful} and otherwise does nothing.
125
   *
126
   * @throws CliProcessException if not {@link #isSuccessful() successful}.
127
   */
128
  void failOnError() throws CliProcessException;
129
}
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