@Test(expected = Exception.class) public void isSeLinuxEnforced_null() throws Exception { IDevice device = null; AndroidDeviceImpl androidDeviceImpl = (AndroidDeviceImpl)context.getBean(IAndroidDevice.class); boolean enforcement = androidDeviceImpl.isSeLinuxEnforced(device); assertTrue(enforcement == true); }
@Override public boolean isSeLinuxEnforced(IDevice device) throws Exception { if (device == null) { throw new Exception("device is null"); } ShellOutputReceiver shSELinux = new ShellOutputReceiver(); device.executeShellCommand("getenforce", shSELinux); boolean seLinuxEnforced = shSELinux.isSELinuxEnforce(); LOGGER.info("--->seLinuxEnforced:" + seLinuxEnforced); return seLinuxEnforced; }
AndroidDeviceImpl implements IAndroidDevice { @Override public boolean isSeLinuxEnforced(IDevice device) throws Exception { if (device == null) { throw new Exception("device is null"); } ShellOutputReceiver shSELinux = new ShellOutputReceiver(); device.executeShellCommand("getenforce", shSELinux); boolean seLinuxEnforced = shSELinux.isSELinuxEnforce(); LOGGER.info("--->seLinuxEnforced:" + seLinuxEnforced); return seLinuxEnforced; } }
AndroidDeviceImpl implements IAndroidDevice { @Override public boolean isSeLinuxEnforced(IDevice device) throws Exception { if (device == null) { throw new Exception("device is null"); } ShellOutputReceiver shSELinux = new ShellOutputReceiver(); device.executeShellCommand("getenforce", shSELinux); boolean seLinuxEnforced = shSELinux.isSELinuxEnforce(); LOGGER.info("--->seLinuxEnforced:" + seLinuxEnforced); return seLinuxEnforced; }  }
AndroidDeviceImpl implements IAndroidDevice { @Override public boolean isSeLinuxEnforced(IDevice device) throws Exception { if (device == null) { throw new Exception("device is null"); } ShellOutputReceiver shSELinux = new ShellOutputReceiver(); device.executeShellCommand("getenforce", shSELinux); boolean seLinuxEnforced = shSELinux.isSELinuxEnforce(); LOGGER.info("--->seLinuxEnforced:" + seLinuxEnforced); return seLinuxEnforced; }  @Autowired void setAndroid(IAndroid android); RootCheckOutputReceiver makeRootCheckOutputReceiver(); @Override boolean isSeLinuxEnforced(IDevice device); @Override boolean isAndroidRooted(IDevice device); }
AndroidDeviceImpl implements IAndroidDevice { @Override public boolean isSeLinuxEnforced(IDevice device) throws Exception { if (device == null) { throw new Exception("device is null"); } ShellOutputReceiver shSELinux = new ShellOutputReceiver(); device.executeShellCommand("getenforce", shSELinux); boolean seLinuxEnforced = shSELinux.isSELinuxEnforce(); LOGGER.info("--->seLinuxEnforced:" + seLinuxEnforced); return seLinuxEnforced; }  @Autowired void setAndroid(IAndroid android); RootCheckOutputReceiver makeRootCheckOutputReceiver(); @Override boolean isSeLinuxEnforced(IDevice device); @Override boolean isAndroidRooted(IDevice device);  }