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

devonfw / IDEasy / 21174441650

20 Jan 2026 02:06PM UTC coverage: 70.447% (-0.02%) from 70.471%
21174441650

push

github

web-flow
#1679: fix determine version if npm list has exit code 1 (#1681)

4031 of 6308 branches covered (63.9%)

Branch coverage included in aggregate %.

10479 of 14289 relevant lines covered (73.34%)

3.18 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.context.IdeContext;
8
import com.devonfw.tools.ide.log.IdeLogLevel;
9
import com.devonfw.tools.ide.log.IdeSubLogger;
10

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

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

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

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

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

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

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

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

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

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

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

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

70
    return getExitCode() == SUCCESS;
×
71
  }
72

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

78
    return getSingleOutput(null);
×
79
  }
80

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

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

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

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

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

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

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

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