Commit 0ee3885d authored by Guillaume Surrel's avatar Guillaume Surrel

Verify that each server has a host defined.

parent 6bfc3b62
...@@ -39,6 +39,7 @@ import org.eclipse.ui.IWorkbenchPart; ...@@ -39,6 +39,7 @@ import org.eclipse.ui.IWorkbenchPart;
import org.ow2.joram.design.deploy.actions.wizard.DeployWizard; import org.ow2.joram.design.deploy.actions.wizard.DeployWizard;
import org.ow2.joram.design.model.joram.Config; import org.ow2.joram.design.model.joram.Config;
import org.ow2.joram.design.model.joram.JoramPackage; import org.ow2.joram.design.model.joram.JoramPackage;
import org.ow2.joram.design.model.joram.ScalAgentServer;
public class DeployAction implements IObjectActionDelegate { public class DeployAction implements IObjectActionDelegate {
...@@ -83,6 +84,12 @@ public class DeployAction implements IObjectActionDelegate { ...@@ -83,6 +84,12 @@ public class DeployAction implements IObjectActionDelegate {
.getPath()), true); .getPath()), true);
final Config rootElement = (Config) resource.getContents().get(0); final Config rootElement = (Config) resource.getContents().get(0);
for (ScalAgentServer server : rootElement.getServers()) {
if (server.getHost() == null) {
throw new Exception("Can't deploy when a server has no host defined.");
}
}
WizardDialog wizard = new WizardDialog(shell, new DeployWizard(rootElement, tree)); WizardDialog wizard = new WizardDialog(shell, new DeployWizard(rootElement, tree));
wizard.setHelpAvailable(false); wizard.setHelpAvailable(false);
wizard.setPageSize(300, 250); wizard.setPageSize(300, 250);
...@@ -91,7 +98,6 @@ public class DeployAction implements IObjectActionDelegate { ...@@ -91,7 +98,6 @@ public class DeployAction implements IObjectActionDelegate {
} catch (Exception e) { } catch (Exception e) {
MessageDialog.openError(shell, "Deploy Plug-in", "Deployment failed: " MessageDialog.openError(shell, "Deploy Plug-in", "Deployment failed: "
+ e.getMessage()); + e.getMessage());
e.printStackTrace();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment