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

devonfw / IDEasy / 9907372175

12 Jul 2024 11:49AM UTC coverage: 61.142% (-0.02%) from 61.162%
9907372175

push

github

hohwille
fixed tests

1997 of 3595 branches covered (55.55%)

Branch coverage included in aggregate %.

5296 of 8333 relevant lines covered (63.55%)

2.8 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/tool/PackageManager.java
1
package com.devonfw.tools.ide.tool;
2

3
/**
4
 * Represents a package manager used for managing software packages.
5
 */
6
public enum PackageManager {
×
7
  APT, ZYPPER, YUM, DNF;
×
8

9
  /**
10
   * Extracts the package manager from the provided command string.
11
   *
12
   * @param command The command string to extract the package manager from.
13
   * @return The corresponding {@code PackageManager} based on the provided command string.
14
   * @throws IllegalArgumentException If the command string does not contain a recognized package manager.
15
   */
16
  public static PackageManager extractPackageManager(String command) {
17

18
    if (command.contains("apt")) {
×
19
      return APT;
×
20
    }
21
    if (command.contains("yum")) {
×
22
      return YUM;
×
23
    }
24
    if (command.contains("zypper")) {
×
25
      return ZYPPER;
×
26
    }
27
    if (command.contains("dnf")) {
×
28
      return DNF;
×
29
    }
30

31
    throw new IllegalArgumentException("Unknown package manager in command: " + command);
×
32
  }
33

34
  public String getBinaryName() {
35

36
    return name().toLowerCase();
×
37
  }
38
}
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