Commit 8f89c3f4 authored by Robert Smith's avatar Robert Smith
Browse files

Fixed product



An error in ice.product was preventing the built executable from finding
the org.eclipse.fx.osgi bundle, which in turn prevented the loading of
JavaFX classes. This commit fixes the problem, as well as adds more test
classes. 
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parent f0177333
......@@ -236,7 +236,7 @@ public class ICEMeshPage extends ICEFormPage
} catch (Exception e) {
logger.error(
"Error creating Geometry Canvas with Geometry Service.", e);
"Error creating Mesh Canvas with Mesh Service.", e);
}
// The MeshPage should also listen for changes to the MeshApplication's
......
......@@ -9,7 +9,7 @@
<launcherArgs>
<programArgs>-product org.eclipse.platform.ide --launcher.defaultAction openFile --launcher.appendVmargs -data @noDefault
</programArgs>
<vmArgs>-Dvisit.port=5600 -DREFRESH_BUNDLES=FALSE -Xmx2048M -XX:MaxPermSize=1024M -Dmax_download_size=52428800 -Dorg.eclipse.equinox.http.jetty.http.port=8080 -Dosgi.framework.extensions=org.eclipse.fx.osgi
<vmArgs>-Dvisit.port=5600 -DREFRESH_BUNDLES=FALSE -Xmx2048M -XX:MaxPermSize=1024M -Dmax_download_size=52428800 -Dorg.eclipse.equinox.http.jetty.http.port=8080 -Dosgi.framework.extensions=org.eclipse.fx.osgi
</vmArgs>
<vmArgsLin>-Dvisit.binpath=@user.home/visit/bin
</vmArgsLin>
......@@ -135,42 +135,42 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<feature id="org.eclipse.epp.mpc"/>
<feature id="org.eclipse.remote"/>
<feature id="org.eclipse.pde"/>
<feature id="org.eclipse.wst.common_core.feature"/>
<feature id="org.eclipse.wst.common_ui.feature"/>
<feature id="org.eclipse.wst.jsdt.feature"/>
<feature id="org.eclipse.wst.server_core.feature"/>
<feature id="org.eclipse.wst.server_ui.feature"/>
<feature id="org.eclipse.wst.server_userdoc.feature"/>
<feature id="org.eclipse.wst.web_core.feature"/>
<feature id="org.eclipse.wst.web_ui.feature"/>
<feature id="org.eclipse.wst.web_userdoc.feature"/>
<feature id="org.eclipse.wst.xml.xpath2.processor.feature"/>
<feature id="org.eclipse.wst.xml_core.feature"/>
<feature id="org.eclipse.wst.xml_ui.feature"/>
<feature id="org.eclipse.wst.xml_userdoc.feature"/>
<feature id="org.eclipse.wst.xsl.feature"/>
<feature id="org.eclipse.ptp"/>
<feature id="org.eclipse.ptp.core"/>
<feature id="org.eclipse.ptp.debug.sdm"/>
<feature id="org.eclipse.ptp.etfw"/>
<feature id="org.eclipse.ptp.etfw.feedback.perfsuite"/>
<feature id="org.eclipse.ptp.etfw.tau"/>
<feature id="org.eclipse.ptp.etfw.tau.fortran"/>
<feature id="org.eclipse.ptp.fortran"/>
<feature id="org.eclipse.ptp.gem"/>
<feature id="org.eclipse.ptp.pldt"/>
<feature id="org.eclipse.ptp.pldt.fortran"/>
<feature id="org.eclipse.ptp.pldt.upc"/>
<feature id="org.eclipse.ptp.rdt.sync"/>
<feature id="org.eclipse.ptp.rdt.sync.cdt"/>
<feature id="org.eclipse.ptp.rdt.sync.fortran"/>
<feature id="org.eclipse.ptp.remote"/>
<feature id="org.eclipse.ptp.remote.terminal"/>
<feature id="org.eclipse.ptp.rm.ibm.ll"/>
<feature id="org.eclipse.ptp.rm.ibm.pe"/>
<feature id="org.eclipse.ptp.rm.ibm.platform.lsf"/>
<feature id="org.eclipse.ptp.rm.jaxb.contrib"/>
<feature id="org.eclipse.ptp.rm.slurm"/>
<feature id="org.eclipse.wst.common_core.feature" version="3.7.0.v201505132009"/>
<feature id="org.eclipse.wst.common_ui.feature" version="3.7.0.v201505132009"/>
<feature id="org.eclipse.wst.jsdt.feature" version="1.6.200.v201505071819"/>
<feature id="org.eclipse.wst.server_core.feature" version="3.3.500.v201505132000"/>
<feature id="org.eclipse.wst.server_ui.feature" version="3.3.500.v201505261810"/>
<feature id="org.eclipse.wst.server_userdoc.feature" version="3.3.300.v201405011426"/>
<feature id="org.eclipse.wst.web_core.feature" version="3.7.0.v201505132009"/>
<feature id="org.eclipse.wst.web_ui.feature" version="3.7.0.v201505261810"/>
<feature id="org.eclipse.wst.web_userdoc.feature" version="3.6.0.v201405062147"/>
<feature id="org.eclipse.wst.xml.xpath2.processor.feature" version="2.0.301.v201409111854"/>
<feature id="org.eclipse.wst.xml_core.feature" version="3.7.0.v201502261749"/>
<feature id="org.eclipse.wst.xml_ui.feature" version="3.7.0.v201505141512"/>
<feature id="org.eclipse.wst.xml_userdoc.feature" version="3.6.0.v201405062147"/>
<feature id="org.eclipse.wst.xsl.feature" version="1.3.401.v201409111855"/>
<feature id="org.eclipse.ptp" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.core" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.debug.sdm" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.etfw" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.etfw.feedback.perfsuite" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.etfw.tau" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.etfw.tau.fortran" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.fortran" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.gem" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.pldt" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.pldt.fortran" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.pldt.upc" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rdt.sync" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rdt.sync.cdt" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rdt.sync.fortran" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.remote" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.remote.terminal" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rm.ibm.ll" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rm.ibm.pe" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rm.ibm.platform.lsf" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rm.jaxb.contrib" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ptp.rm.slurm" version="9.0.0.201506101404"/>
<feature id="org.eclipse.ice"/>
<feature id="org.eclipse.cdt.bupc"/>
<feature id="org.eclipse.cdt.core.lrparser.feature"/>
......@@ -233,28 +233,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<feature id="org.eclipse.swtbot.forms"/>
<feature id="org.eclipse.swtbot.generator.feature"/>
<feature id="org.eclipse.swtbot.ide"/>
<feature id="org.eclipse.nebula.visualization.feature"/>
<feature id="org.eclipse.nebula.widgets.nattable.core.feature"/>
<feature id="org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature"/>
<feature id="org.eclipse.nebula.widgets.nattable.extension.poi.feature"/>
<feature id="org.eclipse.sdk"/>
<feature id="org.eclipse.gef"/>
<feature id="org.eclipse.gef.sdk"/>
<feature id="org.eclipse.equinox.compendium.sdk"/>
<feature id="org.eclipse.equinox.core.feature"/>
<feature id="org.eclipse.equinox.executable"/>
<feature id="org.eclipse.equinox.sdk"/>
<feature id="org.eclipse.equinox.server.core"/>
<feature id="org.eclipse.equinox.server.jetty"/>
<feature id="org.eclipse.equinox.serverside.sdk"/>
<feature id="org.eclipse.equinox.weaving.sdk"/>
<feature id="org.eclipse.equinox.core.sdk"/>
<feature id="org.eclipse.emf.common.ui"/>
<feature id="org.eclipse.emf.ecore.edit"/>
<feature id="org.eclipse.emf.ecore.editor"/>
<feature id="org.eclipse.draw2d"/>
<feature id="org.eclipse.draw2d.sdk"/>
<feature id="org.eclipse.e4.core.tools.feature"/>
<feature id="org.eclipse.fx.runtime.min.feature" version="2.1.0.201508240501"/>
</features>
<configurations>
......@@ -270,6 +249,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.ice.caebat.batml" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.rcp" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets.moose" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.client.widgets.rcp" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.datastructures" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.dependencies" autoStart="true" startLevel="0" />
......@@ -284,6 +264,7 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<plugin id="org.eclipse.ice.proteus" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reactor.plant" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reflectivity" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.reflectivity.ui" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.vibe" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.viz" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.ice.viz.service" autoStart="true" startLevel="0" />
......@@ -312,4 +293,4 @@ Java and all Java-based trademarks are trademarks of Oracle Corporation in the U
<cssInfo>
</cssInfo>
</product>
\ No newline at end of file
</product>
......@@ -9,5 +9,7 @@ Import-Package: org.apache.log4j,
org.eclipse.ice.viz.service.datastructures.VizObject,
org.eclipse.ice.viz.service.geometry.reactor,
org.eclipse.ice.viz.service.geometry.shapes,
org.eclipse.ice.viz.service.modeling.test.utils,
org.hamcrest.core;version="1.3.0",
org.junit;version="4.12.0"
Bundle-Vendor: Oak Ridge National Laboratory
......@@ -10,12 +10,14 @@
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry.reactor.test;
import static org.junit.Assert.*;
import static org.junit.Assert.assertTrue;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerController;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerMesh;
import org.eclipse.ice.viz.service.geometry.reactor.PipeController;
import org.eclipse.ice.viz.service.geometry.reactor.PipeMesh;
import org.eclipse.ice.viz.service.modeling.AbstractView;
import org.eclipse.ice.viz.service.modeling.Transformation;
import org.junit.Test;
/**
......@@ -24,7 +26,7 @@ import org.junit.Test;
* @author Robert Smith
*
*/
public class HeatExchangerMeshTester {
public class HeatExchangerControllerTester {
/**
* Test the HeatExchanger's ability to correctly manage its contained pipes.
......@@ -33,14 +35,18 @@ public class HeatExchangerMeshTester {
public void checkPipes(){
//Create a heat exchanger and some pipes
HeatExchangerMesh exchanger = new HeatExchangerMesh();
HeatExchangerMesh exchangerMesh = new HeatExchangerMesh();
HeatExchangerController exchanger = new HeatExchangerController(new HeatExchangerMesh(), new AbstractView());
//Create pipes for the exchanger
PipeController primary = new PipeController(new PipeMesh(), new AbstractView());
PipeController secondary = new PipeController(new PipeMesh(), new AbstractView());
//Check that the secondary pipe can be set
exchanger.setSecondaryPipe(secondary);
assertTrue(secondary == exchanger.getSecondaryPipe());
//Check that the primary pipe can be set
exchanger.setPrimaryPipe(primary);
assertTrue(primary == exchanger.getPrimaryPipe());
......
/*******************************************************************************
* Copyright (c) 2016 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:
* Robert Smith
*******************************************************************************/
package org.eclipse.ice.viz.service.geometry.reactor.test;
import static org.junit.Assert.*;
import org.eclipse.ice.viz.service.geometry.reactor.PipeController;
import org.eclipse.ice.viz.service.geometry.reactor.PipeMesh;
import org.eclipse.ice.viz.service.modeling.AbstractView;
import org.eclipse.ice.viz.service.modeling.test.utils.TestController;
import org.eclipse.ice.viz.service.modeling.test.utils.TestMesh;
import org.junit.Test;
/**
* A class to test the functionality of the PipeMesh
*
* @author Robert Smith
*
*/
public class PipeMeshTester {
/**
* Test the PipeMesh convenience methods and properties management.
*/
@Test
public void checkProperties(){
//Create a pipe
PipeMesh pipe = new PipeMesh();
//Check the number of rods
pipe.setNumRods(1);
assertTrue(pipe.getNumRods() == 1);
//Check the pitch
pipe.setPitch(2d);
assertTrue(pipe.getPitch() == 2d);
//Check the rod diameter
pipe.setRodDiameter(3d);
assertTrue(pipe.getRodDiameter() == 3d);
//Set the radius and inner radius to different values
pipe.setRadius(5d);
pipe.setInnerRadius(4d);
//Check that the radius is set and that the inner radius simply redirects to the outer radius, as pipes are to be displayed as infinitely thin.
assertTrue(pipe.getRadius() == 5d);
assertTrue(pipe.getInnerRadius() == 5d);
}
/**
* Test that the PipeMesh sends updates correctly.
*/
@Test
public void checkUpdates(){
PipeMesh pipeMesh = new PipeMesh();
PipeController pipe = new PipeController(pipeMesh, new AbstractView());
TestController parent = new TestController(new TestMesh(), new AbstractView());
}
}
......@@ -97,8 +97,10 @@ public class HeatExchangerMesh extends AbstractMesh {
List<AbstractController> secondary = entities.get("Secondary Pipe");
// If there is already one, remove it.
if (!secondary.isEmpty()) {
removeEntity(secondary.get(0));
if (secondary != null) {
if (!secondary.isEmpty()) {
removeEntity(secondary.get(0));
}
}
// Add the pipe under the Primary Pipe category
......
......@@ -139,8 +139,7 @@ public class PipeMesh extends TubeMesh {
}
// If the entity is already present in this category, don't add a
// second
// entry for it
// second entry for it
else
for (AbstractController currentEntity : catList) {
if (entity == currentEntity) {
......
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.ice.viz.service.mesh">
<implementation class="org.eclipse.ice.viz.service.javafx.mesh.FXMeshVizService"/>
<implementation class="org.eclipse.ice.viz.service.javafx.mesh.FXMeshVizService"/>
<service>
<provide interface="org.eclipse.ice.viz.service.IVizService"/>
</service>
......
......@@ -6,4 +6,4 @@ bin.includes = META-INF/,\
source.. = src/
bin.excludes = OSGI-INF/ControllerFactory.xml,\
OSGI-INF/javafxMeshService.xml,\
OSGI-INF/vizMeshService.xml
OSGI-INF/vizMeshService.xml
\ No newline at end of file
......@@ -332,7 +332,7 @@ public class FXMeshViewer extends FXViewer {
nextPolygonID++;
for (AbstractController edge : tempEdges) {
newFace.addEntity(edge);
newFace.addEntityByCategory(edge, "Edges");
// Remove the edge from the temporary root
tempRoot.removeEntity(edge);
......
......@@ -32,3 +32,4 @@ Require-Bundle: org.junit,
org.eclipse.swtbot.junit4_x;bundle-version="2.2.1",
org.eclipse.swtbot.swt.finder;bundle-version="2.2.1",
org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.2.1"
Export-Package: org.eclipse.ice.viz.service.modeling.test.utils
......@@ -28,6 +28,9 @@ import org.eclipse.ice.viz.service.modeling.AbstractView;
import org.eclipse.ice.viz.service.modeling.Transformation;
import org.junit.Before;
import org.junit.Test;
import org.eclipse.ice.viz.service.modeling.test.utils.TestController;
import org.eclipse.ice.viz.service.modeling.test.utils.TestMesh;
import org.eclipse.ice.viz.service.modeling.test.utils.TestView;
/**
* A test class for the AbstractController
......@@ -313,7 +316,7 @@ public class AbstractControllerTester {
Object representation = controller.getRepresentation();
// The representation should be a TestObject
assertTrue(representation instanceof TestObject);
assertTrue(representation instanceof VizObject);
}
/**
......@@ -551,272 +554,4 @@ public class AbstractControllerTester {
}
}
/**
* A simple AbstractController implementation that keeps track of whether it has
* been updated for testing purposes.
*
* @author Robert Smith
*
*/
class TestController extends AbstractController {
/**
* Whether the controller has received an update since the last time it was
* tested.
*/
boolean updated = false;
/**
* The default constructor.
*
* @param model
* The controller's model
* @param view
* The controller's view
*/
public TestController(AbstractMesh model, AbstractView view) {
super(model, view);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ice.viz.service.modeling.AbstractController#update(org.
* eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable,
* org.eclipse.ice.viz.service.datastructures.VizObject.
* UpdateableSubscriptionType[])
*/
@Override
public void update(IManagedUpdateable component, SubscriptionType[] type) {
super.update(component, type);
updated = true;
}
/**
* Checks whether the controller has been updated and returns it to its
* default state.
*
* @return True if the controller has received an update since the last time
* this function was called. False if it has not.
*/
public boolean isUpdated() {
boolean temp = updated;
updated = false;
return temp;
}
}
/**
* A simple AbstractMesh implementation that keeps track of whether it has been
* updated for testing purposes.
*
* @author Robert Smith
*
*/
class TestMesh extends AbstractMesh {
/**
* Whether the mesh has received an update since the last time it was
* tested.
*/
boolean updated = false;
/**
* The default constructor
*
* @param entities
* The list of child entities
*/
public TestMesh(List<AbstractController> entities) {
super(entities);
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ice.viz.service.modeling.AbstractMesh#update(org.eclipse.ice.
* viz.service.datastructures.VizObject.IManagedVizUpdateable,
* org.eclipse.ice.viz.service.datastructures.VizObject.
* UpdateableSubscriptionType[])
*/
@Override
public void update(IManagedUpdateable component, SubscriptionType[] type) {
updated = true;
super.update(component, type);
}
/**
* Checks whether the controller has been updated and returns it to its
* default state.
*
* @return True if the mesh has received an update since the last time this
* function was called. False if it has not.
*/
public boolean isUpdated() {
boolean temp = updated;
updated = false;
return temp;
}
}
/**
* A simple AbstractView implementation that keeps track of whether it has been
* updated for testing purposes.
*
* @author Robert Smith
*
*/
class TestView extends AbstractView {
/**
* A dummy variable allowing two TestViews to be equal or inequal to one
* another.
*/
private int data;
/**
* Whether the view has been refreshed since the last time it was checked.
*/
private boolean refreshed = false;
/**
* Whether the mesh has received an update since the last time it was
* tested.
*/
private boolean updated = false;
/**
* The default constructor
*/
public TestView() {
super();
data = 0;
}
/**
* Set the test view's data member.
*/
public void setData(int data) {
this.data = data;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ice.viz.service.modeling.AbstractView#clone()
*/
@Override
public Object clone() {
// Create a new view
TestView clone = new TestView();
// Copy this object's data into the clone and return it
clone.copy(this);
clone.data = data;
return clone;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ice.viz.service.modeling.AbstractView#equals(java.lang.
* Object)
*/
@Override
public boolean equals(Object otherObject) {
// If the views have identical data, they are equal
if (data == ((TestView) otherObject).data) {
return true;
}
// Otherwise they are not
else {
return false;
}
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ice.viz.service.modeling.AbstractView#getRepresentation()
*/
@Override
public Object getRepresentation() {
return new TestObject();
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ice.viz.service.modeling.AbstractView#refresh(org.eclipse.ice
* .viz.service.modeling.AbstractMesh)
*/
@Override
public void refresh(AbstractMesh mesh) {
refreshed = true;
}