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

devonfw / IDEasy / 15217656699

23 May 2025 07:22PM UTC coverage: 67.562% (-0.3%) from 67.89%
15217656699

push

github

web-flow
#1332: fixed bug pattern, proper Step usage, allow running tool if plugin failed (#1334)

Co-authored-by: jan-vcapgemini <59438728+jan-vcapgemini@users.noreply.github.com>

3151 of 5064 branches covered (62.22%)

Branch coverage included in aggregate %.

8048 of 11512 relevant lines covered (69.91%)

3.07 hits per line

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

17.65
cli/src/main/java/com/devonfw/tools/ide/tool/DelegatingToolCommandlet.java
1
package com.devonfw.tools.ide.tool;
2

3
import java.util.Set;
4

5
import com.devonfw.tools.ide.common.Tag;
6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.environment.EnvironmentVariablesFiles;
8
import com.devonfw.tools.ide.process.ProcessContext;
9
import com.devonfw.tools.ide.step.Step;
10
import com.devonfw.tools.ide.version.VersionIdentifier;
11

12
/**
13
 * {@link ToolCommandlet} that delegates to another ToolCommandlet.
14
 *
15
 * @param <D> type of the {@link ToolCommandlet} to delegate to.
16
 */
17
public abstract class DelegatingToolCommandlet<D extends ToolCommandlet> extends ToolCommandlet {
18

19
  private final Class<D> delegateClass;
20

21
  /**
22
   * The constructor.
23
   *
24
   * @param context the {@link IdeContext}.
25
   * @param tool the {@link #getName() tool name}.
26
   * @param tags the {@link #getTags() tags} classifying the tool. Should be created via {@link Set#of(Object) Set.of} method.
27
   * @param delegateClass the {@link ToolCommandlet}.
28
   */
29
  public DelegatingToolCommandlet(IdeContext context, String tool, Set<Tag> tags, Class<D> delegateClass) {
30

31
    super(context, tool, tags);
5✔
32
    this.delegateClass = delegateClass;
3✔
33
  }
1✔
34

35
  private D getDelegate() {
36
    return getCommandlet(this.delegateClass);
×
37
  }
38

39
  @Override
40
  public final boolean install(boolean silent, ProcessContext processContext, Step step) {
41
    return getDelegate().install(silent, processContext, step);
×
42
  }
43

44
  @Override
45
  public VersionIdentifier getInstalledVersion() {
46
    return getDelegate().getInstalledVersion();
×
47
  }
48

49
  @Override
50
  public String getInstalledEdition() {
51
    return getDelegate().getInstalledEdition();
×
52
  }
53

54
  @Override
55
  public void uninstall() {
56
    getDelegate().uninstall();
×
57
  }
×
58

59
  @Override
60
  public void listEditions() {
61
    getDelegate().listEditions();
×
62
  }
×
63

64
  @Override
65
  public void listVersions() {
66
    getDelegate().listVersions();
×
67
  }
×
68

69
  @Override
70
  public void setVersion(VersionIdentifier version, boolean hint, EnvironmentVariablesFiles destination) {
71
    getDelegate().setVersion(version, hint, destination);
×
72
  }
×
73

74
  @Override
75
  public void setEdition(String edition, boolean hint, EnvironmentVariablesFiles destination) {
76
    getDelegate().setEdition(edition, hint, destination);
×
77
  }
×
78
}
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