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

devonfw / IDEasy / 8144002629

04 Mar 2024 04:56PM UTC coverage: 58.928% (+0.7%) from 58.254%
8144002629

push

github

web-flow
#208: improve test infrastructure # 219: fix wrong executable (#238)

* Add first implementation

* Add javadoc

* Add javadoc

* Using target path instead of ressource path to make sure one-to-one copy of set up folders is used

* Add JavaDoc and mac mock program

* Add support for multiple dependencies while testing

* Minor changes

* Modify mock programs for testing

* Refactored example JmcTest

* Add possibility to set execution path by using the context

* Reenable test after related issue 228 has been merged

* Replace ternary with regular if

* Add missing javadoc

* Add missing javadoc

* remove unnecessary semicolon

* Fix spelling typo

* Minor test changes

* Refactoring FileExtractor class for more modularity

* using const

* Add missing extensions

* Remove unnecessary execption declaration and minor rename

* Fix spelling

* Add javadoc

* Forget dot

* minor change

* Revert "minor change"

This reverts commit ec81c3ce6.

* Revert "Merge branch 'main' into feature/208-MockOutToolRepoRefactorTestInfra"

This reverts commit d58847230, reversing
changes made to f38b3105f.

* Revert "Revert "Merge branch 'main' into feature/208-MockOutToolRepoRefactorTestInfra""

This reverts commit 3e49a0b3d.

* Revert "Revert "minor change""

This reverts commit 2f7b94624.

* fix typo

* #208: review and complete rework

* #208: improved system path

* #208: found and fixed bug on windows

* #208: improve OS mocking

* #208: improve test logging

reveal logs/errors so the developer actually sees what is happening instead of leaving them in the dark

* #208: improve OS detection

* #208: fixed

found and fixed bug in MacOS app detection for JMC, fixed copy file to folder bug, moved !extract logic back to FileAccess, f... (continued)

1580 of 2930 branches covered (53.92%)

Branch coverage included in aggregate %.

4047 of 6619 relevant lines covered (61.14%)

2.65 hits per line

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

72.41
cli/src/main/java/com/devonfw/tools/ide/log/IdeSubLoggerOut.java
1
package com.devonfw.tools.ide.log;
2

3
import java.io.IOException;
4

5
/**
6
 * Default implementation of {@link IdeSubLogger} that can write to an {@link Appendable} such as {@link System#out} or
7
 * in case of testing a {@link java.io.StringWriter}.
8
 */
9
public class IdeSubLoggerOut extends AbstractIdeSubLogger {
10

11
  private final Appendable out;
12

13
  private final boolean colored;
14

15
  /**
16
   * The constructor.
17
   *
18
   * @param level the {@link #getLevel() log-level}.
19
   * @param out the {@link Appendable} to {@link Appendable#append(CharSequence) write} log messages to.
20
   * @param colored - {@code true} for colored output according to {@link IdeLogLevel}, {@code false} otherwise.
21
   */
22
  public IdeSubLoggerOut(IdeLogLevel level, Appendable out, boolean colored) {
23

24
    super(level);
3✔
25
    if (out == null) {
2!
26
      // this is on of the very rare excuses where System.out or System.err is allowed to be used!
27
      if (level == IdeLogLevel.ERROR) {
3✔
28
        this.out = System.err;
4✔
29
      } else {
30
        this.out = System.out;
4✔
31
      }
32
    } else {
33
      this.out = out;
×
34
    }
35
    this.colored = colored;
3✔
36
  }
1✔
37

38
  @Override
39
  public boolean isEnabled() {
40

41
    return true;
×
42
  }
43

44
  @Override
45
  public void log(String message) {
46

47
    try {
48
      String startColor = null;
2✔
49
      if (this.colored) {
3!
50
        startColor = this.level.getStartColor();
4✔
51
        this.out.append(startColor);
5✔
52
      }
53
      this.out.append(message);
5✔
54
      if (startColor != null) {
2!
55
        this.out.append(this.level.getEndColor());
×
56
      }
57
      this.out.append("\n");
5✔
58
    } catch (IOException e) {
×
59
      throw new IllegalStateException("Failed to log message: " + message, e);
×
60
    }
1✔
61
  }
1✔
62

63
}
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