Commit 3a8dd690 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Merge remote-tracking branch 'origin/next' into jay/cleanup



Conflicts:
	org.eclipse.ice.item/src/org/eclipse/ice/item/action/RemoteFileUploadAction.java
	org.eclipse.ice.item/src/org/eclipse/ice/item/nuclear/MOOSE.java
	org.eclipse.ice.item/src/org/eclipse/ice/item/nuclear/RemoteYamlSyntaxGenerator.java
Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parents 936b0cee 227f9268
......@@ -508,6 +508,7 @@ public class ItemProcessor implements IWidgetClosedListener, Runnable {
// Update the status
status = iceCore.getItemStatus(itemId);
// Update the IFormWidget's status
formWidget.updateStatus(statusMessageMap.get(status));
......
......@@ -8,6 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.ice.core.iCore,
org.eclipse.ice.io.serializable,
org.eclipse.ice.item,
org.eclipse.ice.item.action,
org.eclipse.ice.persistence.xml,
org.eclipse.ice.viz.service.mesh.datastructures,
org.osgi.framework;version="1.6.0"
......
......@@ -12,6 +12,7 @@
package org.eclipse.ice.item.test;
import org.eclipse.ice.item.IActionFactory;
import org.eclipse.ice.item.action.Action;
/**
* This is a fake implementation of the IActionFactory used for testing.
......@@ -21,4 +22,16 @@ import org.eclipse.ice.item.IActionFactory;
*/
public class FakeActionFactory implements IActionFactory {
@Override
public Action getAction(String actionName) {
// TODO Auto-generated method stub
return null;
}
@Override
public String[] getAvailableActions() {
// TODO Auto-generated method stub
return null;
}
}
/*******************************************************************************
* Copyright (c) 2013, 2014 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings, Alex McCaskey
*******************************************************************************/
package org.eclipse.ice.item.test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import org.eclipse.ice.item.ICEActionFactory;
import org.eclipse.ice.item.action.Action;
import org.junit.Before;
import org.junit.Test;
/**
* This class is used for testing the ICEActionFactory.
*
* @author Alex McCaskey
*
*/
public class ICEActionFactoryTester {
/**
* Reference to the factory being tested.
*/
private ICEActionFactory factory;
/**
* Create the factory before each test method.
*/
@Before
public void before() {
factory = new ICEActionFactory();
}
/**
* Check that we can get the list of names from the
* ICEActionFactory.
*/
@Test
public void checkGetNames() {
List<String> list = Arrays.asList(factory.getAvailableActions());
assertTrue(list.size() > 0);
assertTrue(list.contains("Job Launch Action"));
}
/**
* Check that getting Actions works as expected.
*/
@Test
public void checkGetAction() {
Action action = factory.getAction("Bad Name");
assertNull(action);
action = factory.getAction("Job Launch Action");
assertNotNull(action);
}
}
......@@ -46,6 +46,7 @@ import org.eclipse.ice.datastructures.jaxbclassprovider.ICEJAXBClassProvider;
import org.eclipse.ice.item.action.LoginInfoForm;
import org.eclipse.ice.item.jobLauncher.JobLauncher;
import org.eclipse.ice.item.jobLauncher.JobLauncherForm;
import org.junit.Ignore;
import org.junit.Test;
/**
......@@ -59,98 +60,6 @@ public class JobLauncherTester {
*/
private TestJobLauncher jobLauncher;
/**
* <p>
* This operations attempts to put the JobLauncher in the
* FormStatus.NeedsInfo state by setting the hostname to something other
* than localhost. It retrieves the Form from the Item after than and makes
* sure that it is actually a LoginInfoForm and not a JobLauncherForm.
* </p>
*
*/
@Test
public void checkLoginInfoForm() {
// Local declarations
Form form = null;
TableComponent hostsTable = null;
FormStatus status = FormStatus.InfoError;
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
URI defaultProjectLocation = null;
IProject project = null;
String separator = System.getProperty("file.separator");
// Enable debugging
System.setProperty("DebugICE", "");
// Setup the project
try {
// Get the project handle
project = workspaceRoot.getProject("itemTesterWorkspace");
// If the project does not exist, create it
if (!project.exists()) {
// Set the location as ${workspace_loc}/ItemTesterWorkspace
defaultProjectLocation = (new File(
System.getProperty("user.dir") + separator
+ "itemTesterWorkspace")).toURI();
// Create the project description
IProjectDescription desc = ResourcesPlugin.getWorkspace()
.newProjectDescription("itemTesterWorkspace");
// Set the location of the project
desc.setLocationURI(defaultProjectLocation);
// Create the project
project.create(desc, null);
}
// Open the project if it is not already open
if (project.exists() && !project.isOpen()) {
project.open(null);
}
} catch (CoreException e) {
// Catch for creating the project
e.printStackTrace();
fail();
}
// Instantiate the JobLauncher
jobLauncher = new TestJobLauncher(project);
// Get the Form
form = jobLauncher.getForm();
assertNotNull(form);
// Get the hosts table
hostsTable = (TableComponent) form
.getComponent(JobLauncherForm.parallelId + 1);
assertNotNull(hostsTable);
// Select the first row in the table to denote the selected host
ArrayList<Integer> selectedRowList = new ArrayList<Integer>();
selectedRowList.add(0);
hostsTable.setSelectedRows(selectedRowList);
// Submit the Form
status = jobLauncher.submitForm(form);
assertEquals(FormStatus.ReadyToProcess, status);
// Process the Item
status = jobLauncher.process("Launch the Job");
//
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// fail();
// }
// Check the status
assertEquals(FormStatus.NeedsInfo, status);
// Get the Form and check it
form = jobLauncher.getForm();
assertNotNull(form);
assertTrue(form instanceof LoginInfoForm);
return;
}
/**
* <p>
* This operations makes sure that it is possible to add and remove hosts
......
......@@ -63,4 +63,9 @@ public class TestAction extends Action {
// TODO Auto-generated method stub
return null;
}
@Override
public String getActionName() {
return "Test Action";
}
}
\ No newline at end of file
......@@ -12,9 +12,12 @@
*******************************************************************************/
package org.eclipse.ice.item.test;
import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
import org.eclipse.ice.item.IActionFactory;
import org.eclipse.ice.item.Item;
import org.eclipse.ice.item.action.Action;
import org.eclipse.ice.item.jobLauncher.JobLauncher;
/**
......@@ -70,6 +73,17 @@ public class TestJobLauncher extends JobLauncher {
return getActionFactory();
}
/**
* For the tests, we just need to run remote execution
*/
@Override
protected ArrayList<Action> getActions() {
ArrayList<Action> list = new ArrayList<Action>();
list.add(getActionFactory().getAction("Remote Execution"));
return list;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.item.Item#setupFormWithServices()
......
......@@ -4,8 +4,8 @@ Bundle-Name: ICEItem
Bundle-SymbolicName: org.eclipse.ice.item;singleton:=true
Bundle-Version: 2.1.8
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.jcraft.jsch;version="0.1.41",
org.apache.commons.io;version="2.0.1",
Import-Package: com.jcraft.jsch;version="0.1.51",
org.apache.commons.io,
org.eclipse.ice.datastructures.ICEObject,
org.eclipse.ice.datastructures.componentVisitor,
org.eclipse.ice.datastructures.form,
......@@ -17,11 +17,16 @@ Import-Package: com.jcraft.jsch;version="0.1.41",
org.eclipse.ice.io.serializable,
org.eclipse.ice.materials,
org.eclipse.ice.viz.service.datastructures,
org.eclipse.ice.viz.service.jme3.geometry,
org.eclipse.ice.viz.service.mesh.datastructures,
org.eclipse.jface.images,
org.eclipse.remote.core,
org.eclipse.remote.core.exception,
org.eclipse.remote.internal.jsch.core,
org.eclipse.remote.ui,
org.eclipse.remote.ui.widgets,
org.eclipse.swt.widgets,
org.eclipse.ui,
org.eclipse.ui.console,
org.slf4j;version="1.7.2",
org.yaml.snakeyaml
Export-Package: org.eclipse.ice.item,
......
......@@ -3,6 +3,9 @@
<plugin>
<extension-point id="itemBuilder" name="Item Builder" schema="schema/itemBuilder.exsd"/>
<extension-point id="compositeItemBuilder" name="Composite Item Builder" schema="schema/compositeItemBuilder.exsd"/>
<extension-point id="actionFactory" name="ICE Action Factory" schema="schema/actionFactory.exsd"/>
<extension-point id="actions" name="ICE Actions" schema="schema/actions.exsd"/>
<extension
id="geometryEditorBuilder"
name="Geometry Editor"
......@@ -73,4 +76,84 @@
class="org.eclipse.ice.item.utilities.moose.MOOSEFileHandler">
</implementation>
</extension>
<extension
id="org.eclipse.ice.item.ICEActionFactory"
name="ICE Action Factory"
point="org.eclipse.ice.item.actionFactory">
<actionFactory
class="org.eclipse.ice.item.ICEActionFactory">
</actionFactory>
</extension>
<extension
id="org.eclipse.ice.item.action.joblaunchaction"
name="Job Launch Action"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.JobLaunchAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.remoteyamlaction"
name="Remote YAML-Syntax Generation"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.nuclear.RemoteYamlSyntaxGenerator">
</action>
</extension>
<extension
id="org.eclipse.ice.item.remotefiledownload"
name="Remote File Download"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.RemoteFileDownloadAction">
</action>
</extension>
<extension
id="org.eclipse.ice.remotefileupload"
name="Remote File Upload"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.RemoteFileUploadAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.moose.checkmooseinput"
name="Check Moose Input"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.nuclear.CheckMooseInputAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.taggedoutputwriter"
name="Tagged Output Writer"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.TaggedOutputWriterAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.localexecution"
name="Local Execution"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.LocalExecutionAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.localfilescopy"
name="Local Files Copy"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.LocalFilesCopyAction">
</action>
</extension>
<extension
id="org.eclipse.ice.item.remoteexecution"
name="Remote Execution"
point="org.eclipse.ice.item.actions">
<action
class="org.eclipse.ice.item.action.RemoteExecutionAction">
</action>
</extension>
</plugin>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ice.item.actionFactory" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.eclipse.ice.action.actionFactory" id="actionFactory" name="ICE Action Factory"/>
</appinfo>
<documentation>
This extension point shall provide an instance of the IActionFactory interface that is used to generate ICE Actions.
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<choice>
<element ref="actionFactory"/>
</choice>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="actionFactory">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
This class must implement the IActionFactory interface to provide ICE Action services.
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.eclipse.ice.item.IActionFactory"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ice.item.action" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.eclipse.ice.action" id="actions" name="ICE Actions"/>
</appinfo>
<documentation>
This extension point shall provide instances of ICE Actions to implementations of IActionFactory.
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<choice>
<element ref="action"/>
</choice>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="action">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
This class must subclass the Action abstract class to provide ICE Action services.
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.eclipse.ice.item.action.Action"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
......@@ -7,10 +7,18 @@
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
* Jay Jay Billings, Alex McCaskey
*******************************************************************************/
package org.eclipse.ice.item;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ice.item.action.Action;