@Test(expected = ApplicationServiceException.class) public void testExecuteCommandFileExists() { Jvm mockJvm = mock(Jvm.class); jvmCommandFactory.executeCommand(mockJvm, JvmControlOperation.CHECK_FILE_EXISTS); }
public RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation) throws ApplicationServiceException { if (commands.containsKey(operation.getExternalValue())) { return commands.get(operation.getExternalValue()).execute(jvm); } throw new ApplicationServiceException("JvmCommand not implemented: " + operation.getExternalValue()); }
JvmCommandFactory { public RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation) throws ApplicationServiceException { if (commands.containsKey(operation.getExternalValue())) { return commands.get(operation.getExternalValue()).execute(jvm); } throw new ApplicationServiceException("JvmCommand not implemented: " + operation.getExternalValue()); } }
JvmCommandFactory { public RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation) throws ApplicationServiceException { if (commands.containsKey(operation.getExternalValue())) { return commands.get(operation.getExternalValue()).execute(jvm); } throw new ApplicationServiceException("JvmCommand not implemented: " + operation.getExternalValue()); }  }
JvmCommandFactory { public RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation) throws ApplicationServiceException { if (commands.containsKey(operation.getExternalValue())) { return commands.get(operation.getExternalValue()).execute(jvm); } throw new ApplicationServiceException("JvmCommand not implemented: " + operation.getExternalValue()); }  RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation); @PostConstruct void initJvmCommands(); }
JvmCommandFactory { public RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation) throws ApplicationServiceException { if (commands.containsKey(operation.getExternalValue())) { return commands.get(operation.getExternalValue()).execute(jvm); } throw new ApplicationServiceException("JvmCommand not implemented: " + operation.getExternalValue()); }  RemoteCommandReturnInfo executeCommand(Jvm jvm, JvmControlOperation operation); @PostConstruct void initJvmCommands();  }