// Path: src/test/java/at/favre/tools/uberadb/MockAdbCmdProvider.java
// public class MockAdbCmdProvider implements CmdProvider {
//     private List<AdbDevice> devices = Collections.emptyList();
//     private List<String> installedPackages = Collections.emptyList();
//     private boolean returnsSuccess = true;
//     private boolean canRunCmd = true;
//     private List<Result> history = new ArrayList<>();
// 
//     public MockAdbCmdProvider(List<AdbDevice> devices, List<String> installedPackages, boolean returnsSuccess) {
//         this.devices = devices;
//         this.installedPackages = installedPackages;
//         this.returnsSuccess = returnsSuccess;
//     }
// 
//     public MockAdbCmdProvider(boolean canRunCmd) {
//         this.canRunCmd = canRunCmd;
//     }
// 
//     @Override
//     public Result runCmd(String[] args) {
//         String flatCmd = CmdUtil.concat(args, " ");
//         StringBuilder out = new StringBuilder();
// 
//         if (flatCmd.contains("devices -l")) {
//             out.append("List of devices attached\n");
//             for (AdbDevice device : devices) {
//                 out.append(device.serial).append("\tdevice product:").append(device.product).append(" model:").append(device.model).append(" device:").append(device.product).append("\n");
//             }
//         } else if (flatCmd.contains("pm list packages")) {
//             for (String installedPackage : installedPackages) {
//                 out.append("package:/data/app/").append(installedPackage).append("/base.apk=").append(installedPackage).append("\n");
//             }
//         } else if (flatCmd.contains("uninstall")) {
//             if (returnsSuccess) {
//                 out.append("Success");
//             } else {
//                 out.append("Failure [MOCK-ERROR-UNINSTALL]");
//             }
//         } else if (flatCmd.contains("install")) {
//             if (returnsSuccess) {
//                 out.append("Success");
//             } else {
//                 out.append("Failure [MOCK-ERROR-INSTALL]");
//             }
//         }
//         Result r = new Result(out.toString(), null, args, 0);
//         history.add(r);
//         return r;
//     }
// 
//     @Override
//     public boolean canRunCmd(String[] cmd) {
//         return canRunCmd;
//     }
// 
//     @Override
//     public List<Result> getHistory() {
//         return history;
//     }
// 
//     public int deviceCount() {
//         return devices.size();
//     }
// 
//     public int installedCount() {
//         return installedPackages.size();
//     }
// }


import at.favre.tools.uberadb.MockAdbCmdProvider;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
package at.favre.tools.uberadb.util;



public class CmdUtilTest {
    @Test
    public void testOs() {
        assertNotNull(CmdUtil.getOsType());
    }

    @Test
    public void testPathShouldBeNull() {
        assertNull(CmdUtil.checkAndGetFromPATHEnvVar(
// Path: src/test/java/at/favre/tools/uberadb/MockAdbCmdProvider.java
// public class MockAdbCmdProvider implements CmdProvider {
//     private List<AdbDevice> devices = Collections.emptyList();
//     private List<String> installedPackages = Collections.emptyList();
//     private boolean returnsSuccess = true;
//     private boolean canRunCmd = true;
//     private List<Result> history = new ArrayList<>();
// 
//     public MockAdbCmdProvider(List<AdbDevice> devices, List<String> installedPackages, boolean returnsSuccess) {
//         this.devices = devices;
//         this.installedPackages = installedPackages;
//         this.returnsSuccess = returnsSuccess;
//     }
// 
//     public MockAdbCmdProvider(boolean canRunCmd) {
//         this.canRunCmd = canRunCmd;
//     }
// 
//     @Override
//     public Result runCmd(String[] args) {
//         String flatCmd = CmdUtil.concat(args, " ");
//         StringBuilder out = new StringBuilder();
// 
//         if (flatCmd.contains("devices -l")) {
//             out.append("List of devices attached\n");
//             for (AdbDevice device : devices) {
//                 out.append(device.serial).append("\tdevice product:").append(device.product).append(" model:").append(device.model).append(" device:").append(device.product).append("\n");
//             }
//         } else if (flatCmd.contains("pm list packages")) {
//             for (String installedPackage : installedPackages) {
//                 out.append("package:/data/app/").append(installedPackage).append("/base.apk=").append(installedPackage).append("\n");
//             }
//         } else if (flatCmd.contains("uninstall")) {
//             if (returnsSuccess) {
//                 out.append("Success");
//             } else {
//                 out.append("Failure [MOCK-ERROR-UNINSTALL]");
//             }
//         } else if (flatCmd.contains("install")) {
//             if (returnsSuccess) {
//                 out.append("Success");
//             } else {
//                 out.append("Failure [MOCK-ERROR-INSTALL]");
//             }
//         }
//         Result r = new Result(out.toString(), null, args, 0);
//         history.add(r);
//         return r;
//     }
// 
//     @Override
//     public boolean canRunCmd(String[] cmd) {
//         return canRunCmd;
//     }
// 
//     @Override
//     public List<Result> getHistory() {
//         return history;
//     }
// 
//     public int deviceCount() {
//         return devices.size();
//     }
// 
//     public int installedCount() {
//         return installedPackages.size();
//     }
// }


// Path: src/test/java/at/favre/tools/uberadb/util/CmdUtilTest.java
import at.favre.tools.uberadb.MockAdbCmdProvider;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

package at.favre.tools.uberadb.util;



public class CmdUtilTest {
    @Test
    public void testOs() {
        assertNotNull(CmdUtil.getOsType());
    }

    @Test
    public void testPathShouldBeNull() {
        assertNull(CmdUtil.checkAndGetFromPATHEnvVar(
                new MockAdbCmdProvider(false)