From ce132dd3edfff1935881159423014fc6e1c3719d Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Fri, 19 Jun 2015 14:03:12 -0400 Subject: [PATCH 1/3] [470306][470427] Plot Editor added and context menu item duplication addressed A generic Plot Editor has been added. This editor renders files from all provided visualization services, and can be launched from elsewhere in Eclipse (e.g. the project explorer.) A bug for the CSV and VisIt visualization plots, which added duplicate entries to their context menus was removed. The plots now clear their context menus before trying to add items to them. Bug: 470306 https://bugs.eclipse.org/bugs/show_bug.cgi?id=470306 Bug: 470427 https://bugs.eclipse.org/bugs/show_bug.cgi?id=470427 Signed-off-by: Robert Smith --- org.eclipse.ice.build/pom.xml | 4 +- org.eclipse.ice.item.test/.classpath | 7 + org.eclipse.ice.item.test/.gitignore | 3 + org.eclipse.ice.item.test/.project | 34 + .../.settings/org.eclipse.jdt.core.prefs | 11 + .../META-INF/MANIFEST.MF | 14 + org.eclipse.ice.item.test/about.html | 28 + org.eclipse.ice.item.test/build.properties | 6 + org.eclipse.ice.item.test/ls_stdout_1.txt | 1 + org.eclipse.ice.item.test/pom.xml | 16 + .../item/test/AbstractItemBuilderTester.java | 91 + .../item/test/AbstractModelBuilderTester.java | 62 + .../eclipse/ice/item/test/ActionTester.java | 66 + .../ice/item/test/FakeActionFactory.java | 24 + .../ice/item/test/FakeDataComponent.java | 49 + .../ice/item/test/FakeItemBuilder.java | 72 + .../ice/item/test/FakeMaterialsDatabase.java | 116 + .../org/eclipse/ice/item/test/FakeModel.java | 53 + .../ice/item/test/FakeModelBuilder.java | 45 + .../test/GeometryEditorBuilderTester.java | 124 + .../ice/item/test/GeometryEditorTester.java | 88 + .../ice/item/test/ICEDatabaseValidator.java | 20 + .../item/test/ICEDatabaseValidatorTester.java | 27 + .../ice/item/test/ICEJschUIInfoTester.java | 93 + .../org/eclipse/ice/item/test/ItemTester.java | 1313 +++ .../ice/item/test/JobLauncherFormTester.java | 776 ++ .../ice/item/test/JobLauncherTester.java | 962 ++ .../item/test/JobProfileBuilderTester.java | 92 + .../ice/item/test/JobProfileFormTester.java | 401 + .../ice/item/test/JobProfileTester.java | 217 + .../ice/item/test/LoginInfoFormTester.java | 117 + .../ice/item/test/MultiLauncherTester.java | 417 + .../ice/item/test/ParameterListTester.java | 351 + .../eclipse/ice/item/test/RegistryTester.java | 150 + .../test/SerializedItemBuilderTester.java | 199 + .../ice/item/test/SuiteLauncherTester.java | 223 + .../test/TaggedOutputWriterActionTester.java | 116 + .../org/eclipse/ice/item/test/TestAction.java | 64 + .../org/eclipse/ice/item/test/TestItem.java | 364 + .../ice/item/test/TestItemBuilder.java | 44 + .../ice/item/test/TestJobLauncher.java | 93 + .../org/eclipse/ice/item/test/YAMLTester.java | 101 + .../item/test/messaging/MessageTester.java | 57 + .../ice/item/test/moose/BlockTester.java | 342 + .../test/moose/MOOSEFileHandlerTester.java | 397 + .../ice/item/test/moose/ParameterTester.java | 201 + .../ice/item/test/moose/YAMLBlockTester.java | 90 + .../test/nuclear/MOOSELauncherTester.java | 227 + .../test/nuclear/MOOSEModelBuilderTester.java | 51 + .../item/test/nuclear/MOOSEModelTester.java | 401 + org.eclipse.ice.item.test/taggedTestFile.txt | 4 + .../ice.product.launch | 68 +- .../data/userMatDB.xml | 8064 ++++++++--------- .../viz/service/visit/VisItPlotRender.java | 10 +- src/org.eclipse.ice.viz.service/.classpath | 14 +- .../META-INF/MANIFEST.MF | 10 +- .../OSGI-INF/VizServiceFactoryHolder.xml | 5 + .../build.properties | 1 + src/org.eclipse.ice.viz.service/plugin.xml | 85 + .../viz/service/BasicVizServiceFactory.java | 32 + .../eclipse/ice/viz/service/PlotEditor.java | 403 + .../ice/viz/service/PlotEditorDialog.java | 137 + .../ice/viz/service/PlotEditorInput.java | 101 + .../eclipse/ice/viz/service/csv/CSVPlot.java | 10 +- .../internal/VizServiceFactoryHolder.java | 44 + src/org.eclipse.ice.viz/plugin.xml | 4 +- .../META-INF/MANIFEST.MF | 1 + .../test/VizServiceFactoryHolderTester.java | 86 + .../service/test/PlotEditorDialogTester.java | 27 + 69 files changed, 13844 insertions(+), 4082 deletions(-) create mode 100644 org.eclipse.ice.item.test/.classpath create mode 100644 org.eclipse.ice.item.test/.gitignore create mode 100644 org.eclipse.ice.item.test/.project create mode 100644 org.eclipse.ice.item.test/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.ice.item.test/META-INF/MANIFEST.MF create mode 100644 org.eclipse.ice.item.test/about.html create mode 100644 org.eclipse.ice.item.test/build.properties create mode 100644 org.eclipse.ice.item.test/ls_stdout_1.txt create mode 100644 org.eclipse.ice.item.test/pom.xml create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractItemBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractModelBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ActionTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeActionFactory.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeDataComponent.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeItemBuilder.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeMaterialsDatabase.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModel.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModelBuilder.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidator.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidatorTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEJschUIInfoTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ItemTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherFormTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileFormTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/LoginInfoFormTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/MultiLauncherTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ParameterListTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/RegistryTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SerializedItemBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SuiteLauncherTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TaggedOutputWriterActionTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestAction.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItem.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItemBuilder.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestJobLauncher.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/YAMLTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/messaging/MessageTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/BlockTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/MOOSEFileHandlerTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/ParameterTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/YAMLBlockTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSELauncherTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelBuilderTester.java create mode 100644 org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelTester.java create mode 100644 org.eclipse.ice.item.test/taggedTestFile.txt create mode 100644 src/org.eclipse.ice.viz.service/OSGI-INF/VizServiceFactoryHolder.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditor.java create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorDialog.java create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorInput.java create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/internal/VizServiceFactoryHolder.java create mode 100644 tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/internal/test/VizServiceFactoryHolderTester.java create mode 100644 tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorDialogTester.java diff --git a/org.eclipse.ice.build/pom.xml b/org.eclipse.ice.build/pom.xml index b75d8df31..a924895da 100644 --- a/org.eclipse.ice.build/pom.xml +++ b/org.eclipse.ice.build/pom.xml @@ -315,7 +315,7 @@ ../src/org.eclipse.ice.core ../tests/org.eclipse.ice.core.test ../src/org.eclipse.ice.item - ../tests/org.eclipse.ice.item.test + ../src/org.eclipse.ice.persistence.xml ../tests/org.eclipse.ice.persistence.xml.test ../src/org.eclipse.ice.io @@ -344,7 +344,7 @@ ../src/org.eclipse.ice.viz ../tests/org.eclipse.ice.viz.test ../src/org.eclipse.ice.viz.service - ../tests/org.eclipse.ice.viz.service.test + ../src/org.eclipse.ice.viz.service.visit ../tests/org.eclipse.ice.viz.service.visit.test ../src/org.eclipse.ice.xolotl diff --git a/org.eclipse.ice.item.test/.classpath b/org.eclipse.ice.item.test/.classpath new file mode 100644 index 000000000..b1dabee38 --- /dev/null +++ b/org.eclipse.ice.item.test/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.eclipse.ice.item.test/.gitignore b/org.eclipse.ice.item.test/.gitignore new file mode 100644 index 000000000..d090fe659 --- /dev/null +++ b/org.eclipse.ice.item.test/.gitignore @@ -0,0 +1,3 @@ +/bin +/target +/itemTesterWorkspace diff --git a/org.eclipse.ice.item.test/.project b/org.eclipse.ice.item.test/.project new file mode 100644 index 000000000..cf2cfa756 --- /dev/null +++ b/org.eclipse.ice.item.test/.project @@ -0,0 +1,34 @@ + + + org.eclipse.ice.item.test + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + net.sourceforge.metrics.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + net.sourceforge.metrics.nature + + diff --git a/org.eclipse.ice.item.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ice.item.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..838bd9d69 --- /dev/null +++ b/org.eclipse.ice.item.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.eclipse.ice.item.test/META-INF/MANIFEST.MF b/org.eclipse.ice.item.test/META-INF/MANIFEST.MF new file mode 100644 index 000000000..e91875888 --- /dev/null +++ b/org.eclipse.ice.item.test/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ICEItemTest +Bundle-SymbolicName: org.eclipse.ice.item.test +Bundle-Version: 2.0.0 +Fragment-Host: org.eclipse.ice.item;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Import-Package: org.eclipse.ice.core.iCore, + org.eclipse.ice.io.serializable, + org.eclipse.ice.item, + org.eclipse.ice.persistence.xml, + org.osgi.framework;version="1.6.0" +Require-Bundle: org.junit;bundle-version="4.8.1" + diff --git a/org.eclipse.ice.item.test/about.html b/org.eclipse.ice.item.test/about.html new file mode 100644 index 000000000..b47b18406 --- /dev/null +++ b/org.eclipse.ice.item.test/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

July 1, 2014

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/org.eclipse.ice.item.test/build.properties b/org.eclipse.ice.item.test/build.properties new file mode 100644 index 000000000..cefaa927f --- /dev/null +++ b/org.eclipse.ice.item.test/build.properties @@ -0,0 +1,6 @@ + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . +additional.bundles = org.junit diff --git a/org.eclipse.ice.item.test/ls_stdout_1.txt b/org.eclipse.ice.item.test/ls_stdout_1.txt new file mode 100644 index 000000000..38fc4b543 --- /dev/null +++ b/org.eclipse.ice.item.test/ls_stdout_1.txt @@ -0,0 +1 @@ +classesdev.propertiesorg.eclipse.ice.item.test-2.0.0.jarlocal-artifacts.propertiesMANIFEST.MFmaven-archiverp2artifacts.xmlp2content.xmlsurefire.propertiessurefire-reportswork \ No newline at end of file diff --git a/org.eclipse.ice.item.test/pom.xml b/org.eclipse.ice.item.test/pom.xml new file mode 100644 index 000000000..aced53cd3 --- /dev/null +++ b/org.eclipse.ice.item.test/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + ICE + org.eclipse.ice.build + 2.0.0 + ${pom-filename} + + ICE + org.eclipse.ice.item.test + 2.0.0 + eclipse-test-plugin + \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractItemBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractItemBuilderTester.java new file mode 100644 index 000000000..5afbc97f2 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractItemBuilderTester.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import org.eclipse.ice.item.AbstractItemBuilder; +import org.eclipse.ice.item.IActionFactory; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.junit.Test; + +/** + * This class is responsible for testing the AbstractItemBuilder. + * + * It use a simple subclass of AbstractItemBuilder that provides the internal + * state and makes sure 1.) that the base class can return it correctly and 2.) + * that the base class can construct an Item correctly. + * + * @author Jay Jay Billings + * + */ +public class AbstractItemBuilderTester { + + /** + * Test method for + * {@link org.eclipse.ice.item.AbstractItemBuilder#getItemName()}. + */ + @Test + public void testGetItemName() { + + // Local Declarations + String name = "test name"; + ItemType type = ItemType.AnalysisSession; + + // Create a FakeItemBuilder + FakeItemBuilder builder = new FakeItemBuilder(); + builder.setNameForTest(name); + builder.setTypeForTest(type); + + // Check them. Again, this is to make sure that the *getters* and the + // (internal) setters work, not that FakeItemBuilder behaves. + assertEquals(name, builder.getItemName()); + assertEquals(type, builder.getItemType()); + + return; + } + + /** + * Test method for + * {@link org.eclipse.ice.item.AbstractItemBuilder#build(org.eclipse.core.resources.IProject)} + * . + */ + @Test + public void testBuild() { + + // Local Declarations + String name = "test name"; + ItemType type = ItemType.AnalysisSession; + IActionFactory fakeFactory = new FakeActionFactory(); + + // Create a FakeItemBuilder + FakeItemBuilder builder = new FakeItemBuilder(); + builder.setNameForTest(name); + builder.setTypeForTest(type); + + // Set the Fake Action Factory Service + builder.setActionFactory(fakeFactory); + + // Do the build + Item item = builder.build(null); + + // Check the fake + IActionFactory returnedFactory = ((TestJobLauncher) item).getActionFactoryForTest(); + assertNotNull(returnedFactory); + + // Check that setupFormWithServices was called + assertTrue(((TestJobLauncher) item).setupFormWithServicesWasCalled()); + + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractModelBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractModelBuilderTester.java new file mode 100644 index 000000000..5272c10d4 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/AbstractModelBuilderTester.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import org.eclipse.ice.item.IActionFactory; +import org.eclipse.ice.item.ItemBuilder; +import org.eclipse.ice.item.model.AbstractModelBuilder; +import org.eclipse.ice.materials.IMaterialsDatabase; +import org.junit.Test; + +/** + * This class tests the Model class. Its only test is that the + * IMaterialsDatabase is set as a service, which it checks using a + * FakeModelBuilder that overrides setInstance to create a FakeModel that + * returns the database. The IMaterialsDatabase is implemented by a fake as + * well. + * + * This strategy is OK because the only thing that needs to be tested is that + * the AbstractModel.setServices() operation is correctly implemented, which is + * not affected by overriding AbstractModelBuilder.getInstance(). + * + * @author Jay Jay Billings + * + */ +public class AbstractModelBuilderTester { + + /** + * Test method for + * {@link org.eclipse.ice.item.model.AbstractModelBuilder#setMaterialsDatabase(org.eclipse.ice.materials.IMaterialsDatabase)} + * . + */ + @Test + public void testSetMaterialsDatabase() { + // Create a fake database service and a fake action factory + IMaterialsDatabase fakeService = new FakeMaterialsDatabase(); + IActionFactory factory = new FakeActionFactory(); + + // Create a fake model and set the service + AbstractModelBuilder builder = new FakeModelBuilder(); + builder.setActionFactory(factory); + builder.setMaterialsDatabase(fakeService); + FakeModel model = ((FakeModel) builder.build(null)); + + // Make sure the database service was set + assertNotNull(model.getMaterialsDatabaseForTest()); + assertNotNull(model.getActionFactoryForTest()); + + return; + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ActionTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ActionTester.java new file mode 100644 index 000000000..99af28a91 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ActionTester.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import org.eclipse.ice.datastructures.form.Form; + +/** + *

+ * The ActionTester is responsible for testing Actions. + *

+ * + * @author Jay Jay Billings + */ +public class ActionTester { + /** + * + */ + private TestAction testAction; + + /** + *

+ * This operation checks the Action accessors for Forms using a FakeAction. + * It only tests the getForm and submitForm() operations, which are + * implemented by Action, not FakeAction. + *

+ * + */ + @Test + public void checkFormAccessors() { + + // Local Declarations + Form returnedForm = null, updatedForm = new Form(), secondReturnedForm = null; + + // Initialize the action + testAction = new TestAction(); + + // Retrieve the Form and make sure it is not null + returnedForm = testAction.getForm(); + assertNotNull(returnedForm); + + // Add something to the Form and re-submit it + updatedForm.setName("Nurse Chapel"); + testAction.submitForm(updatedForm); + + // Retrieve the Form again and make sure it is correct + secondReturnedForm = testAction.getForm(); + assertNotNull(secondReturnedForm); + assertEquals(updatedForm.getName(), secondReturnedForm.getName()); + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeActionFactory.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeActionFactory.java new file mode 100644 index 000000000..90de959c4 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeActionFactory.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.ice.item.IActionFactory; + +/** + * This is a fake implementation of the IActionFactory used for testing. + * + * @author Jay Jay Billings + * + */ +public class FakeActionFactory implements IActionFactory { + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeDataComponent.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeDataComponent.java new file mode 100644 index 000000000..66ea0131d --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeDataComponent.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2011, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.ice.datastructures.form.DataComponent; + +/** + *

+ * The FakeDataComponent class is a subclass of DataComponent that is used for + * testing. + *

+ * + * @author Jay Jay Billings + */ +public class FakeDataComponent extends DataComponent { + + // Updated value + String value; + + @Override + public void update(String key, String newValue) { + this.value = newValue; + } + + /** + *

+ * This operation returns the value that was passed to the update operation + * inherited from DataComponent. + *

+ * + * @return

+ * The value submitted to the update operation. + *

+ */ + public String getUpdatedValue() { + return value; + } + +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeItemBuilder.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeItemBuilder.java new file mode 100644 index 000000000..65bb47e4e --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeItemBuilder.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.item.AbstractItemBuilder; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemBuilder; +import org.eclipse.ice.item.ItemType; + +/** + * This class is used to build TestJobLaunchers for the MultiLauncherTester. + * Calling the build() operation returns an instance of TestJobLauncher + * regardless of the current type retrieved from getItemType(). The ability to + * change the ItemType is only available to make sure the MultiLauncherBuilder + * does not include things other than JobLaunchers. + * + * @author Jay Jay Billings + */ +public class FakeItemBuilder extends AbstractItemBuilder { + + /** + * The constructor + */ + public FakeItemBuilder() { + setName("Selina Kyle"); + setType(ItemType.Simulation); + } + + /** + * This operation sets the name that the builder should return from + * getItemName(); + * + * @param itemName + * The name + */ + public void setNameForTest(String itemName) { + setName(itemName); + } + + /** + * This operation sets the type of the FakeItemBuilder. This does not change + * what the build() operation returns - a TestJobLauncher - but it does + * change the output of getItemType(). + * + * @param itemType + * The ItemType that this builder will report. + */ + public void setTypeForTest(ItemType itemType) { + setType(itemType); + } + + + @Override + protected Item getInstance(IProject projectSpace) { + + Item item = new TestJobLauncher(projectSpace); + item.setName(getItemName()); + + return item; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeMaterialsDatabase.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeMaterialsDatabase.java new file mode 100644 index 000000000..2deeb1d6a --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeMaterialsDatabase.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import java.util.List; + +import org.eclipse.ice.datastructures.form.Material; +import org.eclipse.ice.materials.IMaterialsDatabase; + +import ca.odell.glazedlists.EventList; +import ca.odell.glazedlists.gui.TableFormat; + +/** + * A fake implementation of the IMaterialsDatabase used for testing. + * + * @author Jay Jay Billings + * + */ +public class FakeMaterialsDatabase implements IMaterialsDatabase { + + /* + * (non-Javadoc) + * + * @see org.eclipse.ice.materials.IMaterialsDatabase#getMaterials() + */ + @Override + public List getMaterials() { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ice.materials.IMaterialsDatabase#addMaterial(org.eclipse. + * ice.datastructures.form.Material) + */ + @Override + public void addMaterial(Material material) { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ice.materials.IMaterialsDatabase#deleteMaterial(java.lang + * .String) + */ + @Override + public void deleteMaterial(String name) { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ice.materials.IMaterialsDatabase#deleteMaterial(org.eclipse + * .ice.datastructures.form.Material) + */ + @Override + public void deleteMaterial(Material material) { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ice.materials.IMaterialsDatabase#updateMaterial(org.eclipse + * .ice.datastructures.form.Material) + */ + @Override + public void updateMaterial(Material material) { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ice.materials.IMaterialsDatabase#restoreDefaults() + */ + @Override + public void restoreDefaults() { + // TODO Auto-generated method stub + + } + + @Override + public EventList getElements() { + // TODO Auto-generated method stub + return null; + } + + @Override + public TableFormat getTableFormat() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModel.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModel.java new file mode 100644 index 000000000..821128c01 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModel.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.item.IActionFactory; +import org.eclipse.ice.item.model.Model; +import org.eclipse.ice.materials.IMaterialsDatabase; + +/** + * This is a fake subclass of Model that returns the IMaterialsDatabase so it + * can be used to verify that the AbstractModelBuilder set the service + * correctly. + * + * @author Jay Jay Billings + * + */ +public class FakeModel extends Model { + + /** + * The Constructor + * @param projectSpace + */ + public FakeModel(IProject projectSpace) { + super(projectSpace); + } + + /** + * This operation returns the materials database + * @return the materials database + */ + public IMaterialsDatabase getMaterialsDatabaseForTest() { + return getMaterialsDatabase(); + } + + /** + * This operation returns the action factory + * @return the action factory + */ + public IActionFactory getActionFactoryForTest() { + return getActionFactory(); + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModelBuilder.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModelBuilder.java new file mode 100644 index 000000000..c7b6612b6 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/FakeModelBuilder.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * 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 + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.model.AbstractModelBuilder; + +/** + * This is a fake model builder that provides a fake model class that will + * return the service reference to the materials database and the action factory + * to make sure the overridden AbstractModelBuilder.setServices works. + * + * @author Jay Jay Billings + * + */ +public class FakeModelBuilder extends AbstractModelBuilder { + + /** + * The constructor + */ + public FakeModelBuilder() { + setName("Eyes on Fire"); + setType(ItemType.AnalysisSession); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ice.item.AbstractItemBuilder#getInstance(org.eclipse.core.resources.IProject) + */ + @Override + protected Item getInstance(IProject projectSpace) { + return new FakeModel(projectSpace); + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorBuilderTester.java new file mode 100644 index 000000000..4fd659adf --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorBuilderTester.java @@ -0,0 +1,124 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.net.URI; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.geometry.GeometryEditor; +import org.eclipse.ice.item.geometry.GeometryEditorBuilder; +import org.junit.Test; + +/** + *

+ * This class is responsible for testing the GeometryEditorBuilder. + *

+ * + * @author Jay Jay Billings + */ +public class GeometryEditorBuilderTester { + /** + *

+ * The instance of the GeometryEditorBuilder under test. + *

+ * + */ + private GeometryEditorBuilder geometryEditorBuilder; + + /** + *

+ * This operations checks the GeometryEditorBuilder to make sure that it + * properly creates GeometryEditors. It also checks the name and the type of + * the GeometryEditorBuilder and the GeometryEditor. + *

+ * + */ + @Test + public void checkConstruction() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + String filename = null; + + // Setup the project workspace + 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 builder + geometryEditorBuilder = new GeometryEditorBuilder(); + + // Check the name - the static value, the getter and the comparison of + // the two + assertEquals("Geometry Editor", geometryEditorBuilder.name); + assertEquals("Geometry Editor", geometryEditorBuilder.getItemName()); + assertEquals(geometryEditorBuilder.name, + geometryEditorBuilder.getItemName()); + + // Check the type - the static value, the getter and the comparison of + // the two + assertEquals(ItemType.Geometry, geometryEditorBuilder.type); + assertEquals(ItemType.Geometry, geometryEditorBuilder.getItemType()); + assertEquals(geometryEditorBuilder.type, + geometryEditorBuilder.getItemType()); + + // Make sure construction works properly + Item editor = geometryEditorBuilder.build(project); + assertNotNull(editor); + assertTrue(editor instanceof GeometryEditor); + assertEquals("Geometry Editor", editor.getName()); + assertEquals(ItemType.Geometry, editor.getItemType()); + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorTester.java new file mode 100644 index 000000000..fa2eeb6dd --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/GeometryEditorTester.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.net.URI; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.junit.Test; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.geometry.GeometryComponent; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.geometry.GeometryEditor; +import org.eclipse.ice.item.geometry.GeometryEditorBuilder; + +/** + *

+ * This class is responsible for testing the GeometryEditor. + *

+ * + * @author Jay Jay Billings + */ +public class GeometryEditorTester { + /** + *

+ * The instance of the GeometryEditor under test. + *

+ * + */ + private GeometryEditor geometryEditor; + + /** + *

+ * This operations checks the GeometryEditor to make sure that it properly + * creates its Form. + *

+ * + */ + @Test + public void checkConstruction() { + + // Local Declarations + GeometryEditor editor = new GeometryEditor(); + Form form = null; + GeometryComponent geomComp = null; + + // Check the Editor's name and type + assertEquals(GeometryEditorBuilder.name, editor.getName()); + assertEquals(GeometryEditorBuilder.type, editor.getItemType()); + + // Check the Form + form = editor.getForm(); + assertNotNull(form); + assertEquals(GeometryEditorBuilder.name, form.getName()); + assertEquals(1, form.getActionList().size()); + assertEquals("Export to ICE Native Format", form.getActionList().get(0)); + + // Get the GeometryComponent and check it + geomComp = (GeometryComponent) form.getComponent(1); + assertNotNull(geomComp); + assertEquals(1, geomComp.getId()); + assertEquals("Geometry Data", geomComp.getName()); + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidator.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidator.java new file mode 100644 index 000000000..95aab3f0b --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidator.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +/** + * + * @author Jay Jay Billings + */ +public class ICEDatabaseValidator { +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidatorTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidatorTester.java new file mode 100644 index 000000000..da3ebefa6 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEDatabaseValidatorTester.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.junit.Ignore; + +/** + * + * @author Jay Jay Billings + */ +@Ignore +public class ICEDatabaseValidatorTester { + /** + * + */ + private ICEDatabaseValidator iCEDatabaseValidator; +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEJschUIInfoTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEJschUIInfoTester.java new file mode 100644 index 000000000..034029a61 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ICEJschUIInfoTester.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.item.action.LoginInfoForm; +import org.eclipse.ice.item.action.ICEJschUIInfo; + +/** + *

+ * This class is responsible for testing the ICEJschUIInfo class. + *

+ * + * @author Jay Jay Billings + */ +public class ICEJschUIInfoTester { + /** + * + */ + private ICEJschUIInfo iCEJschUIInfo; + + /** + *

+ * This operation ensures that the ICEJschUIInfo class can retrieve a + * password from the LoginInfoForm. + *

+ * + */ + @Test + public void checkPassword() { + + // Local Declarations + LoginInfoForm testForm = new LoginInfoForm(); + DataComponent comp = null; + Entry passwordEntry = null; + String password = null; + String[] keyboardInteractiveArray = null, inputArray = { "D", "E", "F" }; + + // Initialize the UIInfo class + iCEJschUIInfo = new ICEJschUIInfo(); + + // Check the promptPassword() operation before setting the password + assertTrue(!iCEJschUIInfo.promptPassword("Let me just be...")); + + // Make sure the ui info is not ready as well + assertTrue(!iCEJschUIInfo.isReady()); + + // Set the password + comp = (DataComponent) testForm.getComponent(1); + passwordEntry = comp.retrieveEntry("Password"); + passwordEntry.setValue("Georgia"); + iCEJschUIInfo.setForm(testForm); + + // The ui info should now be ready + assertTrue(iCEJschUIInfo.isReady()); + + // Check the promptPassword() operation after setting the password + assertTrue(iCEJschUIInfo.promptPassword("Over cigarettes")); + + // Get the password + assertNotNull(iCEJschUIInfo.getPassword()); + assertEquals("Georgia", iCEJschUIInfo.getPassword()); + + // Some of the return values are not used and should be null or true + assertNull(iCEJschUIInfo.getPassphrase()); + assertTrue(iCEJschUIInfo.promptPassphrase("Early in the morning.")); + assertTrue(!iCEJschUIInfo.promptYesNo("Help me to enjoy...")); + + // Get the password through the keyboard interactive operation + keyboardInteractiveArray = iCEJschUIInfo.promptKeyboardInteractive("A", + "B", "C", inputArray, null); + assertNotNull(keyboardInteractiveArray); + // There should only be on entry in the array + assertEquals(1, keyboardInteractiveArray.length); + assertEquals("Georgia", keyboardInteractiveArray[0]); + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ItemTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ItemTester.java new file mode 100644 index 000000000..d3437cd2f --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ItemTester.java @@ -0,0 +1,1313 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Properties; + +import javax.xml.bind.JAXBException; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.datastructures.jaxbclassprovider.ICEJAXBClassProvider; +import org.eclipse.ice.datastructures.resource.ICEResource; +import org.eclipse.ice.datastructures.resource.VizResource; +import org.eclipse.ice.io.serializable.IOService; +import org.eclipse.ice.io.serializable.IReader; +import org.eclipse.ice.io.serializable.IWriter; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemListener; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.messaging.Message; +import org.eclipse.ice.persistence.xml.XMLPersistenceProvider; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + *

+ * The ItemTester is responsible for testing the Item class. + *

+ * + * @author Jay Jay Billings, Anna Wojtowicz + */ +public class ItemTester implements ItemListener { + /** + * An Item used for testing. + */ + private static Item item; + + /** + * This field is used to check the Item's ability to update its listeners. + * It is part of the checkUpdates() test. + */ + private boolean updated = false; + + /** + *

+ * A string initialized to hold the entire contents of an Item in the + * Painfully Simple Form format. It is used for testing across multiple + * tests and is first converted to an InputStream. It contains two Entries + * who have a third Entry as a parent. + *

+ * + */ + private static String psfItemString; + + /** + * Sets up the psfItemString. + */ + @BeforeClass + public static void beforeClass() { + + ArrayList PSFForm = new ArrayList(); + + /** + * Setup the string containing the Form in PSF format. This was taken + * from the Painfully Simple Form article at + * + * https://wiki.eclipse.org/Painfully_Simple_Form + * + * and is a good example because it is complete, contains lots of + * whitespace and comments and, of course, interesting! I have added + * whitespaces and comments in some places to make the test more + * rigorous and changed some of the comment statements from "//" to "#" + * to cover all the possibilities. + */ + PSFForm.add("\t \n"); + PSFForm.add("#Form name and type\n"); + PSFForm.add("formName=PSF Wiki Article Form\n"); + PSFForm.add("formDescription=A PSF Wiki Article Sample\n"); + PSFForm.add("formType=Model\n"); + PSFForm.add(" \n"); + PSFForm.add("#The DataComponents block - it must come first!\n"); + PSFForm.add("group=Assembly\n"); + PSFForm.add("groupDescription=Relevant quantities for modeling a full assembly\n"); + PSFForm.add("\n"); + PSFForm.add("#The Entry blocks will appear below this line"); + PSFForm.add("\n"); + PSFForm.add("\t \n"); + PSFForm.add("#Some comments to ignore at the top\n"); + PSFForm.add("//More comments to ignore at the top\n"); + PSFForm.add("name=Coolant Temperature " + + " #The name that a user " + + "will see\n"); + PSFForm.add("description=The temperature of the coolant that surrounds " + + "the assembly and pins //A description that will help the user\n"); + PSFForm.add("defaultValue=550 " + + " //The default value\n"); + PSFForm.add("allowedValueType=Continuous " + + " //Indicates that the value can be " + + "anything between 550 and 650 K.\n"); + PSFForm.add("allowedValue=550 " + + " //The lower bound of the range\n"); + PSFForm.add("allowedValue=650 " + + " //The upper bound of the range\n"); + PSFForm.add("tag=coolantTemperature " + + " //A tag to mark it\n"); + PSFForm.add("parent=Full Assembly Flag " + + " //The parent\n"); + PSFForm.add("group=Assembly " + + " //The group\n"); + PSFForm.add(" \t \n"); + PSFForm.add("name=Number of Pins\n"); + PSFForm.add("description=The number of pins in an assembly\n"); + PSFForm.add("defaultValue=289\n"); + PSFForm.add("allowedValueType=Discrete\n"); + PSFForm.add("allowedValue=196\n"); + PSFForm.add("allowedValue=289\n"); + PSFForm.add("tag=numberOfPins\n"); + PSFForm.add("parent=Full Assembly Flag\n"); + PSFForm.add("group=Assembly\n"); + PSFForm.add(" \t \n"); + PSFForm.add("name=Full Assembly Flag\n"); + PSFForm.add("description=True if a full assembly should be modeled, false if not\n"); + PSFForm.add("defaultValue=false\n"); + PSFForm.add("allowedValueType=Discrete\n"); + PSFForm.add("allowedValue=true\n"); + PSFForm.add("allowedValue=false\n"); + PSFForm.add("tag=fullAssemblyFlag\n"); + PSFForm.add("group=Assembly\n"); + + // Convert the ArrayList to a string + psfItemString = ""; + for (String i : PSFForm) { + psfItemString += i; + } + + return; + } + + /** + *

+ * This operation sets up test Items for the Item tester. + *

+ * + */ + @Before + public void Before() { + + // Create the Item. We actually need to test a real Item, so implement + // the abstract operations below for a simple test. + item = new TestItem(null); + + return; + } + + /** + *

+ * This operation tests the Item class by creating an Item and checking that + * all of the attributes are either set to the proper default values or to + * the values specified in the constructor. + *

+ */ + @Test + public void createItem() { + + // Check the ID + assertEquals(15, item.getId()); + // Check the type + assertEquals(ItemType.Basic, item.getItemType()); + + // check nullary constructor + Item loadedItem = new Item(); + loadedItem = new Item(); + + // Check the ID + assertEquals(1, loadedItem.getId()); + // Check the type + assertEquals(ItemType.Basic, loadedItem.getItemType()); + + // Set the Item ID and make sure that it updates the Form id + loadedItem.setId(5); + assertEquals(loadedItem.getId(), loadedItem.getForm().getId()); + + // Check default of item's builder. This should be the empty string! + assertEquals("", loadedItem.getItemBuilderName()); + // Check null and empty string + loadedItem.setItemBuilderName(null); + loadedItem.setItemBuilderName(""); + + // Although we check empty string, empty string should not allowed to be + // set on it. Should be null for now. + // But it can still be set again! + assertEquals("", loadedItem.getItemBuilderName()); + + // Set it once + loadedItem.setItemBuilderName("Item's Builder"); + // Check that it is that name + assertEquals("Item's Builder", loadedItem.getItemBuilderName()); + // Try to set again, notice how it does not change + loadedItem.setItemBuilderName("Item's Builder2"); + // Check that it is the name from before + assertEquals("Item's Builder", loadedItem.getItemBuilderName()); + + } + + /** + *

+ * This operation tests the Item to see if its name can be changed properly. + * It first sets the name and then checks the value returned by + * Item.getName(). + *

+ */ + @Test + public void checkName() { + + // Set the name + item.setName("Ozzy"); + // Check the name + assertEquals("Ozzy", item.getName()); + + } + + /** + *

+ * This operation checks the ability of Item to return a Form that is well + * formed for a particular set of Entries. It creates an Item with an + * overloaded Item.fillEntryList() method and checks the Form for these + * Entries. + *

+ */ + @Test + public void checkForm() { + + // Local Declarations + int i = 0; + ArrayList components = new ArrayList(); + Form testForm = item.getForm(); + + // Make sure the form is not null + assertNotNull(testForm); + + // Grab the DataComponents + for (i = 0; i < testForm.getNumberOfComponents(); i++) { + components.add((DataComponent) testForm.getComponent(i + 1)); + } + + // Check the DataComponent names to make sure the Form is real + assertEquals(components.get(0).getName(), "Jay"); + assertEquals(components.get(1).getName(), "David"); + assertEquals(components.get(2).getName(), "Alex"); + assertEquals(components.get(3).getName(), "Bobo the Drunken Clown"); + + // FIXME - It would be preferable to have something like this: + // assertTrue(testForm.contains("Jay")); + // assertTrue(testForm.contains("David")); + // assertTrue(testForm.contains("Alex")); + // assertTrue(testForm.contains("Bobo the Drunken Clown")); + // assertFalse(testForm.contains("Kurt Russell")); + + } + + /** + *

+ * This operation tests the Item class by insuring that Forms can be + * properly submitted. It also checks that the status of the Item after the + * Form is submitted is appropriate. + *

+ */ + @Test + public void checkSubmission() { + + // Local Declarations + Form testForm = null; + DataComponent dc1 = null; + Entry dc1Entry = null; + + // Get the Form and make sure it isn't null + testForm = item.getForm(); + assertNotNull(testForm); + + // Grab the DataComponent + dc1 = (DataComponent) testForm.getComponent(2); + assertNotNull(dc1); + + // Get the Entry + dc1Entry = dc1.retrieveEntry("David's Entry"); + assertNotNull(dc1Entry); + + // Set the value on the Entry + dc1Entry.setValue("ORNL Employee"); + + // Disable the Item + item.disable(true); + assertFalse(item.isEnabled()); + // Make sure that the Form can not be submitted + assertEquals(FormStatus.Unacceptable, item.submitForm(testForm)); + assertEquals(FormStatus.Unacceptable, item.getStatus()); + // Re-enable the Item + item.disable(false); + assertTrue(item.isEnabled()); + + // Submit the updated Form and check its status in two ways + assertEquals(FormStatus.ReadyToProcess, item.submitForm(testForm)); + assertEquals(FormStatus.ReadyToProcess, item.getStatus()); + + // Get the Form and check first DataComponent + dc1 = (DataComponent) testForm.getComponent(1); + assertEquals(((FakeDataComponent) dc1).getUpdatedValue(), + "ORNL Employee"); + + // FIXME - Need to make Action Form submission testable! + + return; + + } + + /** + *

+ * This operation checks the Item to insure that its equals() operation + * works. + *

+ * + */ + @Test + public void checkEquality() { + + // Create DataComponents to test + Item item = new Item(null); + Item equalItem = new Item(null); + Item unEqualItem = new Item(null); + Item transitiveItem = new Item(null); + item.setItemBuilderName("Builder"); + + // Set ICEObject data + equalItem.setId(item.getId()); + transitiveItem.setId(item.getId()); + unEqualItem.setId(2); + + // Set builders + equalItem.setItemBuilderName("Builder"); + unEqualItem.setItemBuilderName("Builder"); + transitiveItem.setItemBuilderName("Builder"); + + // Set names + equalItem.setName(item.getName()); + transitiveItem.setName(item.getName()); + unEqualItem.setName("DC UnEqual"); + + // Assert two equal Items return true + assertTrue(item.equals(equalItem)); + + // Assert two unequal Items return false + assertFalse(item.equals(unEqualItem)); + + // Assert equals() is reflexive + assertTrue(item.equals(item)); + + // Assert the equals() is Symmetric + assertTrue(item.equals(equalItem) && equalItem.equals(item)); + + // Assert equals() is transitive + if (item.equals(equalItem) && equalItem.equals(transitiveItem)) { + assertTrue(item.equals(transitiveItem)); + } else { + fail(); + } + + // Assert equals is consistent + assertTrue(item.equals(equalItem) && item.equals(equalItem) + && item.equals(equalItem)); + assertTrue(!item.equals(unEqualItem) && !item.equals(unEqualItem) + && !item.equals(unEqualItem)); + + // Assert checking equality with null is false + assertFalse(item == null); + + // Assert that two equal objects return same hashcode + assertTrue(item.hashCode() == equalItem.hashCode()); + + // Assert that hashcode is consistent + assertTrue(item.hashCode() == item.hashCode()); + + // Assert that hashcodes from unequal objects are different + assertTrue(item.hashCode() != unEqualItem.hashCode()); + + } + + /** + *

+ * This operation checks the Item to ensure that its copy() and clone() + * operations work as specified. + *

+ * + */ + @Test + public void checkCopying() { + + /* + * The following sets of operations will be used to test the + * "clone and copy" portion of Item. + */ + // Local Declarations + Item cloneItem = new Item(null), copyItem = new Item(null); + + // run clone operations + cloneItem = (Item) item.clone(); + + // check contents + assertEquals(item.getAvailableActions(), + cloneItem.getAvailableActions()); + assertEquals(item.getDescription(), cloneItem.getDescription()); + assertTrue(item.getForm().equals(cloneItem.getForm())); + assertEquals(item.getId(), cloneItem.getId()); + assertEquals(item.getItemType(), cloneItem.getItemType()); + assertEquals(item.getName(), cloneItem.getName()); + assertEquals(item.getStatus(), cloneItem.getStatus()); + + // run copy operation + copyItem.copy(item); + + // check contents + assertEquals(item.getAvailableActions(), copyItem.getAvailableActions()); + assertEquals(item.getDescription(), copyItem.getDescription()); + assertTrue(item.getForm().equals(copyItem.getForm())); + assertEquals(item.getId(), copyItem.getId()); + assertEquals(item.getItemType(), copyItem.getItemType()); + assertEquals(item.getName(), copyItem.getName()); + assertEquals(item.getStatus(), copyItem.getStatus()); + + // run copy operation by passing null + copyItem.copy(null); + + // check contents - nothing has changed + assertEquals(item.getAvailableActions(), copyItem.getAvailableActions()); + assertEquals(item.getDescription(), copyItem.getDescription()); + assertTrue(item.getForm().equals(copyItem.getForm())); + assertEquals(item.getId(), copyItem.getId()); + assertEquals(item.getItemType(), copyItem.getItemType()); + assertEquals(item.getName(), copyItem.getName()); + assertEquals(item.getStatus(), copyItem.getStatus()); + + } + + /** + * This operation checks the ability of the Item to persist itself to XML + * and to load itself from an XML input stream. + * + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + */ + @Test + public void checkXMLPersistence() throws NullPointerException, + JAXBException, IOException { + /* + * The following sets of operations will be used to test the + * "read and write" portion of the Item. It will demonstrate the + * behavior of reading and writing from an + * "XML (inputStream and outputStream)" file. It will use an annotated + * Item to demonstrate basic behavior. + */ + + // Local declarations + Item loadedItem = new Item(); + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(Item.class); + + // Set up item + Item persistedItem = new Item(); + persistedItem.setDescription("I am an item description"); + persistedItem.setId(5); + persistedItem.setName("I am a name!"); + persistedItem.getForm().setItemID(5); + + // persist to an output stream + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + xmlHandler.write(persistedItem, classList, outputStream); + + // Load an Item from the first + loadedItem = (Item) xmlHandler.read(classList, + new ByteArrayInputStream(outputStream.toByteArray())); + // Make sure they match + assertEquals(persistedItem, loadedItem); + + // Check the contents more closely to make sure that Item. + assertEquals(persistedItem.getAvailableActions(), + loadedItem.getAvailableActions()); + assertEquals(persistedItem.getDescription(), + loadedItem.getDescription()); + assertEquals(persistedItem.getForm(), loadedItem.getForm()); + assertEquals(persistedItem.getId(), loadedItem.getId()); + assertEquals(persistedItem.getItemType(), loadedItem.getItemType()); + assertEquals(persistedItem.getName(), loadedItem.getName()); + assertEquals(persistedItem.getStatus(), loadedItem.getStatus()); + + } + + /** + *

+ * This operation checks the SerializedItem using a Painfully Simple Form + * (PSF) file. It checks the name and type of the Item and tries to create + * and check a SerializedItem initialized from the PSF. + *

+ * + */ + @Test + public void checkLoadingFromPSF() { + + // Local Declarations + ByteArrayInputStream stream = null; + Form form = null; + DataComponent dataComp1 = null, dataComp2 = null; + Entry entry = null; + + // Create the InputStream + stream = new ByteArrayInputStream(psfItemString.getBytes()); + + // Load the Item + Item testItem = new Item(null); + try { + testItem.loadFromPSF(stream); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + + // Check the Item's name and description + assertEquals("PSF Wiki Article Form", testItem.getName()); + assertEquals("A PSF Wiki Article Sample", testItem.getDescription()); + + // Get the Form + form = testItem.getForm(); + assertNotNull(form); + // Check the Form in some random spots - FIXME: Use Form.equals() once + // AJM implements it! + assertEquals("PSF Wiki Article Form", form.getName()); + assertEquals("A PSF Wiki Article Sample", form.getDescription()); + assertEquals(1, form.getNumberOfComponents()); + dataComp1 = (DataComponent) form.getComponent(1); + dataComp2 = (DataComponent) form.getComponent(2); + assertNotNull(dataComp1); + assertEquals("Assembly", dataComp1.getName()); + assertEquals(null, dataComp2);// There should only be one component! + entry = dataComp1.retrieveEntry("Number of Pins"); + assertNotNull(entry); + assertEquals("289", entry.getDefaultValue()); + assertEquals("numberOfPins", entry.getTag()); + + // Try loading the Item from a null stream, which should result in an + // exception + testItem = new Item(null); + try { + testItem.loadFromPSF(null); + } catch (IOException e) { + // Don't do anything because it was supposed to fail! + } + + return; + + } + + /** + *

+ * This operation checks the SerializedItem to make sure that it properly + * reviews the Entries. It uses the psfItemString to create a SerializedItem + * with two Entries who have a third as a parent. It makes sure that + * updating the SerializedItem results in the child Entries being marked as + * ready. + *

+ * + */ + @Test + public void checkEntryReviews() { + + Form form = null; + DataComponent dataComp1 = null, dataComp2 = null; + Entry entry = null; + + System.out.println("PSFItemString = " + psfItemString); + + // Load the SerializedItem from the PSF string + Item testItem = new Item(null); + try { + testItem.loadFromPSF(new ByteArrayInputStream(psfItemString + .getBytes())); + } catch (IOException e) { + // Fail if it can't load + fail(); + } + + // Get the Form + form = testItem.getForm(); + assertNotNull(form); + assertEquals(1, form.getNumberOfComponents()); + + // Get the parent + dataComp1 = (DataComponent) form.getComponent(1); + assertNotNull(dataComp1); + assertEquals("Assembly", dataComp1.getName()); + entry = dataComp1.retrieveEntry("Full Assembly Flag"); + assertNotNull(entry); + assertEquals("Full Assembly Flag", entry.getName()); + assertEquals(null, entry.getParent()); + + // Change its value. By default it is false. + entry.setValue("true"); + + // Submit the Form back to the Item for review + assertEquals(FormStatus.ReadyToProcess, testItem.submitForm(form)); + + // Get the parent + dataComp1 = (DataComponent) form.getComponent(1); + assertNotNull(dataComp1); + assertEquals("Assembly", dataComp1.getName()); + entry = dataComp1.retrieveEntry("Full Assembly Flag"); + assertNotNull(entry); + assertEquals("true", entry.getValue()); + + // Make sure that the children are now marked as ready + assertEquals(3, dataComp1.retrieveReadyEntries().size()); + + return; + + } + + /** + * This operation checks the Item to make sure that by default it offers two + * actions, one for writing the Form to XML and another for writing the + * Entries in the Form as a set of key-value pairs. It also makes sure that + * the Form is written to these two file types if the Item is so directed. + * It also makes sure that processing a disabled Item fails. Finally, it + * pulls the output file handle from the Item and makes sure that the + * default name of the file is set according to the default in the class + * documentation. + * + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + * @throws CoreException + */ + @Test + public void checkProcessing() throws NullPointerException, JAXBException, + IOException, CoreException { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + String filename = null; + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(Item.class); + classList.addAll(new ICEJAXBClassProvider().getClasses()); + + // 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(); + } + + // Create the Item + item = new TestItem(project); + // Configure the IOService for the Item + IOService ioService = new IOService(); + XMLPersistenceProvider xmlpp = new XMLPersistenceProvider(project); + xmlpp.addBuilder(new TestItemBuilder()); + xmlpp.registerClassProvider(new ICEJAXBClassProvider()); + xmlpp.start(); + ioService.addWriter(xmlpp); + item.setIOService(ioService); + + // Get the available actions. They should be + // "Export to ICE Native Format" and "Export to key-value pair output" + // according to the API. + Form form = item.getForm(); + ArrayList actions = form.getActionList(); + assertNotNull(actions); + assertEquals(2, actions.size()); + assertTrue(actions.contains("Export to ICE Native Format")); + assertTrue(actions.contains("Export to key-value pair output")); + + // Try writing to an action not in the list and make sure it fails + assertEquals( + FormStatus.InfoError, + item.process("Go to the gym because " + + "you've been working too long and you need to exercise " + + "your shoulder.")); + + // Disable the Item + item.disable(true); + // Make sure that the Form can not be submitted + assertEquals(FormStatus.Unacceptable, + item.process("Export to ICE Native Format")); + // Re-enable the Item + item.disable(false); + + // Direct the Item to write the Form to XML + assertEquals(FormStatus.Processed, + item.process("Export to ICE Native Format")); + // Pause the thread so it can have some time to write the file + try { + Thread.currentThread().sleep(2000); + } catch (InterruptedException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + + // Get the file that was written when the Item was processed, make sure + // it exists, load it and compare to the original form. + filename = (form.getName() + "_" + form.getId() + ".xml").replaceAll( + "\\s+", "_"); + IFile formXMLFile = project.getFile(filename); + assertTrue(formXMLFile.exists()); + Form loadedForm = (Form) xmlHandler.read(classList, + formXMLFile.getContents()); + assertEquals(form, loadedForm); + + // Delete the file + try { + formXMLFile.delete(true, null); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + fail(); + } + + // Direct the Item to write the Form to a key-value pair output + assertEquals(FormStatus.Processed, + item.process("Export to key-value pair output")); + + // Get the file, make sure it exists, load it and check it out + filename = (form.getName() + "_" + form.getId() + ".dat").replaceAll( + "\\s+", "_"); + IFile formDatFile = project.getFile(filename); + assertTrue(formDatFile.exists()); + Properties formDatProps = new Properties(); + try { + formDatProps.load(formDatFile.getContents()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (CoreException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + fail(); + } + assertEquals("Awesome", formDatProps.get("jayjaybillings")); + assertEquals("The boss", formDatProps.get("David'sEntry")); + + // Delete the file + try { + formXMLFile.delete(true, null); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + fail(); + } + + // Setup the name of the output file. According to the documentation it + // should be at + // __processOutput.txt. + String outputFilename = item.getName().replaceAll("\\s+", "_") + "_" + + item.getId() + "_processOutput.txt"; + System.out + .println("ItemTester message: Looking for (shortened) output file name \"" + + outputFilename + "\""); + // Get the output file handle + File outputFile = item.getOutputFile(); + // Make sure it is not null + assertNotNull(outputFile); + // Make sure it contains our short name. It doesn't exactly matter where + // the file is stored, as long as the name is properly set for now. That + // means that the Item has created the file handle per the spec. + String retOutputName = outputFile.getAbsolutePath(); + System.out.println("ItemTester message: Returned Output File Name = " + + retOutputName); + assertTrue(outputFile.getAbsolutePath().contains(outputFilename)); + + // Shut down the project resource + project.close(null); + project.delete(true, null); + + return; + + } + + /** + *

+ * This operation checks the project setup of the Item to ensure that + * calling the constructor with an IProject and Item.setProject() setup the + * project reference such that Item.hasProject() returns true. + *

+ * + */ + @Test + public void checkProjectSetup() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + + // 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(); + } + + // Setup a project using the constructor + item = new TestItem(project); + assertTrue(item.hasProject()); + + // Make sure that the Item created a preferences directory. The + // setPreferences() operation is a fake that forces the Item to create + // the directory. + ((TestItem) item).setPreferences(); + IFolder preferencesFolder = project.getFolder("Test_Item"); + assertTrue(preferencesFolder.exists()); + + // Setup a project using the setter + item = new TestItem(); + // Check that the output file is not configured yet. + assertNull(item.getOutputFile()); + item.setProject(project); + assertTrue(item.hasProject()); + + // Make sure that calling the setter with null does not re-set or + // overwrite the project (Item.hasProject() should still return true) + item.setProject(null); + assertTrue(item.hasProject()); + + // Make sure that calling the constructor with null does not set the + // project + item = new TestItem(null); + assertEquals(item.hasProject(), false); + + // Make sure that calling the setter with null does not set the project + item = new TestItem(); + item.setProject(null); + assertEquals(item.hasProject(), false); + + // Shut down the project resource + try { + project.close(null); + project.delete(true, null); + } catch (CoreException e) { + e.printStackTrace(); + } + + return; + } + + /** + *

+ * This operation checks the ability of the Item to accept subscribers and + * notify them of changes by forcing an update using the TestItem. It also + * checks the ability of the Item to receive updates from ICE subsystems, + * remote ICE subsystems and external third-party processes. + *

+ * + */ + @Test + public void checkUpdates() { + + // Local Declarations + int id = 1, itemId = 2; + String type = "FILE_UPDATED", content = "Starfleet Academy"; + + // Create the Item + TestItem fakeItem = new TestItem(); + fakeItem.addListener(this); + + // Force the notification + fakeItem.notifyListeners(); + + // Make sure the message was heard + assertTrue(updated); + + // Create a message to test external updates (posts) + Message msg = new Message(); + msg.setId(id); + msg.setItemId(itemId); + msg.setMessage(content); + msg.setType(type); + + // Push the update and check the response + assertTrue(fakeItem.update(msg)); + assertTrue(fakeItem.wasUpdated()); + + return; + } + + /** + * This method tests the {@link Item#getResource(String)} and + * {@link Item#getResource(Entry)} methods. + */ + @Test + public void checkGettingResources() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String projectName = "itemTesterWorkspace"; + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + + // Setup the project + try { + // Get the project handle + project = workspaceRoot.getProject(projectName); + // If the project does not exist, create it + if (!project.exists()) { + // Set the location as ${workspace_loc}/itemTesterWorkspace + defaultProjectLocation = (new File(userDir + separator + + projectName)).toURI(); + // Create the project description + IProjectDescription desc = ResourcesPlugin.getWorkspace() + .newProjectDescription(projectName); + // 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); + } + + // Refresh the workspace + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + // Catch exception for creating the project + e.printStackTrace(); + fail(); + } + + // Local Declarations + Item item = new Item(project); + ICEResource iceResource = null; + VizResource vizResource = null; + String txtFilePath = project.getLocation().toOSString() + separator + + "txtResource.txt"; + String csvFilePath = project.getLocation().toOSString() + separator + + "csvResource.csv"; + + // Try getting an ICEResource based on a String file path + try { + iceResource = item.getResource(txtFilePath); + } catch (IOException e) { + fail(); + e.printStackTrace(); + } + + // Verify all is well + assertNotNull(iceResource); + assertTrue(iceResource instanceof ICEResource); + + // Try getting a VizResource based on a String file path + try { + vizResource = (VizResource) item.getResource(csvFilePath); + } catch (IOException e) { + fail(); + e.printStackTrace(); + } + + // Verify all is well + assertNotNull(vizResource); + assertTrue(vizResource instanceof VizResource); + + // Now construct a file Entry based on a .e file + Entry entry = new Entry(); + entry.setValue("mesh.e"); + vizResource = null; + + // Try getting a VizResource based on the Entry + try { + vizResource = (VizResource) item.getResource(entry); + } catch (IOException e) { + fail(); + e.printStackTrace(); + } + + // Check the VizResource + assertNotNull(vizResource); + assertTrue(vizResource instanceof VizResource); + + // Shut down the project resource + try { + project.close(null); + project.delete(true, null); + } catch (CoreException e) { + e.printStackTrace(); + } + + } + + /** + * This method tests the file copy/move methods on the Item. + */ + @Test + public void checkFileCapabilities() { + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + + // Setup the project + try { + // Get the project handle + project = workspaceRoot.getProject("itemData"); + // If the project does not exist, create it + if (!project.exists()) { + // Set the location as ${workspace_loc}/ItemTesterWorkspace + defaultProjectLocation = new File( + System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData").toURI(); + // Create the project description + IProjectDescription desc = ResourcesPlugin.getWorkspace() + .newProjectDescription("itemData"); + // 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(); + } + + // Setup a project using the constructor + TestItem testItem = new TestItem(project); + assertTrue(testItem.hasProject()); + + // Verify that Item.getFiles() works as expected + ArrayList files = testItem.getYAMLFiles(project.getLocation() + .toOSString()); + assertNotNull(files); + assertEquals(3, files.size()); + assertTrue(files.contains("bison.yaml")); + assertTrue(files.contains("bison_short.yaml")); + assertTrue(files.contains("bison_medium.yaml")); + + // Give it something that is not a directory and make sure we + // get no files + files = testItem.getYAMLFiles(project.getLocation().toOSString() + + separator + "bison.yaml"); + assertTrue(files.isEmpty()); + + // Create a new temp directory + IFolder tempDir = project.getFolder("tempDir"); + if (!tempDir.exists()) { + try { + tempDir.create(true, true, null); + } catch (CoreException e) { + e.printStackTrace(); + } + } + + // Now let's check that we can move files from one place to another + // The test here is that the move operation makes a new file in the + // target and deletes the file in the source + testItem.moveTestFile(project.getLocation().toOSString(), tempDir + .getLocation().toOSString(), "bison.yaml"); + assertFalse(project.getFile("bison.yaml").exists()); + assertTrue(tempDir.getFile("bison.yaml").exists()); + + // Move it back to keep our workspace pristine for other item tests + testItem.moveTestFile(tempDir.getLocation().toOSString(), project + .getLocation().toOSString(), "bison.yaml"); + assertTrue(project.getFile("bison.yaml").exists()); + assertFalse(tempDir.getFile("bison.yaml").exists()); + + // Check that we can copy, that is a new copied file is created + // in the target and the source file is left intact + testItem.copyTestFile(project.getLocation().toOSString(), tempDir + .getLocation().toOSString(), "bison.yaml"); + assertTrue(project.getFile("bison.yaml").exists()); + assertTrue(tempDir.getFile("bison.yaml").exists()); + + // Make sure we can move multiple files at time + testItem.moveMultipleFiles(project.getLocation().toOSString(), tempDir + .getLocation().toOSString(), ".yaml"); + assertTrue(tempDir.getFile("bison.yaml").exists()); + assertTrue(tempDir.getFile("bison_short.yaml").exists()); + assertTrue(tempDir.getFile("bison_medium.yaml").exists()); + + // Let's check copying multiple files + testItem.copyMultipleFiles(tempDir.getLocation().toOSString(), project + .getLocation().toOSString(), ".yaml"); + assertTrue(project.getFile("bison.yaml").exists()); + assertTrue(project.getFile("bison_short.yaml").exists()); + assertTrue(project.getFile("bison_medium.yaml").exists()); + + // Check we can delete directories + testItem.deleteTestDirectory(tempDir.getLocation().toOSString()); + assertFalse(project.getFolder("tempDir").exists()); + + // Test the directory copy + IFolder limbo = project.getFolder("Directory"); + IFolder newLimbo = project.getFolder("newDirectory"); + if (!newLimbo.exists()) { + try { + newLimbo.create(true, true, null); + } catch (CoreException e) { + e.printStackTrace(); + } + } + + String srcPath = project.getLocation().toOSString() + separator + + project.getFolder("Directory").getName(); + String destPath = project.getLocation().toOSString() + separator + + project.getFolder("newDirectory").getName(); + testItem. copyTestDirectory(srcPath, destPath); + + // Make sure all of the files were copied, then delete them all + ArrayList copiedFiles = new ArrayList(); + copiedFiles.add(new File(destPath + separator + "DeepDirectory" + + separator + "DeeperThanDeep" + separator + "file")); + copiedFiles.add(new File(destPath + separator + "DeepDirectory" + + separator + "DeeperThanDeep")); + copiedFiles.add(new File(destPath + separator + "DeepDirectory" + + separator + "deepFile")); + copiedFiles.add(new File(destPath + separator + "DeepDirectory")); + copiedFiles.add(new File(destPath + separator + "shallowFile")); + copiedFiles.add(new File(destPath)); + + for (File f : copiedFiles) { + assertTrue(f.exists()); + f.delete(); + } + + // Shut down the project resource + try { + project.close(null); + project.delete(true, null); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return; + } + + /** + * This method checks the Item's ability to get and use an IOService. + */ + @Test + public void checkIOService() { + TestItem testItem = new TestItem(null); + IOService service = new IOService(); + + // Create a fake IReader realization + IReader fakeReader = new IReader() { + + @Override + public Form read(IFile file) { + return new Form(); + } + + @Override + public ArrayList findAll(IFile file, String regex) { + ArrayList fakeEntry = new ArrayList(); + return fakeEntry; + } + + @Override + public String getReaderType() { + return "fake"; + } + + }; + + // Create a fake IWriter realization + IWriter fakeWriter = new IWriter() { + + @Override + public void write(Form formToWrite, IFile file) { + return; + } + + @Override + public void replace(IFile file, String regex, String value) { + return; + } + + @Override + public String getWriterType() { + return "fake"; + } + + }; + + // Test the case that the Item is given a bad IOService + testItem.setIOService(null); + assertNull(testItem.getTestReader()); + assertNull(testItem.getTestWriter()); + + // Add the fakes + service.addReader(fakeReader); + service.addWriter(fakeWriter); + + // Set the service on the Item + testItem.setIOService(service); + + // Test that if the Item specifies the IO type correctly + // they should get valid reader and writer. + assertNotNull(testItem.getTestReader()); + assertNotNull(testItem.getTestWriter()); + assertTrue(fakeReader == testItem.getTestReader()); + assertTrue(fakeWriter == testItem.getTestWriter()); + + return; + } + + /** + * (non-Javadoc) + * + * @see ItemListener#reloadProjectData() + */ + public void reloadProjectData() { + + updated = true; + + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherFormTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherFormTester.java new file mode 100644 index 000000000..671f469c6 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherFormTester.java @@ -0,0 +1,776 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.ice.datastructures.ICEObject.Component; +import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler; +import org.eclipse.ice.datastructures.ICEObject.ListComponent; +import org.eclipse.ice.datastructures.componentVisitor.IComponentVisitor; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; + +import javax.xml.bind.JAXBException; + +import org.junit.Test; +import org.eclipse.ice.datastructures.form.AdaptiveTreeComposite; +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.ResourceComponent; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.TableComponent; +import org.eclipse.ice.datastructures.form.TimeDataComponent; +import org.eclipse.ice.datastructures.form.emf.EMFComponent; +import org.eclipse.ice.datastructures.form.geometry.GeometryComponent; +import org.eclipse.ice.datastructures.form.MasterDetailsComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.datastructures.componentVisitor.IReactorComponent; +import org.eclipse.ice.datastructures.form.MatrixComponent; +import org.eclipse.ice.datastructures.form.geometry.IShape; +import org.eclipse.ice.datastructures.form.mesh.MeshComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.jaxbclassprovider.ICEJAXBClassProvider; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.jobLauncher.JobLauncherForm; + +/** + *

+ * The JobLauncherFormTester is responsible for testing the JobLauncherForm. It + * is primarily focused on testing the number and composition of the Components + * in the JobLauncherForm. It realizes the IComponentVisitor interface to find + * the Parallel Execution Data Component from the JobLauncherForm. + *

+ * + * @author Jay Jay Billings + */ +public class JobLauncherFormTester implements IComponentVisitor { + /** + *

+ * The JobLauncherForm that is under test. + *

+ * + */ + private JobLauncherForm jobLauncherForm; + + /** + *

+ * A reference to store the threadingComponent used in the checkParallelism + * test. + *

+ * + */ + private DataComponent threadingComponent = null; + + /** + *

+ * This operation checks the Components of the JobLauncherForm to make sure + * that they are correct in their number and configuration. It also checks + * the list of input files and makes sure that it can be changed properly. + *

+ * + */ + @Test + public void checkJobLauncherFormComponents() { + + // Local Declarations + ArrayList files = new ArrayList(); + ArrayList retFiles = new ArrayList(); + + // Setup some files for the Form + files.add("testFile1"); + files.add("testFile2"); + files.add("testFile3"); + files.add("testFile4"); + files.add("testFile5"); + + // Create the JobLauncherForm + jobLauncherForm = new JobLauncherForm(); + jobLauncherForm.setInputFiles("Input file", "The input file", files); + + // Check the number of Components in the JobLauncherForm. It should have + // two, a DataComponent and an OutputComponent. + assertEquals(2, jobLauncherForm.getNumberOfComponents()); + + // Get the Entries in the input files component + ArrayList entries = ((DataComponent) jobLauncherForm + .getComponent(1)).retrieveAllEntries(); + // Check the number of Entries in the input files component + assertEquals(1, entries.size()); + // Check the Entries. The Input File Entry should have files.size() + // allowed values. + assertEquals("Input file", entries.get(0).getName()); + retFiles = entries.get(0).getAllowedValues(); + // Check the list of files + assertNotNull(retFiles); + assertEquals(files, retFiles); + + return; + } + + /** + *

+ * This operation makes sure that it is possible to enable and disable + * support for OpenMP, TBB, and MPI in the JobLauncherForm. + *

+ * + */ + @Test + public void checkParallelism() { + + // Local Declarations + Entry openMPEntry = null; + Entry mpiEntry = null; + Entry tBBEntry = null; + + // Create the JobLauncherForm + jobLauncherForm = new JobLauncherForm(); + + // Make sure there is no threading component in the Form + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable OpenMP + jobLauncherForm.enableOpenMP(1, 5, 2); + + // Get the parallel component + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Get the OpenMP Entry and check it + openMPEntry = threadingComponent + .retrieveEntry("Number of OpenMP Threads"); + assertNotNull(openMPEntry); + assertEquals("2", openMPEntry.getDefaultValue()); + assertTrue(openMPEntry.getAllowedValues().contains("1")); + assertTrue(openMPEntry.getAllowedValues().contains("5")); + + // Enable MPI + jobLauncherForm.enableMPI(1, 1024, 512); + + // Check the account code + Entry accountEntry = threadingComponent.retrieveEntry("Account Code/Project Code"); + assertNotNull(accountEntry); + assertEquals("none",accountEntry.getValue()); + assertEquals(accountEntry.getValueType(),AllowedValueType.Undefined); + + // Get the MPI Entry and check it + mpiEntry = threadingComponent.retrieveEntry("Number of MPI Processes"); + assertNotNull(mpiEntry); + assertEquals("512", mpiEntry.getDefaultValue()); + assertTrue(mpiEntry.getAllowedValues().contains("1")); + assertTrue(mpiEntry.getAllowedValues().contains("1024")); + + // Enable TBB + jobLauncherForm.enableTBB(1, 5, 3); + System.err.println(threadingComponent.retrieveAllEntries().size()); + // Get the TBB Entry and check it + tBBEntry = threadingComponent.retrieveEntry("Number of TBB Threads"); + assertNotNull(tBBEntry); + assertEquals("3", tBBEntry.getDefaultValue()); + assertTrue(tBBEntry.getAllowedValues().contains("1")); + assertTrue(tBBEntry.getAllowedValues().contains("5")); + + // Disable TBB, OpenMP and MPI + threadingComponent = null; + jobLauncherForm.disableMPI(); + jobLauncherForm.disableOpenMP(); + jobLauncherForm.disableTBB(); + + // Make sure the "Parallel Execution" component is disabled + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Re-enable the parallelism + jobLauncherForm.enableOpenMP(1, 5, 2); + jobLauncherForm.enableMPI(1, 1024, 512); + jobLauncherForm.enableTBB(1, 5, 3); + + // Disable OpenMP and make sure the component is still available + jobLauncherForm.disableOpenMP(); + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + threadingComponent = null; + + // Re-enable OpenMP and TBB, disable MPI + jobLauncherForm.enableOpenMP(1, 5, 2); + jobLauncherForm.enableTBB(1, 5, 3); + jobLauncherForm.disableMPI(); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + threadingComponent = null; + + // Re-enable MPI and TBB, disable OpenMP + jobLauncherForm.enableMPI(1, 1024, 512); + jobLauncherForm.enableTBB(1, 5, 3); + jobLauncherForm.disableOpenMP(); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Re-enable MPI and OpenMP, disable TBB + jobLauncherForm.enableMPI(1, 1024, 512); + jobLauncherForm.enableOpenMP(1, 5, 3); + jobLauncherForm.disableTBB(); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Re-enable MPI , disable TBB, OpenMP + jobLauncherForm.enableMPI(1, 1024, 512); + jobLauncherForm.disableOpenMP(); + jobLauncherForm.disableTBB(); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Re-enable OpenMP , disable TBB, MPI + jobLauncherForm.disableMPI(); + jobLauncherForm.enableOpenMP(1, 5, 3); + jobLauncherForm.disableTBB(); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Re-enable TBB , disable OpenMP, MPI + jobLauncherForm.disableMPI(); + jobLauncherForm.disableOpenMP(); + jobLauncherForm.enableTBB(1, 5, 2); + + // Make sure the component is still available + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Disable OpenMP and MPI and TBB + jobLauncherForm.disableMPI(); + jobLauncherForm.disableOpenMP(); + jobLauncherForm.disableTBB(); + threadingComponent = null; + + // Make sure the "Parallel Execution" component is disabled + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable OpenMP with bunk values + jobLauncherForm.enableOpenMP(-1, -2, -3); + + // Retrieve the Component + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Get the OpenMP Entry and check it - Everything should be equal to 1 + // since the values were negative + openMPEntry = threadingComponent + .retrieveEntry("Number of OpenMP Threads"); + assertNotNull(openMPEntry); + assertEquals("1", openMPEntry.getDefaultValue()); + assertEquals(1, openMPEntry.getAllowedValues().size()); + assertEquals("1", openMPEntry.getAllowedValues().get(0)); + + // Enable MPI with bunk values + jobLauncherForm.enableMPI(-1, -2, -3); + + // Get the MPI Entry and check it - Everything should be equal to 1 + // since the values were negative + mpiEntry = threadingComponent.retrieveEntry("Number of MPI Processes"); + assertNotNull(mpiEntry); + assertEquals("1", mpiEntry.getDefaultValue()); + assertEquals(1, mpiEntry.getAllowedValues().size()); + assertEquals("1", mpiEntry.getAllowedValues().get(0)); + + // Enable TBB with bunk values + jobLauncherForm.enableTBB(-1, -2, -3); + + // Retrieve the Component + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNotNull(threadingComponent); + + // Get the TBBEntry and check it - Everything should be equal to 1 + // since the values were negative + tBBEntry = threadingComponent.retrieveEntry("Number of TBB Threads"); + assertNotNull(tBBEntry); + assertEquals("1", tBBEntry.getDefaultValue()); + assertEquals(1, tBBEntry.getAllowedValues().size()); + assertEquals("1", tBBEntry.getAllowedValues().get(0)); + + // Disable TBB, OpenMP and MPI + threadingComponent = null; + jobLauncherForm.disableTBB(); + jobLauncherForm.disableMPI(); + jobLauncherForm.disableOpenMP(); + + // Enable OpenMP with more bunk values - Out of order + jobLauncherForm.enableOpenMP(54, 2, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable OpenMP with more bunk values - Bad default + jobLauncherForm.enableOpenMP(54, 56, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable MPI with more bunk values - Bad default + jobLauncherForm.enableMPI(54, 56, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable TBB with more bunk values - Bad default + jobLauncherForm.enableTBB(54, 56, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable TBB with more bunk values - Out of Order + jobLauncherForm.enableTBB(58, 56, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + // Enable MPI with more bunk values - Out of order + jobLauncherForm.enableOpenMP(54, 2, 1); + + // The parallel component should not be enabled because those values are + // bad in some way + for (Component i : jobLauncherForm.getComponents()) { + i.accept(this); + } + assertNull(threadingComponent); + + return; + + } + + /** + *

+ * An operation that checks the equals and hashCode operations. + *

+ * + */ + @Test + public void checkEquality() { + // Create JobLauncherForms to test + JobLauncherForm form = new JobLauncherForm(); + JobLauncherForm equalForm = new JobLauncherForm(); + JobLauncherForm unEqualForm = new JobLauncherForm(); + JobLauncherForm transitiveForm = new JobLauncherForm(); + + // Set ICEObject data + equalForm.setId(form.getId()); + transitiveForm.setId(form.getId()); + unEqualForm.setId(2); + + // Set names + equalForm.setName(form.getName()); + transitiveForm.setName(form.getName()); + unEqualForm.setName("DC UnEqual"); + + // Assert two equal Forms return true + assertTrue(form.equals(equalForm)); + + // Assert two unequal Forms return false + assertFalse(form.equals(unEqualForm)); + + // Assert equals() is reflexive + assertTrue(form.equals(form)); + + // Assert the equals() is Symmetric + assertTrue(form.equals(equalForm) && equalForm.equals(form)); + + // Assert equals() is transitive + if (form.equals(equalForm) && equalForm.equals(transitiveForm)) { + assertTrue(form.equals(transitiveForm)); + } else { + fail(); + } + + // Assert equals is consistent + assertTrue(form.equals(equalForm) && form.equals(equalForm) + && form.equals(equalForm)); + assertTrue(!form.equals(unEqualForm) && !form.equals(unEqualForm) + && !form.equals(unEqualForm)); + + // Assert checking equality with null is false + assertFalse(form==null); + + // Assert that two equal objects return same hashcode + assertTrue(form.equals(equalForm) + && form.hashCode() == equalForm.hashCode()); + + // Assert that hashcode is consistent + assertTrue(form.hashCode() == form.hashCode()); + + // Assert that hashcodes from unequal objects are different + assertTrue(form.hashCode() != unEqualForm.hashCode()); + + } + + /** + * An operation that tests xml persistence on JobLauncherForm. + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + */ + @Test + public void checkXMLPersistence() throws NullPointerException, JAXBException, IOException { + + /* + * The following sets of operations will be used to test the + * "read and write" portion of the JobLauncherForm Form. It will + * demonstrate the behavior of reading and writing from an + * "XML (inputStream and outputStream)" file. It will use an annotated + * Form to demonstrate basic behavior. + */ + + // Local Declarations + JobLauncherForm jobForm = new JobLauncherForm(); + JobLauncherForm loadedForm = new JobLauncherForm(); + ArrayList actions = new ArrayList(); + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(JobLauncherForm.class); + classList.addAll(new ICEJAXBClassProvider().getClasses()); + + // Setup a JobLauncherForm + jobForm.setName("I AM NEW!"); + jobForm.setDescription("Oh Somewhat NEW?!"); + jobForm.setId(3); + jobForm.enableMPI(2, 4, 2); + jobForm.enableOpenMP(2, 4, 3); + + // Add an action to the Form + actions.add("I am an action!"); + jobForm.setActionList(actions); + jobForm.setInputFiles("Input file", "The input file", + new ArrayList()); + + // persist to an output stream + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + xmlHandler.write(jobForm, classList, outputStream); + + // Load an Item from the first + loadedForm = (JobLauncherForm) xmlHandler.read(classList, new ByteArrayInputStream(outputStream + .toByteArray())); + // Make sure they match + assertTrue(jobForm.equals(loadedForm)); + + } + + /** + *

+ * Checks the copy and clone routines on JobLauncherForm. + *

+ * + */ + @Test + public void checkCopying() { + /* + * The following sets of operations will be used to test the + * "clone and copy" portion of JobLauncherForm. + */ + // Local Declarations + Form cloneForm = null, copyForm = new JobLauncherForm(); + JobLauncherForm jobForm = new JobLauncherForm(); + ArrayList actions = new ArrayList(); + + jobForm.setName("I AM NEW!"); + jobForm.setDescription("Oh Somewhat NEW?!"); + jobForm.setId(3); + + actions.add("I am an action!"); + jobForm.setActionList(actions); + jobForm.setInputFiles("Input file", "The input file", + new ArrayList()); + jobForm.enableMPI(2, 4, 2); + jobForm.enableOpenMP(2, 4, 3); + + // Copy contents + copyForm.copy(jobForm); + + // Check that it is equal + assertTrue(jobForm.equals(copyForm)); + + // Clone it + cloneForm = (Form) jobForm.clone(); + + // check that it is equal + assertTrue(jobForm.equals(cloneForm)); + + // pass null - Does not effect copy + copyForm.copy(null); + + // Nothing has changed + assertTrue(jobForm.equals(copyForm)); + + } + + /** + *

+ * This operation checks the JobLauncherForm to ensure that it can manage + * multiple input files. + *

+ * + */ + @Test + public void checkMultipleInputFiles() { + + // Local Declarations + ArrayList files1 = new ArrayList(), files2 = null, files3 = null; + ArrayList retFiles = new ArrayList(); + String filename1 = "Input file", filename2 = "Other input file", filename3 = "Final input file"; + String desc1 = filename1 + "description", desc2 = filename2 + + "description", desc3 = filename3 + "description"; + + // Setup some files for the Form + files1.add("testFile1"); + files1.add("testFile2"); + files1.add("testFile3"); + files1.add("testFile4"); + files1.add("testFile5"); + files2 = new ArrayList(files1.subList(0, 3)); + files3 = new ArrayList(files1.subList(0, 2)); + + // Create the JobLauncherForm + jobLauncherForm = new JobLauncherForm(); + jobLauncherForm.setInputFiles(filename1, desc1, files1); + jobLauncherForm.setInputFiles(filename2, desc2, files2); + jobLauncherForm.setInputFiles(filename3, desc3, files3); + + // Check the number of Components in the JobLauncherForm. It should have + // two, a DataComponent and an OutputComponent. + assertEquals(2, jobLauncherForm.getNumberOfComponents()); + + // Get the Entries + ArrayList entries = ((DataComponent) jobLauncherForm + .getComponent(1)).retrieveAllEntries(); + + // Check the number of Entries in the Platform component. There should + // be one entry each for the three input files. + assertEquals(3, entries.size()); + + // Check the first file set. The Input File Entry should have + // files.size() + // allowed values. + assertEquals(filename1, entries.get(0).getName()); + retFiles = entries.get(0).getAllowedValues(); + assertNotNull(retFiles); + assertEquals(files1.size(), retFiles.size()); + assertEquals(files1, retFiles); + + // Check the second file set + assertEquals(filename2, entries.get(1).getName()); + retFiles = entries.get(1).getAllowedValues(); + assertNotNull(retFiles); + assertEquals(files2.size(), retFiles.size()); + assertEquals(files2, retFiles); + + // Check the third file set + assertEquals(filename3, entries.get(2).getName()); + retFiles = entries.get(2).getAllowedValues(); + assertNotNull(retFiles); + assertEquals(files3.size(), retFiles.size()); + assertEquals(files3, retFiles); + + // Check the fourth file set + assertEquals(filename3, entries.get(2).getName()); + retFiles = entries.get(2).getAllowedValues(); + assertNotNull(retFiles); + assertEquals(files3.size(), retFiles.size()); + assertEquals(files3, retFiles); + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(DataComponent component) + */ + + public void visit(DataComponent component) { + + // We only care about the "Parallel Exectuion" Data component in this + // test + if ("Parallel Execution".equals(((DataComponent) component).getName())) { + threadingComponent = (DataComponent) component; + } + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(ResourceComponent component) + */ + public void visit(ResourceComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(TableComponent component) + */ + public void visit(TableComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(MatrixComponent component) + */ + public void visit(MatrixComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(IShape component) + */ + public void visit(IShape component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(GeometryComponent component) + */ + public void visit(GeometryComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(MasterDetailsComponent component) + */ + public void visit(MasterDetailsComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(TreeComposite component) + */ + public void visit(TreeComposite component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(IReactorComponent component) + */ + public void visit(IReactorComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(TimeDataComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(MeshComponent component) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AdaptiveTreeComposite component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(EMFComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(ListComponent component) { + // TODO Auto-generated method stub + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherTester.java new file mode 100644 index 000000000..e1f4ea397 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobLauncherTester.java @@ -0,0 +1,962 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.net.URI; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.junit.Test; +import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.datastructures.form.TableComponent; +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 java.util.ArrayList; +import java.util.Random; + +import javax.xml.bind.JAXBException; + +/** + * This class is responsible for testing the JobLauncher class. + * @author Jay Jay Billings + */ +public class JobLauncherTester { + + /** + * A fake JobLauncher to use for testing. + */ + private TestJobLauncher jobLauncher; + + /** + *

+ * 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. + *

+ * + */ + @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 selectedRowList = new ArrayList(); + 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"); + + // Check the status + assertEquals(FormStatus.NeedsInfo, status); + + // Get the Form and check it + form = jobLauncher.getForm(); + assertNotNull(form); + assertTrue(form instanceof LoginInfoForm); + + return; + + } + + /** + *

+ * This operations makes sure that it is possible to add and remove hosts + * from the JobLauncher. + *

+ * + */ + @Test + public void checkHosts() { + // Local Declarations + ArrayList list = new ArrayList(); + + // Setup Conditions + jobLauncher = new TestJobLauncher(null); + + // Test getHost to make sure it is initialized when constructor is used + assertNotNull(jobLauncher.getAllHosts()); + // It should have one host in there at the moment (notlocalhost) + assertEquals(1, jobLauncher.getAllHosts().size()); + + // Try to add hosts + jobLauncher.addHost("blah.blah.gov", "Windows 7 x64", "C:\\myProgram"); + jobLauncher.addHost("one.two.com", "Linux x86_x64", "home\\usr"); + jobLauncher.addHost("Hay.org", "MacOSX 10.4", "SomeDirectory"); + jobLauncher.addHost("tokyo.jp", "Playstation 3 OS", "home\\usr"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertEquals(5, list.size()); + assertEquals("notlocalhost", list.get(0)); + assertEquals("blah.blah.gov", list.get(1)); + assertEquals("one.two.com", list.get(2)); + assertEquals("Hay.org", list.get(3)); + assertEquals("tokyo.jp", list.get(4)); + + // add a duplicate host - check contents + jobLauncher.addHost("blah.blah.gov", "Windows 7 x64", "C:\\myProgram"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 5); + + // Add for null - hostname + jobLauncher.addHost(null, "Windows 7 x64", "C:\\myProgram"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 5); + + // Add for null - os + jobLauncher.addHost("blah.blah.gov", null, "C:\\myProgram"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 5); + + // Add for null - path + jobLauncher.addHost("blah.blah.gov", "Windows 7 x64", null); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 5); + + // Delete items with hostname + jobLauncher.deleteHost("blah.blah.gov"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 4); + + // Delete something that does not exist + jobLauncher.deleteHost("blah.blah.gov"); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 4); + + // Delete null + jobLauncher.deleteHost(null); + + // Get the hosts - check + list = jobLauncher.getAllHosts(); + assertFalse(list.isEmpty()); + assertEquals(list.size(), 4); + + return; + } + + /** + *

+ * This operation makes sure that it is possible to enable and disable + * support for TBB, OpenMP and MPI in the JobLauncher. + *

+ * + */ + @Test + public void checkEnablingParallelism() { + // Local Declarations: + JobLauncherForm form; + DataComponent dataC; + Entry entry; + + // check MPI + jobLauncher = new TestJobLauncher(null); + jobLauncher.setupForm(); + + // Legit use of enable + jobLauncher.enableMPI(1, 5, 2); + + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // 0 - set to 1 + jobLauncher.enableMPI(0, 5, 2); + + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // negative minimum + jobLauncher.enableMPI(-1, 5, 2); + + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Max less than minimum + jobLauncher.enableMPI(5, 2, 1); + + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // disable + jobLauncher.disableMPI(); + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + + // Should not have MPI - total number of components should be 3 + assertEquals(form.getComponents().size(), 3); + + // disable again, see if it breaks + jobLauncher.disableMPI(); + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + + // Should not have MPI - total number of components should be 3 + assertEquals(form.getComponents().size(), 3); + + // check OpenMP + // Just see if it crashes or not + // Legit use of enable + jobLauncher.enableOpenMP(1, 5, 2); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // 0 - set to 1 + jobLauncher.enableOpenMP(0, 5, 2); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals("2",entry.getValue()); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // negative minimum + jobLauncher.enableOpenMP(-1, 5, 2); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Max less than minimum + jobLauncher.enableOpenMP(5, 2, 1); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // disable + jobLauncher.disableOpenMP(); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + + entry = (Entry) dataC.retrieveAllEntries().get(0); + // Should not have MPI - total number of components should be 3 + assertEquals(form.getComponents().size(), 3); + + // disable again, see if it breaks + jobLauncher.disableOpenMP(); + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + + // Should not have MPI - total number of components should be 3 + assertEquals(form.getComponents().size(), 3); + + jobLauncher = new TestJobLauncher(null); + jobLauncher.setupForm(); + + // Enable them both + jobLauncher.enableMPI(1, 5, 2); + jobLauncher.enableOpenMP(1, 5, 2); + + // Check the dataComponent, see if they are both there + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + assertNotNull(entry); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Get the MPI data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values - nothing changed + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + jobLauncher = new TestJobLauncher(null); + jobLauncher.setupForm(); + + // Try to enable when the MPI or openMP is not created + jobLauncher.enableMPI(-1, 2, 3); + jobLauncher.enableOpenMP(-1, 2, 3); + + // Get the OpenMP data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + + // Should not have MPI - total number of components should be 3 + assertEquals(form.getComponents().size(), 3); + + // Tests for TBB + jobLauncher.enableTBB(1, 5, 3); + + // Get the data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveAllEntries().get(1); + + // Check values + assertEquals(entry.getValue(), "3"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Enable TBB with OpenMP and MPI + jobLauncher.enableTBB(1, 5, 3); + jobLauncher.enableMPI(1, 5, 4); + jobLauncher.enableOpenMP(1, 5, 2); + + // Get the data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveEntry("Number of TBB Threads"); + + // Check values - TBB + assertEquals(entry.getValue(), "3"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + entry = (Entry) dataC.retrieveEntry("Number of MPI Processes"); + // Check values - MPI + assertEquals(entry.getValue(), "4"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + entry = (Entry) dataC.retrieveEntry("Number of OpenMP Threads"); + // Check values - OpenMP + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Disable TBB + jobLauncher.disableTBB(); + + // Get the data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveEntry("Number of TBB Threads"); + + // Check values - TBB + assertNull(entry); + + // Check values - MPI + entry = (Entry) dataC.retrieveEntry("Number of MPI Processes"); + assertEquals(entry.getValue(), "4"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Check values - OpenMP + entry = (Entry) dataC.retrieveEntry("Number of OpenMP Threads"); + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Try to enable a bad TBB - out of order + jobLauncher.enableTBB(20, 10, 5); + // Get the data component and the respective values + form = (JobLauncherForm) jobLauncher.getForm(); + dataC = (DataComponent) form.getComponents().get(3); + entry = (Entry) dataC.retrieveEntry("Number of TBB Threads"); + + // Check values - TBB + assertNull(entry); + + // Check values - MPI + entry = (Entry) dataC.retrieveEntry("Number of MPI Processes"); + assertEquals(entry.getValue(), "4"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Check values - OpenMP + entry = (Entry) dataC.retrieveEntry("Number of OpenMP Threads"); + assertEquals(entry.getValue(), "2"); + assertEquals(entry.getAllowedValues().get(0), "1"); + assertEquals(entry.getAllowedValues().get(1), "5"); + + // Enable TBB, disable the rest, show that only TBB exists + jobLauncher.enableTBB(3, 20, 5); + jobLauncher.disableMPI(); + jobLauncher.disableOpenMP(); + + // Check values - TBB + entry = (Entry) dataC.retrieveEntry("Number of TBB Threads"); + assertEquals(entry.getValue(), "5"); + assertEquals(entry.getAllowedValues().get(0), "3"); + assertEquals(entry.getAllowedValues().get(1), "20"); + + // Check values - MPI + entry = (Entry) dataC.retrieveEntry("Number of MPI Processes"); + assertNull(entry); + + // Check values - OpenMP + entry = (Entry) dataC.retrieveEntry("Number of OpenMP Threads"); + assertNull(entry); + + // Disable TBB thread, show that component disappears + jobLauncher.disableTBB(); + assertNull(form.getComponent(dataC.getId())); + + } + + /** + *

+ * This operation checks the JobLauncher to ensure that its equals() + * operation works. + *

+ * + */ + @Test + public void checkEquality() { + + // Create JobLauncherItems to test + JobLauncher item = new JobLauncher(); + JobLauncher equalItem = new JobLauncher(); + JobLauncher unEqualItem = new JobLauncher(); + JobLauncher transitiveItem = new JobLauncher(); + + // Set ICEObject data + equalItem.setId(item.getId()); + transitiveItem.setId(item.getId()); + unEqualItem.setId(2); + + // Set names + equalItem.setName(item.getName()); + transitiveItem.setName(item.getName()); + unEqualItem.setName("DC UnEqual"); + + // Assert two equal Items return true + assertTrue(item.equals(equalItem)); + + // Assert two unequal Items return false + assertFalse(item.equals(unEqualItem)); + + // Assert equals() is reflexive + assertTrue(item.equals(item)); + + // Assert the equals() is Symmetric + assertTrue(item.equals(equalItem) && equalItem.equals(item)); + + // Assert equals() is transitive + if (item.equals(equalItem) && equalItem.equals(transitiveItem)) { + assertTrue(item.equals(transitiveItem)); + } else { + fail(); + } + + // Assert equals is consistent + assertTrue(item.equals(equalItem) && item.equals(equalItem) + && item.equals(equalItem)); + assertTrue(!item.equals(unEqualItem) && !item.equals(unEqualItem) + && !item.equals(unEqualItem)); + + // Assert checking equality with null is false + assertFalse(item==null); + + // Assert that two equal objects return same hashcode + assertTrue(item.equals(equalItem) + && item.hashCode() == equalItem.hashCode()); + + // Assert that hashcode is consistent + assertTrue(item.hashCode() == item.hashCode()); + + // Assert that hashcodes from unequal objects are different + assertTrue(item.hashCode() != unEqualItem.hashCode()); + + } + + /** + *

+ * This operation checks the JobLauncher to ensure that its copy() and + * clone() operations work as specified. + *

+ * + */ + @Test + public void checkCopying() { + + // Local Declarations + JobLauncher cloneItem = new JobLauncher(null), copyItem = new JobLauncher( + null); + JobLauncher jobItem = new JobLauncher(); + + jobItem.setDescription("I am a job!"); + jobItem.setExecutable("LS", "/opt/bin", "DOIT!!!!"); + jobItem.setProject(null); + + // run clone operations + cloneItem = (JobLauncher) jobItem.clone(); + + // check contents + assertEquals(jobItem.getAvailableActions(), + cloneItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), cloneItem.getDescription()); + assertTrue(jobItem.getForm().equals(cloneItem.getForm())); + assertEquals(jobItem.getId(), cloneItem.getId()); + assertEquals(jobItem.getItemType(), cloneItem.getItemType()); + assertEquals(jobItem.getName(), cloneItem.getName()); + assertEquals(jobItem.getStatus(), cloneItem.getStatus()); + assertEquals(jobItem.getAllHosts(), cloneItem.getAllHosts()); + + // run copy operation + copyItem.copy(jobItem); + + // check contents + assertEquals(jobItem.getAvailableActions(), + copyItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), copyItem.getDescription()); + assertTrue(jobItem.getForm().equals(copyItem.getForm())); + assertEquals(jobItem.getId(), copyItem.getId()); + assertEquals(jobItem.getItemType(), copyItem.getItemType()); + assertEquals(jobItem.getName(), copyItem.getName()); + assertEquals(jobItem.getStatus(), copyItem.getStatus()); + assertEquals(jobItem.getAllHosts(), copyItem.getAllHosts()); + + // run copy operation by passing null + copyItem.copy(null); + + // check contents - nothing has changed + assertEquals(jobItem.getAvailableActions(), + copyItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), copyItem.getDescription()); + assertTrue(jobItem.getForm().equals(copyItem.getForm())); + assertEquals(jobItem.getId(), copyItem.getId()); + assertEquals(jobItem.getItemType(), copyItem.getItemType()); + assertEquals(jobItem.getName(), copyItem.getName()); + assertEquals(jobItem.getStatus(), copyItem.getStatus()); + assertEquals(jobItem.getAllHosts(), copyItem.getAllHosts()); + + return; + } + + /** + * This operation checks the ability of the JobLauncher to persist itself to + * XML and to load itself from an XML input stream. + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + */ + @Test + public void checkXMLPersistence() throws NullPointerException, JAXBException, IOException { + /* + * The following sets of operations will be used to test the + * "read and write" portion of the JobLauncher Item. It will demonstrate + * the behavior of reading and writing from an + * "XML (inputStream and outputStream)" file. It will use an annotated + * Item to demonstrate basic behavior. + */ + + // Local declarations + JobLauncher loadedItem = new JobLauncher(); + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(JobLauncher.class); + classList.addAll(new ICEJAXBClassProvider().getClasses()); + + // Set up item + JobLauncher persistedItem = new JobLauncher(); + persistedItem.setDescription("JobLauncher item description"); + persistedItem.setId(5); + persistedItem.setName("Name!"); + persistedItem.getForm().setItemID(6); + + // persist to an output stream + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + xmlHandler.write(persistedItem, classList, outputStream); + + // Load an Item from the first + loadedItem = (JobLauncher) xmlHandler.read(classList,new ByteArrayInputStream(outputStream + .toByteArray())); + // Make sure they match + assertEquals(persistedItem, loadedItem); + + // Check the contents more closely to make sure that JobLauncher Item. + assertEquals(persistedItem.getAvailableActions(), + loadedItem.getAvailableActions()); + assertEquals(persistedItem.getDescription(), + loadedItem.getDescription()); + assertEquals(persistedItem.getForm(), loadedItem.getForm()); + assertEquals(persistedItem.getId(), loadedItem.getId()); + assertEquals(persistedItem.getItemType(), loadedItem.getItemType()); + assertEquals(persistedItem.getName(), loadedItem.getName()); + assertEquals(persistedItem.getStatus(), loadedItem.getStatus()); + assertTrue(persistedItem.getAllHosts().equals(loadedItem.getAllHosts())); + + return; + } + + /** + *

+ * This operation checks the JobLauncher to ensure that it can manage + * multiple input files. + *

+ * + */ + @Test + public void checkMultipleInputFiles() { + + // Local Declarations + String name = "JLwMF"; // JobLauncher with Multiple Files + String desc = "Duritanium Alloy"; + int numFiles = 0, numExtraFiles = 0, totalFiles = 0; + Form jobForm = null; + DataComponent fileComponent = null; + ArrayList fileEntries = null; + Random rng = new Random(2013052111); + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + // 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 projectDesc = ResourcesPlugin + .getWorkspace().newProjectDescription( + "itemTesterWorkspace"); + // Set the location of the project + projectDesc.setLocationURI(defaultProjectLocation); + // Create the project + project.create(projectDesc, 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(); + } + + // Set up the launcher + JobLauncher launcher = new JobLauncher(project); + launcher.setDescription("JobLauncher with multiple files"); + launcher.setId(5); + launcher.setName(name); + + // Get the form and make sure that there is only one file to start + jobForm = launcher.getForm(); + assertNotNull(jobForm); + fileComponent = (DataComponent) jobForm.getComponent(1); + assertNotNull(fileComponent); + fileEntries = fileComponent.retrieveAllEntries(); + numFiles = fileEntries.size(); + assertEquals(1, numFiles); + + // Add a few files + numExtraFiles = rng.nextInt(50) + 1; // +1 such that at least one added + totalFiles = 1 + numExtraFiles; // 1 by default + the extras + for (int i = 0; i < numExtraFiles; i++) { + launcher.addInputType(name + " " + i, name + i + "File", desc + " " + + i, null); + } + + // Check that the files were added + numFiles = fileEntries.size(); + assertEquals(totalFiles, numFiles); + + // Check the names and descriptions + for (int i = 1; i < totalFiles; i++) { + assertEquals(name + " " + (i - 1), fileEntries.get(i).getName()); + assertEquals(desc + " " + (i - 1), fileEntries.get(i) + .getDescription()); + } + + return; + } + + /** + *

+ * This operation insures that the JobLauncher properly refreshes after + * being issued a reload command. + *

+ * + */ +// @Test + public void checkDataReload() { + + // Local Declarations + String name = "JLwMF&R.test"; // JobLauncher with Multiple Files + String desc = "Duritanium Alloy"; + int numFileTypes = 0, numFiles = 0; + Form jobForm = null; + DataComponent fileComponent = null; + ArrayList fileEntries = null; + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + + // 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 projectDesc = ResourcesPlugin + .getWorkspace().newProjectDescription( + "itemTesterWorkspace"); + // Set the location of the project + projectDesc.setLocationURI(defaultProjectLocation); + // Create the project + project.create(projectDesc, 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(); + } + + try { + // Remove any old test files + for (IResource resource : project.members()) { + if (resource.getType() == IResource.FILE + && !(".project").equals(resource.getName())) { + + resource.delete(true, null); + } + } + // Refresh the project space + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e1) { + // Complain + e1.printStackTrace(); + fail(); + } + + // Get the file handle + IFile file = project.getFile(name); + + // Set up the launcher. The launcher uses both the full list of files + // for the input files (fileEntries[0]) and a filtered list of input + // files for the test (fileEntries[1]). + JobLauncher launcher = new JobLauncher(project); + launcher.setDescription("JobLauncher with multiple files"); + launcher.setId(5); + launcher.setName(name); + // Add a second input file that only works with test files so that we + // can test updating filtered input files. + launcher.addInputType(name, name + "File", desc + " ", ".test"); + + // Get the form and get the current number of input files. + jobForm = launcher.getForm(); + assertNotNull(jobForm); + fileComponent = (DataComponent) jobForm.getComponent(1); + assertNotNull(fileComponent); + fileEntries = fileComponent.retrieveAllEntries(); + numFileTypes = fileEntries.size(); + assertEquals(2, numFileTypes); + numFiles = fileEntries.get(0).getAllowedValues().size(); + // Also get the number of test files and make sure it is 0. + assertEquals(0, fileEntries.get(1).getAllowedValues().size()); + + // Create the test file in the workspace + String contents = "contents"; + ByteArrayInputStream testStream = new ByteArrayInputStream( + contents.getBytes()); + try { + file.create(testStream, true, null); + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + // Complain + e.printStackTrace(); + fail(); + } + + // Refresh the launcher + launcher.reloadProjectData(); + + // Check the number of input files and test files. Make sure the number + // of types didn't change! + assertEquals(numFileTypes, fileEntries.size()); + // The number of files should now be 1 (.project) + 1 (Process output) + + // 1 (the test file) + numFiles = 3; + // Make sure that the number of input files is correct + System.out.println("JobLauncherTester Message: " + "NumFiles = " + + (numFiles + 1)); + System.out.println("JobLauncherTester Message: " + "File Entries = " + + fileEntries.get(0).getAllowedValues().size()); + for (String value : fileEntries.get(0).getAllowedValues()) { + System.out.println(value); + } + assertEquals(numFiles, fileEntries.get(0).getAllowedValues().size()); + // Also get the number of test files and make sure it is 0. + assertEquals(1, fileEntries.get(1).getAllowedValues().size()); + + // Delete the test file + try { + file.delete(true, null); + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + // Complain + e.printStackTrace(); + fail(); + } + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileBuilderTester.java new file mode 100644 index 000000000..7f3fbf084 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileBuilderTester.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.jobprofile.JobProfile; +import org.eclipse.ice.item.jobprofile.JobProfileBuilder; +import org.junit.Ignore; +import org.junit.Test; + +/** + *

+ * This class is responsible for testing the JobProfileBuilder. It checks to + * make sure that JobProfileBuilder returns the correct Item name and Item type. + * In also tries to build a new JobProfile and check it. + *

+ * + * @author Jay Jay Billings + */ + +public class JobProfileBuilderTester { + /** + * + */ + private JobProfileBuilder jobProfileBuilder; + + /** + *

+ * This operation checks the Item type and Item name of the + * JobProfileBuilder. + *

+ * + */ + @Test + public void checkJobProfileInformation() { + + // create a JobProfileBuilder + jobProfileBuilder = new JobProfileBuilder(); + + // Check the Item type and name. The JobProfile is a Model. + assertEquals(ItemType.Model, jobProfileBuilder.getItemType()); + assertEquals("Job Profile", jobProfileBuilder.getItemName()); + + } + + /** + *

+ * This operation creates a JobProfile and checks it to make sure it was + * actually built properly. + *

+ * + */ + @Test + public void checkJobProfile() { + + // create a JobProfileBuilder + jobProfileBuilder = new JobProfileBuilder(); + + // build + JobProfile jobProfile = (JobProfile) jobProfileBuilder.build(null); + + // Check item builder name + assertEquals(jobProfileBuilder.getItemName(), + jobProfile.getItemBuilderName()); + + // check to make sure it was build properly. + assertNotNull(jobProfile.getForm()); + assertEquals("Create a Job Launcher", jobProfile.getForm() + .getActionList().get(0)); + + // Check the actions + assertEquals(1, jobProfile.getAvailableActions().size()); + assertEquals("Create A JobLauncher", jobProfile.getAvailableActions() + .get(0)); + // Make sure the JobProfile is returning the correct type. + assertEquals(ItemType.Model, jobProfile.getItemType()); + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileFormTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileFormTester.java new file mode 100644 index 000000000..7b7cfc282 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileFormTester.java @@ -0,0 +1,401 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; + +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.TableComponent; +import org.eclipse.ice.item.jobprofile.JobProfileForm; +import org.junit.Ignore; +import org.junit.Test; + +/** + *

+ * This class checks the JobProfileForm. + *

+ * + * @author Jay Jay Billings + */ + +public class JobProfileFormTester { + /** + * + */ + private JobProfileForm jobProfileForm; + + /** + *

+ * This operation checks the contents of the JobProfileForm to make sure + * that they are consistent with the specification. + *

+ * + */ + @Test + public void checkFormContents() { + + // Local Declarations + DataComponent exeInfo = null; + DataComponent threadOps = null; + TableComponent hostnames = null; + TableComponent dataFiles = null; + int entryId = 1; + + Entry entry = null; + + // Create a new JobProfileForm + jobProfileForm = new JobProfileForm(); + + // Check jobProfile + assertEquals("Job Profile Editor", jobProfileForm.getName()); + assertEquals( + "Create or edit a Job Profile that will be used by ICE to launch jobs.", + jobProfileForm.getDescription()); + + // Check contents. Make sure labels are set correctly, default values, + // etc. + + // Check that there are 4 components + // 2 data components and 2 table components. + + assertEquals(4, jobProfileForm.getComponents().size()); + assertEquals(DataComponent.class, jobProfileForm.getComponents().get(0) + .getClass()); + assertEquals(DataComponent.class, jobProfileForm.getComponents().get(1) + .getClass()); + assertEquals(TableComponent.class, jobProfileForm.getComponents() + .get(2).getClass()); + assertEquals(TableComponent.class, jobProfileForm.getComponents() + .get(3).getClass()); + + // Check first Component - Execution Information + // get the first dataComponent + exeInfo = (DataComponent) jobProfileForm.getComponents().get(0); + // check name and description for section + assertEquals("Execution Information", exeInfo.getName()); + assertEquals( + "This block contains information pertaining to the execution of the program. This includes the name of the job, input file and output types, the executable, and parameters.", + exeInfo.getDescription()); + + // check entries of component name, description, and default values; + // Job Name + entry = (Entry) exeInfo.retrieveAllEntries().get(0); + // check name, description, and values + assertEquals("Job Name", entry.getName()); + assertEquals("This is a name for the job profile.", + entry.getDescription()); + assertEquals("JobProfile", entry.getDefaultValue()); + assertEquals("JobProfile", entry.getValue()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("jobName", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Executable Name + entry = (Entry) exeInfo.retrieveAllEntries().get(1); + // check name, description, and values + assertEquals("Executable Name", entry.getName()); + assertEquals("ls", entry.getDefaultValue()); + assertEquals("ls", entry.getValue()); + assertEquals("Specifies the command line argument to " + + "execute the job (excludes parameters for the job). " + + "If the executable is not installed on the path, you " + + "should include the ${installDir} variable in the " + + "appropriate place.", entry.getDescription()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("executableName", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Commented out due to it will not show on the profile at this time + /* + * //Input File entry = (Entry) exeInfo.retrieveAllEntries().get(2); + * //check name, description, and values assertEquals("Input File", + * entry.getName()); assertEquals("inputFile.txt", + * entry.getDefaultValue()); assertEquals("inputFile.txt", + * entry.getValue()); + * assertEquals("Specifies the input file for the simulator.", + * entry.getDescription()); assertEquals(AllowedValueType.Undefined, + * entry.getValueType()); assertEquals("inputFile", entry.getTag()); + */ + + // Parameters + // Input File + entry = (Entry) exeInfo.retrieveAllEntries().get(2); + // check name, description, and values + assertEquals("Parameters", entry.getName()); + assertEquals("Specifies the parameters for a job.", + entry.getDescription()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("parameters", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Commented out due to it will not show on the profile at this time + /* + * //Output File Type entry = (Entry) + * exeInfo.retrieveAllEntries().get(4); //check name, description, and + * values assertEquals("Output File Type", entry.getName()); + * assertEquals("*.type", entry.getDefaultValue()); + * assertEquals("*.type", entry.getValue()); + * assertEquals("Specifies the output file type for a simulator.", + * entry.getDescription()); assertEquals(AllowedValueType.Undefined, + * entry.getValueType()); assertEquals("outputFileType", + * entry.getTag()); + */ + + // Check second Component - Threading Options + // get the second dataComponent + threadOps = (DataComponent) jobProfileForm.getComponents().get(1); + // check name and description for section + assertEquals("Threading Options", threadOps.getName()); + assertEquals( + "This section contains tools to enable certain threading or processes options for MPI and OpenMP.", + threadOps.getDescription()); + + // check entries of component name, description, and default values; + // Enable OpenMP + entry = (Entry) threadOps.retrieveAllEntries().get(0); + // check name, description, and values + assertEquals("Enable OpenMP", entry.getName()); + assertEquals("Specifies if the program utilizes OpenMP library.", + entry.getDescription()); + assertEquals("No", entry.getDefaultValue()); + assertEquals("No", entry.getValue()); + assertEquals("Yes", entry.getAllowedValues().get(0)); + assertEquals("No", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Discrete, entry.getValueType()); + assertEquals("enableOpenMP", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Number of Threads + entry = (Entry) threadOps.retrieveAllEntries().get(1); + // check name, description, and values + assertEquals("Default Number of Threads", entry.getName()); + assertEquals("Specifies the default number of threads for OpenMP.", + entry.getDescription()); + assertEquals("1", entry.getDefaultValue()); + assertEquals("1", entry.getValue()); + assertEquals("1", entry.getAllowedValues().get(0)); + assertEquals("128", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Continuous, entry.getValueType()); + assertEquals("numOfThreads", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Enable MPI + entry = (Entry) threadOps.retrieveAllEntries().get(2); + // check name, description, and values + assertEquals("Enable MPI", entry.getName()); + assertEquals("Specifies if the program utilizes MPI library.", + entry.getDescription()); + assertEquals("No", entry.getDefaultValue()); + assertEquals("No", entry.getValue()); + assertEquals("Yes", entry.getAllowedValues().get(0)); + assertEquals("No", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Discrete, entry.getValueType()); + assertEquals("enableMPI", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Number of Processes + entry = (Entry) threadOps.retrieveAllEntries().get(3); + // check name, description, and values + assertEquals("Default Number of Processes", entry.getName()); + assertEquals("Specifies the default number of processes for MPI.", + entry.getDescription()); + assertEquals("1", entry.getDefaultValue()); + assertEquals("1", entry.getValue()); + assertEquals("1", entry.getAllowedValues().get(0)); + assertEquals("512000", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Continuous, entry.getValueType()); + assertEquals("numOfProcesses", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Enable TBB + entry = (Entry) threadOps.retrieveAllEntries().get(4); + // check name, description, and values + assertEquals("Enable TBB", entry.getName()); + assertEquals( + "Specifies if the program utilizes Thread Building Blocks.", + entry.getDescription()); + assertEquals("No", entry.getDefaultValue()); + assertEquals("No", entry.getValue()); + assertEquals("Yes", entry.getAllowedValues().get(0)); + assertEquals("No", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Discrete, entry.getValueType()); + assertEquals("enableTBB", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Number of TBBs + entry = (Entry) threadOps.retrieveAllEntries().get(5); + // check name, description, and values + assertEquals("Default Number of TBBs", entry.getName()); + assertEquals("Specifies the default number of Thread Blocks.", + entry.getDescription()); + assertEquals("1", entry.getDefaultValue()); + assertEquals("1", entry.getValue()); + assertEquals("1", entry.getAllowedValues().get(0)); + assertEquals("128", entry.getAllowedValues().get(1)); + assertEquals(AllowedValueType.Continuous, entry.getValueType()); + assertEquals("numOfTBBs", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Check third Component - Hostnames + // get the second dataComponent + hostnames = (TableComponent) jobProfileForm.getComponents().get(2); + // check name and description for section + assertEquals("Hostnames", hostnames.getName()); + assertEquals( + "This section contains information pertaining to the hostname, operating system, and installed directories for the executables.", + hostnames.getDescription()); + + // Check the tableComponent's properties - initialized correctly + assertEquals(3, hostnames.numberOfColumns()); + // It will have a row pre-initialized + assertEquals(1, hostnames.numberOfRows()); + + // check column names + assertEquals(3, hostnames.getColumnNames().size()); + assertEquals("Hostname", hostnames.getColumnNames().get(0)); + assertEquals("Operating System", hostnames.getColumnNames().get(1)); + assertEquals("Install Directory", hostnames.getColumnNames().get(2)); + + // check entries of component name, description, and default values; + // Hostname + entry = (Entry) hostnames.getRowTemplate().get(0); + // check name, description, and values + assertEquals("Hostname", entry.getName()); + assertEquals( + "Specifies the location of the executable. Use localhost for executables stored locally.", + entry.getDescription()); + assertEquals("localhost", entry.getDefaultValue()); + assertEquals("localhost", entry.getValue()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("hostname", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Operating System + entry = (Entry) hostnames.getRowTemplate().get(1); + // check name, description, and values + assertEquals("Operating System", entry.getName()); + assertEquals( + "Specifies the operating system installed for the hostname.", + entry.getDescription()); + assertEquals("Linux x86_x64", entry.getDefaultValue()); + assertEquals("Linux x86_x64", entry.getValue()); + assertEquals("Linux x86_x64", entry.getAllowedValues().get(0)); + assertEquals("Linux x86", entry.getAllowedValues().get(1)); + assertEquals("Windows x86", entry.getAllowedValues().get(2)); + assertEquals("Windows x64", entry.getAllowedValues().get(3)); + assertEquals("Mac OSX", entry.getAllowedValues().get(4)); + assertEquals(AllowedValueType.Discrete, entry.getValueType()); + assertEquals("operatingSystem", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // Install Directory + entry = (Entry) hostnames.getRowTemplate().get(2); + // check name, description, and values + assertEquals("Install Directory", entry.getName()); + assertEquals("Specifies the install directory for a hostname.", + entry.getDescription()); + assertEquals("/bin", entry.getDefaultValue()); + assertEquals("/bin", entry.getValue()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("installDirectory", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // check the first row's values + Entry entry1 = null; + Entry entry2 = null; + Entry entry3 = null; + entry1 = (Entry) hostnames.getRow(0).get(0); + entry2 = (Entry) hostnames.getRow(0).get(1); + entry3 = (Entry) hostnames.getRow(0).get(2); + + assertEquals("localhost", entry1.getValue()); + assertEquals("Linux x86_x64", entry2.getValue()); + assertEquals("/bin", entry3.getValue()); + + // Check forth Component - Data Files + // get the second dataComponent + dataFiles = (TableComponent) jobProfileForm.getComponents().get(3); + // check name and description for section + assertEquals("Data Files", dataFiles.getName()); + assertEquals( + "This section contains information pertaining to required files for the program to function nominally.", + dataFiles.getDescription()); + + // Check the tableComponent's properties - initialized correctly + assertEquals(2, dataFiles.numberOfColumns()); + assertEquals(0, dataFiles.numberOfRows()); + + // check column names + assertEquals(2, dataFiles.getColumnNames().size()); + assertEquals("Data File", dataFiles.getColumnNames().get(0)); + assertEquals("File Path", dataFiles.getColumnNames().get(1)); + + // check entries of component name, description, and default values; + // Data File + entry = (Entry) dataFiles.getRowTemplate().get(0); + // check name, description, and values + assertEquals("Data File", entry.getName()); + assertEquals("Specifies a data file required to run an executable.", + entry.getDescription()); + assertEquals("text.txt", entry.getDefaultValue()); + assertEquals("text.txt", entry.getValue()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("dataFile", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + // File Path + entry = (Entry) dataFiles.getRowTemplate().get(1); + // check name, description, and values + assertEquals("File Path", entry.getName()); + assertEquals("Specifies the install directory for a data file.", + entry.getDescription()); + assertEquals("/opt/bin", entry.getDefaultValue()); + assertEquals("/opt/bin", entry.getValue()); + assertEquals(AllowedValueType.Undefined, entry.getValueType()); + assertEquals("filePath", entry.getTag()); + // Check the Entry's id and increment the counter. + assertEquals(entryId, entry.getId()); + entryId++; + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileTester.java new file mode 100644 index 000000000..aab5f811b --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/JobProfileTester.java @@ -0,0 +1,217 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.File; +import java.net.URI; +import java.util.ArrayList; + +import javax.xml.bind.JAXBException; + +import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.ResourceComponent; +import org.eclipse.ice.item.jobLauncher.JobLauncher; +import org.eclipse.ice.item.jobprofile.JobProfile; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.junit.Test; + +/** + * This class is responsible for testing the JobProfileBuilder. It is primarily + * concerned with checking the ability of the JobProfileBuilder to write the new + * profile to disk correctly after it is created. + * + * @author Jay Jay Billings, Anna Wojtowicz + */ +public class JobProfileTester { + + /** + * A JobProfile used for testing. + */ + private JobProfile jobProfile; + + /** + * This operation checks the JobProfile by processing it and reviewing + * comparing the Item it creates to the original. It also checks the + * quantities in the XML to make sure that they are consistent with the + * specification and useful for launching jobs. + * + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + */ + @Test + public void checkProfileWriting() throws NullPointerException, JAXBException, IOException { + + // Begin by setting up a project space we can work with + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String separator = System.getProperty("file.separator"); + + // 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. Use + // file() to get around the URI problems with spaces. + 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(); + } + + // Now we have the project space, pass project into jobProfile + + // Create a job profile + jobProfile = new JobProfile(project); + // Should persist file to XML + jobProfile.process("Create a Job Launcher"); + + // Get the persisted file and make sure it's valid + IFile file = project.getFolder("jobProfiles").getFile("JobProfile.xml"); + assertTrue(file.exists()); + + // Load file into inputStream + ByteArrayInputStream inputStream = null; + try { + + // Convert to a string and then convert that string to an + // InputStream + BufferedReader br = new BufferedReader(new InputStreamReader( + file.getContents())); + + StringBuilder sb = new StringBuilder(); + String line; + try { + while ((line = br.readLine()) != null) { + sb.append(line); + } + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println(sb.toString()); + inputStream = new ByteArrayInputStream(sb.toString().getBytes()); + } catch (CoreException e) { + e.printStackTrace(); + } + + // Load file from inputSteam to object + JobLauncher launcher = new JobLauncher(); + + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(JobLauncher.class); + classList.add(ResourceComponent.class); + launcher = (JobLauncher) xmlHandler.read(classList, inputStream); + + // check contents of JobLauncher (item portion). Should be default + // values besides form: + JobLauncher comparisonLauncher = new JobLauncher(); + comparisonLauncher.setName("JobProfile"); + comparisonLauncher + .setDescription("This operation will execute JobProfile"); + comparisonLauncher.setItemBuilderName("JobProfile"); + assertEquals(comparisonLauncher.getName(), launcher.getName()); + assertEquals(comparisonLauncher.getDescription(), + launcher.getDescription()); + assertEquals(comparisonLauncher.getItemType(), launcher.getItemType()); + assertEquals(comparisonLauncher.getStatus(), launcher.getStatus()); + assertEquals(comparisonLauncher.getItemBuilderName(), + launcher.getItemBuilderName()); + // This next check is to make sure that the JobProfile sets the builder + // name according to the specification on the class. + assertEquals(launcher.getName(), launcher.getItemBuilderName()); + + // Check contents of form + Form form = launcher.getForm(); + assertEquals("JobProfile Launcher", form.getName()); + assertEquals("This operation will execute JobProfile", + form.getDescription()); + assertEquals(3, form.getComponents().size()); + + // Enable OpenMP and MPI on the launcher + launcher.enableMPI(1, 512000, 1); + launcher.enableOpenMP(1, 16, 1); + + // Verify they were set correctly + DataComponent component = (DataComponent) form.getComponents().get(3); + Entry mpiEntry = (Entry) component.retrieveAllEntries().get(1); + Entry openMPEntry = (Entry) component.retrieveAllEntries().get(2); + assertEquals("1", mpiEntry.getValue()); + assertEquals("1", openMPEntry.getValue()); + + // Delete the files from the workspace + try { + // Remove any old test files + for (IResource resource : project.members()) { + if (resource.getType() == IResource.FILE + && !(".project").equals(resource.getName())) { + // Convert the resource to a File resource. It's necessary + // to do this for the Windows build so we can use + // File.deleteOnExit() here. When Windows attempts to delete + // a resource, it does not automatically release any open + // handles on files the same way *nix systems do. Failing + // to delete these resources causes subsequent Item tests + // to fail on a Windows build. + File fileResource = + new File(resource.getLocation().toOSString()); + fileResource.deleteOnExit(); + } + } + // Refresh the project space + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e1) { + // Complain + e1.printStackTrace(); + fail(); + } + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/LoginInfoFormTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/LoginInfoFormTester.java new file mode 100644 index 000000000..9ebe3737b --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/LoginInfoFormTester.java @@ -0,0 +1,117 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.util.ArrayList; + +import org.junit.Test; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.item.action.LoginInfoForm; + +/** + *

+ * This class is responsible for testing the LoginInfoForm class. + *

+ * + * @author Jay Jay Billings + */ +public class LoginInfoFormTester { + /** + *

+ * The LoginInfoForm that is under test. + *

+ * + */ + private LoginInfoForm loginInfoForm; + + /** + *

+ * This operation checks the Form to ensure that it is a Form with single + * DataComponent and that the Entries in that component are setup to reflect + * usernames and passwords. + *

+ * + */ + @Test + public void checkForm() { + + // Local Declarations + ArrayList entries = null; + + // Allocate the login Form + loginInfoForm = new LoginInfoForm(); + + // Check the number of DataComponents + assertEquals(1, loginInfoForm.getNumberOfComponents()); + + // Check the number of Entries + entries = ((DataComponent) (loginInfoForm.getComponents().get(0))) + .retrieveAllEntries(); + assertNotNull(entries); + assertEquals(2, entries.size()); + + // Check the default Entry names + assertEquals("Username", entries.get(0).getName()); + assertEquals("Password", entries.get(1).getName()); + + // Make sure that the password Entry is secret + assertTrue(entries.get(1).isSecret()); + + return; + + } + + /** + *

+ * This operation checks the convenience methods on the LoginInfoForm that + * are used to set the description of the Form and the prompt names for the + * Entries. + *

+ * + */ + @Test + public void checkConvenienceMethods() { + + // Local Declarations + ArrayList entries = null; + Entry username = null, password = null; + + // Allocate the login Form + loginInfoForm = new LoginInfoForm(); + + // Check the number of Entries + entries = ((DataComponent) (loginInfoForm.getComponents().get(0))) + .retrieveAllEntries(); + assertNotNull(entries); + + // Check setting the username prompt + username = entries.get(0); + loginInfoForm.setUsernamePrompt("Peeps"); + assertEquals("Peeps", username.getName()); + + // Check setting the password prompt + password = entries.get(0); + loginInfoForm.setUsernamePrompt("Throwing Fire"); + assertEquals("Throwing Fire", password.getName()); + + // Check setting the description + loginInfoForm.setPromptDescription("Prompt Description"); + assertEquals("Prompt Description", loginInfoForm.getDescription()); + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/MultiLauncherTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/MultiLauncherTester.java new file mode 100644 index 000000000..8c9d42d12 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/MultiLauncherTester.java @@ -0,0 +1,417 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.ice.datastructures.ICEObject.Component; +import org.eclipse.ice.datastructures.ICEObject.ListComponent; +import org.eclipse.ice.datastructures.componentVisitor.IComponentVisitor; + +import static org.eclipse.ice.item.jobLauncher.multiLauncher.MultiLauncher.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.net.URI; +import java.util.ArrayList; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.eclipse.ice.datastructures.form.AdaptiveTreeComposite; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.datastructures.form.MasterDetailsComponent; +import org.eclipse.ice.datastructures.form.TimeDataComponent; +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.datastructures.form.ResourceComponent; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.ice.datastructures.form.TableComponent; +import org.eclipse.ice.datastructures.form.MatrixComponent; +import org.eclipse.ice.datastructures.form.emf.EMFComponent; +import org.eclipse.ice.datastructures.form.geometry.IShape; +import org.eclipse.ice.datastructures.form.geometry.GeometryComponent; +import org.eclipse.ice.datastructures.form.mesh.MeshComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.datastructures.componentVisitor.IReactorComponent; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemBuilder; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.jobLauncher.multiLauncher.MultiLauncher; +import org.eclipse.ice.item.jobLauncher.multiLauncher.MultiLauncherBuilder; + +/** + *

+ * This class is responsible for testing the MultiLauncherBuilder and the + * MultiLauncher classes. It realizes the IComponentVisitor interface so that it + * can sort and examine the components from the MultiLauncher's Form. + *

+ * + * @author Jay Jay Billings + */ +public class MultiLauncherTester implements IComponentVisitor { + /** + * + */ + private MultiLauncherBuilder multiLauncherBuilder; + + /** + * + */ + private DataComponent dataComponent = null; + /** + *

+ * The MasterDetailsComponent from the MultiLauncher. + *

+ * + */ + private MasterDetailsComponent masterDetailsComponent = null; + + /** + *

+ * A reference to the project space. + *

+ * + */ + private static IProject projectSpace; + + /** + *

+ * The ResourceComponent from the MultiLauncher. + *

+ * + */ + private ResourceComponent resourceComponent; + + /** + *

+ * This operation is called before the test to setup the project space. + *

+ * + */ + @BeforeClass + public static void Before() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + String separator = System.getProperty("file.separator"); + String filename = null; + + // Setup the project + try { + // Get the project handle + projectSpace = workspaceRoot.getProject("itemTesterWorkspace"); + // If the project does not exist, create it + if (!projectSpace.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 + projectSpace.create(desc, null); + } + // Open the project if it is not already open + if (projectSpace.exists() && !projectSpace.isOpen()) { + projectSpace.open(null); + } + } catch (CoreException e) { + // Catch for creating the project + e.printStackTrace(); + fail(); + } + + } + + /** + *

+ * This operation checks the MultiLauncherBuilder to make sure that it can + * create a fully initialized MultiLauncher. It does this by registering + * several anonymous subclasses of Item, some with the ItemType.Simulation + * type and some with other types, and then calls build() to create the + * launcher. It considers the test successful if it can retrieve the Form + * from the launcher and find information for each of the Items that it + * registered with type ItemType.Simulation. + *

+ * + */ + @Test + public void checkConstruction() { + + // Create the builder + int numBuilders = 4; + FakeItemBuilder builder = null; + ArrayList builders = new ArrayList(); + multiLauncherBuilder = new MultiLauncherBuilder(); + + // Check the details of the builder + assertEquals("MultiLauncher", multiLauncherBuilder.getItemName()); + assertEquals(ItemType.Simulation, multiLauncherBuilder.getItemType()); + + // Make sure calling build returns null since no builders have been + // added + assertNull(multiLauncherBuilder.build(projectSpace)); + + // Create some ItemBuilders and register them with the + // MultiLauncherBuilder + for (int i = 0; i < numBuilders; i++) { + builder = new FakeItemBuilder(); + builder.setNameForTest("Sally " + i); + builders.add(builder); + } + // Add one more that is not a JobLauncher + builder = new FakeItemBuilder(); + builder.setNameForTest("Love Hitchiker"); + builder.setTypeForTest(ItemType.ModelOutputPackage); + builders.add(builder); + + // Set the list of builders + multiLauncherBuilder.addBuilders(builders); + + // Build a MultiLauncher + Item launcher = multiLauncherBuilder.build(projectSpace); + + // Check the launcher + assertNotNull(launcher); + assertTrue(launcher instanceof MultiLauncher); + assertTrue(launcher.getName().contains("MultiLauncher")); + + // Grab the Form and take a look at it. It should have one component. + Form form = launcher.getForm(); + assertEquals(2, form.getNumberOfComponents()); + + // Get the Component from the Form and visit it to get the data and + // master-details components + ArrayList components = form.getComponents(); + assertNotNull(components); + assertEquals(2, components.size()); + for (Component component : components) { + component.accept(this); + } + // Check the DataComponent. This component is the header or "globals" + // component from the MasterDetailsComponent of the launcher. + assertNotNull(dataComponent); + assertEquals("Execution Mode", dataComponent.getName()); + assertNotNull(dataComponent.retrieveEntry("Enable Parallel Execution")); + // The DataComponent should have id = 3 + assertEquals(3, dataComponent.getId()); + + // Check the MasterDetailsComponent + assertNotNull(masterDetailsComponent); + assertEquals(numBuilders, masterDetailsComponent + .getAllowedMasterValues().size()); + // The MasterDetailsComponent should have id = 1 + assertEquals(1, masterDetailsComponent.getId()); + ArrayList allowedMasterValues = masterDetailsComponent + .getAllowedMasterValues(); + // Loop over the builders and check them as they were constructed above. + for (int i = 0; i < numBuilders; i++) { + assertTrue(allowedMasterValues.contains("Sally " + i)); + } + // The launcher should not contain an Item named "Love Hitchiker" + // because it was not a JobLauncher. + assertTrue(!allowedMasterValues.contains("Love Hitchiker")); + + // Check the ResourceComponent + assertNotNull(resourceComponent); + // The ResourceComponent should have id = 2 + assertEquals(2, resourceComponent.getId()); + + } + + /** + *

+ * This operation modifies the Form retrieved from the MultiLauncher and + * submits it back to the launcher to make sure that it can be submitted + * successfully. + *

+ * + */ + @Test + public void checkFormSubmission() { + + // Create the builder + int numBuilders = 4; + FakeItemBuilder builder = null; + ArrayList builders = new ArrayList(); + multiLauncherBuilder = new MultiLauncherBuilder(); + + // Check the details of the builder + assertEquals("MultiLauncher", multiLauncherBuilder.getItemName()); + assertEquals(ItemType.Simulation, multiLauncherBuilder.getItemType()); + + // Create some ItemBuilders and register them with the + // MultiLauncherBuilder + for (int i = 0; i < numBuilders; i++) { + builder = new FakeItemBuilder(); + builder.setNameForTest("Sally " + i); + builders.add(builder); + } + // Set the list of builders + multiLauncherBuilder.addBuilders(builders); + + // Build a MultiLauncher + Item launcher = multiLauncherBuilder.build(projectSpace); + assertNotNull(launcher); + + // Grab the Form and get the component + Form form = launcher.getForm(); + ArrayList components = form.getComponents(); + components.get(0).accept(this); + + // Add a few "Sally" launchers + int id = masterDetailsComponent.addMaster(); + masterDetailsComponent.setMasterInstanceValue(id, "Sally 1"); + masterDetailsComponent.addMaster(); + masterDetailsComponent.setMasterInstanceValue(id, "Sally 1"); + masterDetailsComponent.addMaster(); + masterDetailsComponent.setMasterInstanceValue(id, "Sally 2"); + masterDetailsComponent.addMaster(); + masterDetailsComponent.setMasterInstanceValue(id, "Sally 0"); + + // Submit the Form and make sure it is accepted + assertEquals(FormStatus.ReadyToProcess, launcher.submitForm(form)); + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(DataComponent component) + */ + public void visit(DataComponent component) { + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(ResourceComponent component) + */ + public void visit(ResourceComponent component) { + + resourceComponent = component; + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(TableComponent component) + */ + public void visit(TableComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(MatrixComponent component) + */ + public void visit(MatrixComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(IShape component) + */ + public void visit(IShape component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(GeometryComponent component) + */ + public void visit(GeometryComponent component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(MasterDetailsComponent component) + */ + public void visit(MasterDetailsComponent component) { + + // Set the MasterDetailsComponent + masterDetailsComponent = component; + // Set its header component + dataComponent = masterDetailsComponent.getGlobalsComponent(); + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(TreeComposite component) + */ + public void visit(TreeComposite component) { + // TODO Auto-generated method stub + + } + + /** + * (non-Javadoc) + * + * @see IComponentVisitor#visit(IReactorComponent component) + */ + public void visit(IReactorComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(TimeDataComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(MeshComponent component) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AdaptiveTreeComposite component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(EMFComponent component) { + // TODO Auto-generated method stub + + } + + @Override + public void visit(ListComponent component) { + // TODO Auto-generated method stub + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ParameterListTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ParameterListTester.java new file mode 100644 index 000000000..2ca3d18ec --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/ParameterListTester.java @@ -0,0 +1,351 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; + +import javax.xml.bind.JAXBException; + +import org.junit.Test; +import org.eclipse.ice.datastructures.ICEObject.ICEJAXBHandler; +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.utilities.trilinos.Parameter; +import org.eclipse.ice.item.utilities.trilinos.ParameterList; + +/** + * This class checks the Parameter and ParameterList classes to make sure that + * their toEntry() and toTreeComposite() operations work as described. + */ +public class ParameterListTester { + /** + *

+ * This operation checks the parameter classes toEntry() operation. + *

+ * + */ + @Test + public void checkParameter() { + + // Local Declarations + Parameter param = null, retParam = null; + + // Create a parameter + param = new Parameter(); + param.name = "MyParameter"; + param.value = "0.1"; + param.type = "double"; + + // Create an Entry from the parameter - start with double + Entry parameterEntry = param.toEntry(); + // Check the name + assertEquals(param.name, parameterEntry.getName()); + // Check the value + assertEquals(param.value, parameterEntry.getDefaultValue()); + assertEquals(param.value, parameterEntry.getValue()); + // Check the description + assertEquals(param.name, parameterEntry.getDescription()); + // Check the AllowedValueType + assertEquals(AllowedValueType.Continuous, parameterEntry.getValueType()); + // Check the bounds + assertTrue(parameterEntry.getAllowedValues().contains( + String.valueOf(Double.POSITIVE_INFINITY))); + assertTrue(parameterEntry.getAllowedValues().contains( + String.valueOf(Double.NEGATIVE_INFINITY))); + // Create parameter from this Entry + retParam = new Parameter(); + retParam.fromEntry(parameterEntry); + // And check it + assertEquals(param.name, retParam.name); + assertEquals(param.type, retParam.type); + assertEquals(param.value, retParam.value); + + // Change the value and type to check integers + param.type = "int"; + param.value = "1"; + parameterEntry = param.toEntry(); + // Check the AllowedValueType + assertEquals(AllowedValueType.Continuous, parameterEntry.getValueType()); + // Check the bounds + assertTrue(parameterEntry.getAllowedValues().contains( + String.valueOf(Double.POSITIVE_INFINITY))); + assertTrue(parameterEntry.getAllowedValues().contains( + String.valueOf(Double.NEGATIVE_INFINITY))); + // Create parameter from this Entry + retParam = new Parameter(); + retParam.fromEntry(parameterEntry); + // And check it + assertEquals(param.name, retParam.name); + assertEquals(param.type, retParam.type); + assertEquals(param.value, retParam.value); + + // Change the value and type to check booleans + param.type = "bool"; + param.value = "true"; + parameterEntry = param.toEntry(); + // Check the AllowedValueType + assertEquals(AllowedValueType.Discrete, parameterEntry.getValueType()); + // Check the bounds + assertTrue(parameterEntry.getAllowedValues().contains("true")); + assertTrue(parameterEntry.getAllowedValues().contains("false")); + // Create parameter from this Entry + retParam = new Parameter(); + retParam.fromEntry(parameterEntry); + // And check it + assertEquals(param.name, retParam.name); + assertEquals(param.type, retParam.type); + assertEquals(param.value, retParam.value); + + // Change the value and type to check strings + param.type = "string"; + param.value = "myString"; + parameterEntry = param.toEntry(); + // Check the AllowedValueType + assertEquals(AllowedValueType.Undefined, parameterEntry.getValueType()); + // Create parameter from this Entry + retParam = new Parameter(); + retParam.fromEntry(parameterEntry); + // And check it + assertEquals(param.name, retParam.name); + assertEquals(param.type, retParam.type); + assertEquals(param.value, retParam.value); + + // Change the value and type to check arrays + param.type = "Array(string)"; + param.value = "{1,1,1,1}"; + parameterEntry = param.toEntry(); + // Check the AllowedValueType + assertEquals(AllowedValueType.Undefined, parameterEntry.getValueType()); + // Create parameter from this Entry + retParam = new Parameter(); + retParam.fromEntry(parameterEntry); + // And check it + assertEquals(param.name, retParam.name); + assertEquals(param.type, retParam.type); + assertEquals(param.value, retParam.value); + + return; + } + + /** + *

+ * This operation checks the ParameterLists toTreeComposite() operation. + *

+ * + */ + @Test + public void checkParameterList() { + + // Create a couple of parameter lists + ParameterList pList = new ParameterList(); + ParameterList secondPList = new ParameterList(); + ParameterList thirdPList = new ParameterList(); + ParameterList retParamList = new ParameterList(); + ArrayList retParams = new ArrayList(); + int numParameters = 10; + + // Set the names + pList.name = "MyParameterList"; + secondPList.name = "MySecondParameterList"; + thirdPList.name = "MyThirdParameterList"; + + // Create parameters + pList.parameters = new ArrayList(); + for (int i = 0; i < numParameters; i++) { + Parameter param = new Parameter(); + param.name = (new Integer(i)).toString(); + param.value = param.name; + param.type = "string"; + pList.parameters.add(param); + } + + // Add the second parameter list as a child to the first + pList.parameterLists = new ArrayList(); + pList.parameterLists.add(secondPList); + + // Add the third parameter list as a child to the second + secondPList.parameterLists = new ArrayList(); + secondPList.parameterLists.add(thirdPList); + + // Get the TreeComposite + TreeComposite pListTreeComp = pList.toTreeComposite(); + + // Check the name and description + assertEquals(pList.name, pListTreeComp.getName()); + assertEquals(pList.name, pListTreeComp.getDescription()); + // Make sure there is a component available + assertNotNull(pListTreeComp.getDataNodes()); + assertEquals(1, pListTreeComp.getDataNodes().size()); + assertTrue(pListTreeComp.getDataNodes().get(0) instanceof DataComponent); + // Get the data component and check out its info + DataComponent dataComp = (DataComponent) pListTreeComp.getDataNodes() + .get(0); + assertEquals(pList.name + " Parameters", dataComp.getName()); + assertEquals(pList.name + " Parameters", dataComp.getDescription()); + // Check out the entries on the DataComponent + assertEquals(10, dataComp.retrieveAllEntries().size()); + for (int i = 0; i < numParameters; i++) { + assertEquals((new Integer(i)).toString(), dataComp + .retrieveAllEntries().get(i).getName()); + assertEquals(i + 1, dataComp.retrieveAllEntries().get(i).getId()); + } + // Make sure the sub-tree is available + assertNotNull(pListTreeComp.getChildAtIndex(0)); + assertTrue(pListTreeComp.getChildAtIndex(0) instanceof TreeComposite); + TreeComposite retSecondPListTreeComp = pListTreeComp.getChildAtIndex(0); + // Check the name + assertEquals(secondPList.name, retSecondPListTreeComp.getName()); + // Make sure the sub-tree of the sub-tree is available + assertNotNull(retSecondPListTreeComp.getChildAtIndex(0)); + assertTrue(retSecondPListTreeComp.getChildAtIndex(0) instanceof TreeComposite); + TreeComposite retThirdPListTreeComp = retSecondPListTreeComp + .getChildAtIndex(0); + // Check the name + assertEquals(thirdPList.name, retThirdPListTreeComp.getName()); + + // Convert the TreeComposite back to a parameter list + retParamList.fromTreeComposite(pListTreeComp); + + // Check the name + assertEquals(pList.name, retParamList.name); + // Check the parameters + retParams = retParamList.parameters; + assertEquals(pList.parameters.size(), retParamList.parameters.size()); + for (int i = 0; i < numParameters; i++) { + assertEquals(pList.parameters.get(i).name, retParams.get(i).name); + assertEquals(pList.parameters.get(i).value, retParams.get(i).value); + assertEquals(pList.parameters.get(i).type, retParams.get(i).type); + } + // Check the children + assertEquals(pList.parameterLists.size(), + retParamList.parameterLists.size()); + assertEquals(pList.parameterLists.get(0).name, + retParamList.parameterLists.get(0).name); + assertEquals(secondPList.parameterLists.size(), + retParamList.parameterLists.get(0).parameterLists.size()); + assertEquals(secondPList.parameterLists.get(0).name, + retParamList.parameterLists.get(0).parameterLists.get(0).name); + + return; + } + + /** + * This operation checks that a parameter lists can be loaded to and from + * XML properly. + * @throws IOException + * @throws JAXBException + * @throws NullPointerException + */ + @Test + public void checkXMLPersistence() throws NullPointerException, JAXBException, IOException { + + // Local Declarations + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + InputStream inputStream = null; + Parameter param = new Parameter(), loadedParam = null, secondParam = new Parameter(); + ParameterList pList = new ParameterList(), secondPList = new ParameterList(); + ParameterList loadedList = null, secondLoadedList = null; + ICEJAXBHandler xmlHandler = new ICEJAXBHandler(); + ArrayList classList = new ArrayList(); + classList.add(ParameterList.class); + + System.out.println("----- Testing Parameter XML Persistence -----"); + + // Create a parameter + param.name = "A parameter"; + param.value = "only simple bits and bites"; + param.type = "string"; + + // Write it to XML + xmlHandler.write(param, classList, outputStream); + + // Read it from XML + inputStream = new ByteArrayInputStream(outputStream.toByteArray()); + loadedParam = new Parameter(); + loadedParam = (Parameter) xmlHandler.read(classList, inputStream); + + // Check the name + assertEquals(param.name, loadedParam.name); + // Check the value + assertEquals(param.value, loadedParam.value); + // Check the type + assertEquals(param.type, loadedParam.type); + + // Clear the streams + try { + outputStream.flush(); + outputStream.close(); + inputStream.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + System.out.println("----- Testing ParameterList XML Persistence -----"); + + // Setup the second parameter + secondParam.name = "that took Jay all night"; + secondParam.value = "-----"; + secondParam.type = "string"; + + // Setup the parameter lists + pList.name = "ICE's Parameter List"; + pList.parameters = new ArrayList(); + pList.parameters.add(param); + secondPList.name = "ICE's Second Parameter List"; + secondPList.parameters = new ArrayList(); + secondPList.parameters.add(secondParam); + pList.parameterLists = new ArrayList(); + pList.parameterLists.add(secondPList); + + // Write the tree + outputStream = new ByteArrayOutputStream(); + xmlHandler.write(pList, classList, outputStream); + + // Load the tree + inputStream = new ByteArrayInputStream(outputStream.toByteArray()); + loadedList = new ParameterList(); + loadedList = (ParameterList) xmlHandler.read(classList, inputStream); + + // Check the name + assertEquals(pList.name, loadedList.name); + // Check the parameter for the top level tree + assertNotNull(loadedList.parameters.size()); + assertEquals(1, loadedList.parameters.size()); + assertEquals(param.name, loadedList.parameters.get(0).name); + assertEquals(param.value, loadedList.parameters.get(0).value); + assertEquals(param.type, loadedList.parameters.get(0).type); + // Check the second level parameter list in the tree + assertNotNull(loadedList.parameterLists); + assertEquals(1, loadedList.parameterLists.size()); + secondLoadedList = loadedList.parameterLists.get(0); + // Check the parameter for the second level tree + assertNotNull(secondLoadedList.parameters.size()); + assertEquals(1, secondLoadedList.parameters.size()); + assertEquals(secondParam.name, secondLoadedList.parameters.get(0).name); + assertEquals(secondParam.value, + secondLoadedList.parameters.get(0).value); + assertEquals(secondParam.type, secondLoadedList.parameters.get(0).type); + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/RegistryTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/RegistryTester.java new file mode 100644 index 000000000..587882585 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/RegistryTester.java @@ -0,0 +1,150 @@ +/******************************************************************************* + * Copyright (c) 2011, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.util.ArrayList; + +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.item.Registry; +import org.junit.*; + +/** + *

+ * The RegistryTester is responsible for testing the Registry class. + *

+ * + * @author Jay Jay Billings + */ +public class RegistryTester { + + /** + */ + private Registry registry; + + /** + * + */ + private FakeDataComponent fakeDataComponent; + + /** + *

+ * This operation tests the Registry class by checking that values can be + * set and retrieved and check for existence. + *

+ */ + @Test + public void checkValues() { + + // Some keys and values + String key1 = "Stone Temple Pilots", value1 = "Dead & Bloated"; + String key2 = "Motley Crue", value2 = "Dr. Feelgood"; + String value3 = "Knife", value4 = "Bow and Arrow"; + + // Create a registry to test + registry = new Registry(); + + // Set the values + registry.setValue(key1, value1); + registry.setValue(key2, value2); + // Check the values + assertEquals(value1, registry.getValue(key1)); + assertEquals(value2, registry.getValue(key2)); + + // Update the values and make sure they changed + registry.updateValue(key1, value3); + registry.updateValue(key2, value4); + assertEquals(value3, registry.getValue(key1)); + assertEquals(value4, registry.getValue(key2)); + + // Make sure that updating a value doesn't work for something that is + // not in the registry + registry.updateValue("not in there key", "not in there value"); + assertNull(registry.getValue("not in there key")); + + return; + + } + + /** + *

+ * This operation tests the Registry class by insuring that Entries can be + * registered against keys. + *

+ */ + @Test + public void checkRegistration() { + // A key and a value + String key = "Seether"; + + // Create a Registry to test + registry = new Registry(); + + // Create the DataComponents + DataComponent dc1 = new DataComponent(); + dc1.setId(1); + dc1.setName("Updated DataComponent"); + DataComponent dc2 = new DataComponent(); + dc1.setId(2); + dc1.setName("Updated DataComponent"); + + // Register the Entries against the key + assertTrue(registry.register(dc1, key)); + assertTrue(registry.register(dc2, key)); + + // Make sure the Registry contains the key + assertTrue(registry.containsKey(key)); + + } + + /** + *

+ * This operation checks the Registry class by checking that it will + * properly update Entries. + *

+ */ + @Test + public void testDispatching() { + // A key and a value + String key = "Disturbed"; + String value = "Prayer"; + + // Create a Registry to test + registry = new Registry(); + + // Create the DataComponents + FakeDataComponent dc1 = new FakeDataComponent(); + dc1.setId(1); + dc1.setName("Updated DataComponent"); + FakeDataComponent dc2 = new FakeDataComponent(); + dc2.setId(2); + dc2.setName("Updated DataComponent"); + + // Register the Entries against the key and insure they are registered + assertTrue(registry.register(dc1, key)); + assertTrue(registry.register(dc2, key)); + + // Set the value and insure it is set + assertTrue(registry.setValue(key, value)); + + // Dispatch updates since the value is set + registry.dispatch(); + + // Check the values of the entries and make sure they were set + assertEquals(value, dc1.getUpdatedValue()); + assertEquals(value, dc2.getUpdatedValue()); + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SerializedItemBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SerializedItemBuilderTester.java new file mode 100644 index 000000000..b475372cf --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SerializedItemBuilderTester.java @@ -0,0 +1,199 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; + +import org.junit.Ignore; +import org.junit.Test; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.SerializedItemBuilder; + +/** + *

+ * The SerializedItemBuilderTester is responsible for testing the + * SerializedItemBuilder. It is primarily concerned with ensuring that the + * SerializedItemBuilder can load an Item from an InputStream and return the + * proper name and type. + *

+ * + * @author Jay Jay Billings + */ +public class SerializedItemBuilderTester { + /** + *

+ * An Item reference used in the testing. + *

+ * + */ + private Item serializedItem; + /** + *

+ * The SerializedItemBuilder under test. + *

+ * + */ + private SerializedItemBuilder serializedItemBuilder; + + /** + *

+ * This operation checks the SerializedItemBuilder using a Painfully Simple + * Form (PSF) file. It checks the name and type of the Item and tries to + * create and check a SerializedItem initialized from the PSF. + *

+ * + */ + @Test + public void checkLoadingFromPSF() { + + // Local Declarations + ByteArrayInputStream stream = null; + Form form = null; + DataComponent dataComp1 = null, dataComp2 = null; + Entry entry = null; + String psfItemString = ""; + + // Local Declarations + ArrayList PSFForm = new ArrayList(); + + // Setup the string containing the Form in PSF format. This was + // taken from the Painfully Simple Form article at + // https://sourceforge.net/apps/mediawiki/niceproject/index.php?title=ICE_Painfully_Simple_Form + // and is a good example because it is complete, contains lots of + // whitespace and comments and, of course, interesting! I have added + // whitespaces and comments in some places to make the test more + // rigorous and changed some of the comment statements from "//" to "#" + // to cover all the possibilities. + PSFForm.add("\t \n"); + PSFForm.add("#Form name and type\n"); + PSFForm.add("formName=PSF Wiki Article Form\n"); + PSFForm.add("formDescription=A PSF Wiki Article Sample\n"); + PSFForm.add("formType=Model\n"); + PSFForm.add(" \n"); + PSFForm.add("#The DataComponents block - it must come first!\n"); + PSFForm.add("group=Assembly\n"); + PSFForm.add("groupDescription=Relevant quantities for modeling a full assembly\n"); + PSFForm.add("\n"); + PSFForm.add("#The Entry blocks will appear below this line"); + PSFForm.add("\n"); + PSFForm.add("\t \n"); + PSFForm.add("#Some comments to ignore at the top\n"); + PSFForm.add("//More comments to ignore at the top\n"); + PSFForm.add("name=Coolant Temperature " + + " #The name that a user " + + "will see\n"); + PSFForm.add("description=The temperature of the coolant that surrounds " + + "the assembly and pins //A description that will help the user\n"); + PSFForm.add("defaultValue=550 " + + " //The default value\n"); + PSFForm.add("allowedValueType=Continuous " + + " //Indicates that the value can be " + + "anything between 550 and 650 K.\n"); + PSFForm.add("allowedValue=550 " + + " //The lower bound of the range\n"); + PSFForm.add("allowedValue=650 " + + " //The upper bound of the range\n"); + PSFForm.add("tag=coolantTemperature " + + " //A tag to mark it\n"); + PSFForm.add("parent=Full Assembly Flag " + + " //The parent\n"); + PSFForm.add("group=Assembly " + + " //The group\n"); + PSFForm.add(" \t \n"); + PSFForm.add("name=Number of Pins\n"); + PSFForm.add("description=The number of pins in an assembly\n"); + PSFForm.add("defaultValue=289\n"); + PSFForm.add("allowedValueType=Discrete\n"); + PSFForm.add("allowedValue=196\n"); + PSFForm.add("allowedValue=289\n"); + PSFForm.add("tag=numberOfPins\n"); + PSFForm.add("parent=Full Assembly Flag\n"); + PSFForm.add("group=Assembly\n"); + PSFForm.add(" \t \n"); + PSFForm.add("name=Full Assembly Flag\n"); + PSFForm.add("description=True if a full assembly should be modeled, false if not\n"); + PSFForm.add("defaultValue=false\n"); + PSFForm.add("allowedValueType=Discrete\n"); + PSFForm.add("allowedValue=true\n"); + PSFForm.add("allowedValue=false\n"); + PSFForm.add("tag=fullAssemblyFlag\n"); + PSFForm.add("group=Assembly\n"); + + // Convert the ArrayList to a string + for (String i : PSFForm) { + psfItemString += i; + } + System.out.println("Printing stream:\n" + psfItemString); + + // Create the InputStream + stream = new ByteArrayInputStream(psfItemString.getBytes()); + + // Setup the builder + try { + serializedItemBuilder = new SerializedItemBuilder(stream); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + + // Check the name + assertEquals("PSF Wiki Article Form", + serializedItemBuilder.getItemName()); + // Check the type + assertEquals(ItemType.Model, serializedItemBuilder.getItemType()); + + // Build and Item and check its Form + serializedItem = serializedItemBuilder.build(null); + form = serializedItem.getForm(); + assertNotNull(form); + // Check the Form in some random spots - FIXME: Use Form.equals() once + // AJM implements it! + assertEquals("PSF Wiki Article Form", form.getName()); + assertEquals("A PSF Wiki Article Sample", form.getDescription()); + assertEquals(1, form.getNumberOfComponents()); + dataComp1 = (DataComponent) form.getComponent(1); + dataComp2 = (DataComponent) form.getComponent(2); + assertNotNull(dataComp1); + assertEquals("Assembly", dataComp1.getName()); + assertEquals(null, dataComp2);// There should only be one component! + entry = dataComp1.retrieveEntry("Number of Pins"); + assertNotNull(entry); + assertEquals("289", entry.getDefaultValue()); + assertEquals("numberOfPins", entry.getTag()); + + // If we've made it this far, then + + // Try loading the Item from a null stream, which should result in an + // exception + boolean exceptionCaught = false; + try { + serializedItemBuilder = new SerializedItemBuilder(null); + } catch (IOException e) { + // Mark the flag as true. + exceptionCaught = true; + } + // Make sure the exception was caught + assertTrue(exceptionCaught); + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SuiteLauncherTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SuiteLauncherTester.java new file mode 100644 index 000000000..2de6066e1 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/SuiteLauncherTester.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.ArrayList; + +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.item.jobLauncher.JobLauncher; +import org.eclipse.ice.item.jobLauncher.JobLauncherForm; +import org.eclipse.ice.item.jobLauncher.SuiteLauncher; +import org.junit.Test; + +/** + * This class is responsible for testing the SuiteLauncher. + * + * @author Jay Jay Billings + * + */ +public class SuiteLauncherTester { + + /** + * This operation makes sure that the executables can be dynamically + * configured on the SuiteLauncher. + */ + @Test + public void checkSettingExecutables() { + // Create the launcher + SuiteLauncher launcher = new SuiteLauncher(null); + + // Create the list of executables + ArrayList execs = new ArrayList(); + execs.add("conj_ht"); + execs.add("conj_ht_moab"); + execs.add("bison"); + + // Set the list + launcher.addExecutables(execs); + + // Get the list and check it + DataComponent execComp = (DataComponent) (launcher.getForm()) + .getComponent(JobLauncherForm.parallelId + 2); + Entry execEntry = execComp.retrieveAllEntries().get(0); + assertEquals(execs, execEntry.getAllowedValues()); + + return; + } + + /** + * This operation makes sure that SuiteLaunchers can be copied. + */ + @Test + public void checkCopying() { + + // Local Declarations + SuiteLauncher cloneItem = new SuiteLauncher(), copyItem = new SuiteLauncher(); + SuiteLauncher jobItem = new SuiteLauncher(); + + // Create the list of executables + ArrayList execs = new ArrayList(); + execs.add("conj_ht"); + execs.add("conj_ht_moab"); + execs.add("bison"); + + // Set the launcher details + jobItem.setDescription("I am a job!"); + jobItem.setExecutable("LS", "/opt/bin", "DOIT!!!!"); + + // Set the list + jobItem.addExecutables(execs); + + // run clone operations + cloneItem = (SuiteLauncher) jobItem.clone(); + + // check contents + assertEquals(jobItem.getAvailableActions(), + cloneItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), cloneItem.getDescription()); + assertTrue(jobItem.getForm().equals(cloneItem.getForm())); + assertEquals(jobItem.getId(), cloneItem.getId()); + assertEquals(jobItem.getItemType(), cloneItem.getItemType()); + assertEquals(jobItem.getName(), cloneItem.getName()); + assertEquals(jobItem.getStatus(), cloneItem.getStatus()); + assertEquals(jobItem.getAllHosts(), cloneItem.getAllHosts()); + + // Get the executable list and check it + DataComponent execComp = (DataComponent) cloneItem.getForm() + .getComponent(JobLauncherForm.parallelId + 2); + Entry execEntry = execComp.retrieveAllEntries().get(0); + assertEquals(execs, execEntry.getAllowedValues()); + + // run copy operation + copyItem.copy(jobItem); + + // check contents + assertEquals(jobItem.getAvailableActions(), + copyItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), copyItem.getDescription()); + assertTrue(jobItem.getForm().equals(copyItem.getForm())); + assertEquals(jobItem.getId(), copyItem.getId()); + assertEquals(jobItem.getItemType(), copyItem.getItemType()); + assertEquals(jobItem.getName(), copyItem.getName()); + assertEquals(jobItem.getStatus(), copyItem.getStatus()); + assertEquals(jobItem.getAllHosts(), copyItem.getAllHosts()); + + // Get the executable list and check it + execComp = (DataComponent) copyItem.getForm().getComponent( + JobLauncherForm.parallelId + 2); + execEntry = execComp.retrieveAllEntries().get(0); + assertEquals(execs, execEntry.getAllowedValues()); + + // run copy operation by passing null + copyItem.copy(null); + + // check contents - nothing has changed + assertEquals(jobItem.getAvailableActions(), + copyItem.getAvailableActions()); + assertEquals(jobItem.getDescription(), copyItem.getDescription()); + assertTrue(jobItem.getForm().equals(copyItem.getForm())); + assertEquals(jobItem.getId(), copyItem.getId()); + assertEquals(jobItem.getItemType(), copyItem.getItemType()); + assertEquals(jobItem.getName(), copyItem.getName()); + assertEquals(jobItem.getStatus(), copyItem.getStatus()); + assertEquals(jobItem.getAllHosts(), copyItem.getAllHosts()); + + // Get the executable list and check it + execComp = (DataComponent) copyItem.getForm().getComponent( + JobLauncherForm.parallelId + 2); + execEntry = execComp.retrieveAllEntries().get(0); + assertEquals(execs, execEntry.getAllowedValues()); + + return; + } + + /** + * This operation makes sure that SuiteLaunchers can be accurately checked + * for Equality. + */ + @Test + public void checkEquals() { + // Create JobLauncherItems to test + SuiteLauncher item = new SuiteLauncher(); + SuiteLauncher equalItem = new SuiteLauncher(); + SuiteLauncher unEqualItem = new SuiteLauncher(); + SuiteLauncher transitiveItem = new SuiteLauncher(); + + // Create the list of executables + ArrayList execs = new ArrayList(); + execs.add("conj_ht"); + execs.add("conj_ht_moab"); + execs.add("bison"); + + // Set ids + equalItem.setId(item.getId()); + transitiveItem.setId(item.getId()); + unEqualItem.setId(2); + + // Set names + equalItem.setName(item.getName()); + transitiveItem.setName(item.getName()); + unEqualItem.setName("DC UnEqual"); + + // Set executables + item.addExecutables(execs); + equalItem.addExecutables(execs); + transitiveItem.addExecutables(execs); + unEqualItem.addExecutables(null); + + // Assert two equal Items return true + assertTrue(item.equals(equalItem)); + + // Assert two unequal Items return false + assertFalse(item.equals(unEqualItem)); + + // Assert equals() is reflexive + assertTrue(item.equals(item)); + + // Assert the equals() is Symmetric + assertTrue(item.equals(equalItem) && equalItem.equals(item)); + + // Assert equals() is transitive + if (item.equals(equalItem) && equalItem.equals(transitiveItem)) { + assertTrue(item.equals(transitiveItem)); + } else { + fail(); + } + + // Assert equals is consistent + assertTrue(item.equals(equalItem) && item.equals(equalItem) + && item.equals(equalItem)); + assertTrue(!item.equals(unEqualItem) && !item.equals(unEqualItem) + && !item.equals(unEqualItem)); + + // Assert checking equality with null is false + assertFalse(item==null); + + // Assert that two equal objects return same hashcode + assertTrue(item.equals(equalItem) + && item.hashCode() == equalItem.hashCode()); + + // Assert that hashcode is consistent + assertTrue(item.hashCode() == item.hashCode()); + + // Assert that hashcodes from unequal objects are different + assertTrue(item.hashCode() != unEqualItem.hashCode()); + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TaggedOutputWriterActionTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TaggedOutputWriterActionTester.java new file mode 100644 index 000000000..4b3201320 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TaggedOutputWriterActionTester.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Properties; + +import org.junit.Test; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.item.action.TaggedOutputWriterAction; + +/** + *

+ * This class is responsible for checking that the TaggedOutputWriter action can + * write a set of key-value pairs to an output file. + *

+ * + * @author Jay Jay Billings + */ +public class TaggedOutputWriterActionTester { + /** + * + */ + private TaggedOutputWriterAction taggedOutputWriterAction; + + /** + *

+ * This operation checks that the TaggedOutputWriter action can write a set + * of key-value pairs to an output file. + *

+ * + */ + @Test + public void checkWriting() { + + // Local Declarations + Hashtable testDictionary = new Hashtable(); + + // Create a dictionary + testDictionary.put("Kirk", "captain"); + testDictionary.put("Spock", "first officer"); + testDictionary.put("Bones", "chief medical officer"); + testDictionary.put("Scotty", "chief engineer"); + + // Load and execute the action - make sure it returns the proper return + // value + taggedOutputWriterAction = new TaggedOutputWriterAction(); + // First make sure it returns FormStatus.InfoError if it receives null + assertEquals(FormStatus.InfoError, + taggedOutputWriterAction.execute(null)); + // Second make sure that it returns FormStatus.InfoError if it receives + // a dictionary missing the file name + assertEquals(FormStatus.InfoError, + taggedOutputWriterAction.execute(testDictionary)); + // Add the file name and do the real execution, which should return + // FormStatus.Processed and will write a file that can be checked + testDictionary.put("iceTaggedOutputFileName", "taggedTestFile.txt"); + assertEquals(FormStatus.Processed, + taggedOutputWriterAction.execute(testDictionary)); + + // Check the file + File testFile = new File("taggedTestFile.txt"); + assertTrue(testFile.exists()); + assertTrue(testFile.canRead()); + + // Load the file and check it + Properties testFileProperties = new Properties(); + try { + testFileProperties.load(new FileInputStream(testFile)); + } catch (FileNotFoundException e) { + // Fail if it catches an exception + e.printStackTrace(); + fail(); + } catch (IOException e) { + // Fail if it catches an exception + e.printStackTrace(); + fail(); + } + System.out.println(testFileProperties); + assertTrue(testFileProperties.containsKey("Kirk")); + assertEquals(testFileProperties.get("Kirk"), testDictionary.get("Kirk")); + assertTrue(testFileProperties.containsKey("Spock")); + assertEquals(testFileProperties.get("Spock"), + testDictionary.get("Spock")); + assertTrue(testFileProperties.containsKey("Bones")); + assertEquals(testFileProperties.get("Bones"), + testDictionary.get("Bones")); + assertTrue(testFileProperties.containsKey("Scotty")); + assertEquals(testFileProperties.get("Scotty"), + testDictionary.get("Scotty")); + + // Get rid of the file if everything worked + if (testFile.exists()) { + testFile.delete(); + } + + return; + + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestAction.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestAction.java new file mode 100644 index 000000000..710aa1192 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestAction.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import java.util.Dictionary; + +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.item.action.Action; + +/** + *

+ * The TestAction is used for testing Actions and for faking actions in ICE + * Items. It does not override Action's Form accessors. + *

+ * + * @author Jay Jay Billings + */ +public class TestAction extends Action { + /** + *

+ * The constructor. It initializes the Action's Form to a basic Form. + *

+ * + */ + public TestAction() { + + // Initialize the Form + actionForm = new Form(); + + return; + + } + + /** + * (non-Javadoc) + * + * @see Action#execute(Dictionary dictionary) + */ + public FormStatus execute(Dictionary dictionary) { + // TODO Auto-generated method stub + return null; + } + + /** + * (non-Javadoc) + * + * @see Action#cancel() + */ + public FormStatus cancel() { + // TODO Auto-generated method stub + return null; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItem.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItem.java new file mode 100644 index 000000000..bee4b9b61 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItem.java @@ -0,0 +1,364 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import java.util.ArrayList; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.io.serializable.IReader; +import org.eclipse.ice.io.serializable.IWriter; +import org.eclipse.ice.item.IActionFactory; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.messaging.Message; + +/** + *

+ * This is a subclass of Item that implements setupForm(), reviewEntries() and + * process() so that the other operations of Item can be tested. It creates a + * relatively simple Form that is used during the tests. + *

+ * + * @author Jay Jay Billings + */ +@XmlRootElement(name = "TestItem") +public class TestItem extends Item { + + /** + *

+ * True if the TestItem was successfully updated, false otherwise. + *

+ * + */ + private boolean updated = false; + + /** + *

+ * The constructor + *

+ * + */ + public TestItem() { + // Punt + this(null); + } + + /** + *

+ * The constructor + *

+ * + * @param project + *

+ * The Eclipse IProject that should be used by the TestItem. + *

+ */ + public TestItem(IProject project) { + + super(project); + + } + + /** + *

+ * This operation overrides setupForm() to setup a Form for the tests. + *

+ * + */ + protected void setupForm() { + + // This operations creates four DataComponents and makes + // one of them dependent on the value of another. This setups up a Form + // with the names of the ICE team members circa February 2011. + + // Create the Form + form = new Form(); + + // Create the data components - the first is a Fake for testing + FakeDataComponent dc1 = new FakeDataComponent(); + dc1.setId(1); + dc1.setName("Jay"); + Entry dc1Entry = new Entry(); + dc1Entry.setName("Jay"); + dc1Entry.setValue("Awesome"); + dc1Entry.setTag("jayjaybillings"); + dc1.addEntry(dc1Entry); + + DataComponent dc2 = new DataComponent(); + dc2.setId(2); + dc2.setName("David"); + Entry dc2Entry = new Entry(); + dc2Entry.setId(5); + dc2Entry.setName("David's Entry"); + dc2Entry.setValue("The boss"); + dc2.addEntry(dc2Entry); + + DataComponent dc3 = new DataComponent(); + dc3.setId(3); + dc3.setName("Alex"); + + DataComponent dc4 = new DataComponent(); + dc4.setId(4); + dc4.setName("Bobo the Drunken Clown"); + + // Add the components to the Form + form.addComponent(dc1); + form.addComponent(dc2); + form.addComponent(dc3); + form.addComponent(dc4); + + // Set the particulars about the Item + setName("Test Item"); + setId(15); + setDescription("An Item used for testing."); + + return; + } + + /** + *

+ * This operation overrides reviewEntries to modify the Form that it setup + * in some specific ways. + *

+ * + * @param preparedForm + *

+ * The Form under review. + *

+ * @return

+ * The status. + *

+ */ + protected FormStatus reviewEntries(Form preparedForm) { + + // This implementation of reviewEntries looks for the value + // of David and passes it to Jay through the Registry. + + // Local Declarations + int i = 0; + FormStatus retVal = FormStatus.InfoError; + ArrayList components = new ArrayList(); + DataComponent dc2 = null; + Entry dc2Entry = null; + + // Grab the DataComponents + for (i = 0; i < this.form.getNumberOfComponents(); i++) { + components.add((DataComponent) form.getComponent(i + 1)); + } + + // Get David's data component in the list and get + // the value from David's entry + dc2 = components.get(1); + dc2Entry = ((DataComponent) dc2).retrieveEntry("David's Entry"); + // Set the value in the Registry + registry.setValue("Boss", dc2Entry.getValue()); + // Set the return value + if (dc2Entry != null) { + retVal = FormStatus.ReadyToProcess; + } + // Tell the Registry to dispatch any updates that are waiting + registry.dispatch(); + + // Return + return retVal; + } + + /** + *

+ * Overrides super class operation to register a data component. + *

+ * + */ + protected void registerUpdateables() { + + // Call the super class' registerUpdateables operation first + super.registerUpdateables(); + + // Register Entries against keys + registry.register(form.getComponent(1), "Boss"); + + return; + } + + /** + *

+ * This operation directs the TestItem to notify its listeners so that the + * ItemTester can see that the Item super class correctly handles the + * request. + *

+ * + */ + public void notifyListeners() { + + notifyListenersOfProjectChange(); + + return; + } + + /** + *

+ * This operation fakes setting some preferences, but calls + * getPreferencesDirectory() so that the Item base class tries to create the + * preferences directory. + *

+ * + */ + public void setPreferences() { + + // Force the Item to create a preferences directory + getPreferencesDirectory(); + + return; + } + + /** + *

+ * This operation returns true if the TestItem was successfully updated, + * false otherwise. + *

+ * + * @return

+ * True if updated, false otherwise. + *

+ */ + public boolean wasUpdated() { + return updated; + } + + /** + * This operation overrides Item.update() to catch the update and mark the + * update flag. + */ + @Override + public boolean update(Message msg) { + super.update(msg); + updated = true; + return true; + } + + /** + * This method is used by ItemTester to test that Item.getFiles functions + * appropriately. + * + * @param directory + * @return + */ + public ArrayList getYAMLFiles(String directory) { + return getFiles(directory, ".yaml"); + } + + /** + * This method is used by the ItemTester to test that the Item.moveFile + * method functions correctly. + * + * @param fromDir + * @param toDir + * @param fileName + */ + public void moveTestFile(String fromDir, String toDir, String fileName) { + moveFile(fromDir, toDir, fileName); + } + + /** + * This method is used by the ItemTester to test that the + * Item.deleteDirectory method functions correctly. + * + * @param dir + */ + public void deleteTestDirectory(String dir) { + deleteDirectory(dir); + } + + /** + * This method is used by the ItemTester to test that the Item.copyFile + * method functions correctly. + * + * @param fromDir + * @param toDir + * @param newName + */ + public void copyTestFile(String fromDir, String toDir, String newName) { + copyFile(fromDir, toDir, newName); + } + + /** + * This method is used by the ItemTester to test that the Item.copyFiles + * method functions correctly. + * + * @param fromDir + * @param toDir + * @param newName + */ + public void copyMultipleFiles(String src, String dest, String ext) { + + copyFiles(src, dest, ext); + + } + + /** + * This method is used by the ItemTester to test that the Item.moveiles + * method functions correctly. + * + * @param fromDir + * @param toDir + * @param newName + */ + public void moveMultipleFiles(String src, String dest, String ext) { + moveFiles(src, dest, ext); + } + + /** + * This method is used by the ItemTester to test that the Item.moveiles + * method functions correctly. + * + * @param fromDir + * @param toDir + * @param newName + */ + public void copyTestDirectory(String src, String dest) { + copyDirectory(src, dest); + } + + /** + * Return the IO type, this is used for the ItemTester.checkIOService. + */ + @Override + protected String getIOType() { + return "fake"; + } + + /** + * This method is just a utility for ItemTester to check that the IReader + * reference is valid. + * + * @return + */ + public IReader getTestReader() { + return getReader(); + } + + /** + * This method is just a utility for ItemTester to check that the IWriter + * reference is valid. + * + * @return + */ + public IWriter getTestWriter() { + return getWriter(); + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItemBuilder.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItemBuilder.java new file mode 100644 index 000000000..6492f8835 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestItemBuilder.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemBuilder; +import org.eclipse.ice.item.ItemType; + +/** + * A simple builder for the TestItem so that the XML Persistence Provider can be + * configured. + * + * @author Jay Jay Billings + * + */ +public class TestItemBuilder implements ItemBuilder { + + @Override + public String getItemName() { + return "Test Item"; + } + + @Override + public ItemType getItemType() { + return ItemType.Simulation; + } + + @Override + public Item build(IProject projectSpace) { + return new TestItem(projectSpace); + } + +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestJobLauncher.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestJobLauncher.java new file mode 100644 index 000000000..0f5b2c7be --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/TestJobLauncher.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2012, 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import org.eclipse.core.resources.IProject; +import org.eclipse.ice.item.IActionFactory; +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.jobLauncher.JobLauncher; + +/** + *

+ * This class inherits from JobLauncher and sets the test executable to the "ls" + * command. It is only used for testing and for setting this executable command + * name. Everything else is handled by the JobLauncher. + *

+ * + * @author Jay Jay Billings + */ +public class TestJobLauncher extends JobLauncher { + + /** + * True if the setupFormWithServices() operation was called, false otherwise. + */ + boolean setupAfterServices = false; + + /** + * The Constructor + * + * @param projectSpace + */ + public TestJobLauncher(IProject projectSpace) { + super(projectSpace); + } + + /** + * This operation sets the executable name to ls + * + * @see Item#setupForm() + */ + @Override + protected void setupForm() { + + // Setup the Form + super.setupForm(); + + // Setup the executable information + setExecutable("ls", "A launcher for the " + "\"ls\" command. ", "ls"); + + // Add a dummy host + addHost("notlocalhost", "linux", "/bin"); + + return; + } + + /** + * This operation returns the ActionFactory so that the tests can make sure + * the Items received the services. + */ + public IActionFactory getActionFactoryForTest() { + return getActionFactory(); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ice.item.Item#setupFormWithServices() + */ + public void setupFormWithServices() { + setupAfterServices = true; + } + + /** + * This operation describes whether or not the setupFormWithServices + * operation was called after the Item was constructed. It is used by the + * tests to make sure that the AbstractItemBuilder builds the Item properly. + * + * @return True if the setupFormWithServices operation was called, false + * otherwise. + */ + public boolean setupFormWithServicesWasCalled() { + return setupAfterServices; + } + +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/YAMLTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/YAMLTester.java new file mode 100644 index 000000000..8a90b3df8 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/YAMLTester.java @@ -0,0 +1,101 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Map; + +import org.junit.Test; +import org.yaml.snakeyaml.*; + +/** + * This class tests the SnakeYAML parser to make sure that it is integrated into + * ICE IO correctly. + * + * @author Jay Jay Billings + * + */ +public class YAMLTester { + + /** + * This operation runs a simple SnakeYAML example from their website and + * checks the results. + */ + @Test + public void checkSnakeYAML() { + + // Create a YAML tree + Yaml yaml = new Yaml(); + String document = "hello: 25"; + // Load it from the string + Map map = (Map) yaml.load(document); + // Check the map + assertEquals("{hello=25}", map.toString()); + assertEquals(new Integer(25), map.get("hello")); + + return; + } + + /** + * This operation loads input from INL's BISON application, based on MOOSE, + * to make sure that the file can be parsed. It is also based on an example + * from the SnakeYAML website. + */ + @Test + public void checkSnakeYAMLWithBison() { + + // Local Declarations + String separator = System.getProperty("file.separator"); + InputStream input = null; + File bisonFile = null; + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + + // Load the bison file + try { + bisonFile = new File(userDir + separator + "bison.yaml"); + input = new FileInputStream(bisonFile); + } catch (FileNotFoundException e) { + // Complain if the file is not found + e.printStackTrace(); + // Fail, cry and go home ;) + fail(); + } + + // Load the YAML tree + Yaml yaml = new Yaml(); + ArrayList data = (ArrayList) yaml.load(input); + Map dataMap = (Map) data.get(0); + + // Dump the file for review + // String output = yaml.dump(data); + // System.out.println(output); + + // Check the input. The short input file only has the /Adaptivity block + // from the input, so size = 1. + assertEquals(34, data.size()); + // Check the name, type and description of the /Adaptivity block + assertEquals("/Adaptivity", dataMap.get("name")); + assertEquals("", dataMap.get("description")); + assertEquals(null, dataMap.get("type")); + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/messaging/MessageTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/messaging/MessageTester.java new file mode 100644 index 000000000..a459d0599 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/messaging/MessageTester.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.messaging; + +import static org.junit.Assert.assertEquals; + +import org.eclipse.ice.item.messaging.Message; +import org.junit.Test; + +/** + *

+ * This class is responsible for testing the Message class to make sure the Bean + * works correctly. + *

+ * + * @author Jay Jay Billings + */ +public class MessageTester { + /** + *

+ * This operation makes sure that the accessors of the Message class work. + *

+ * + */ + @Test + public void checkAccessors() { + + // Local Declarations + int id = 1, itemId = 2; + String type = "FILE_UPDATED", content = "Starfleet Academy"; + + // Create a message + Message msg = new Message(); + msg.setId(id); + msg.setItemId(itemId); + msg.setMessage(content); + msg.setType(type); + + // Check it + assertEquals(id, msg.getId()); + assertEquals(itemId, msg.getItemId()); + assertEquals(content, msg.getMessage()); + assertEquals(type, msg.getType()); + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/BlockTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/BlockTester.java new file mode 100644 index 000000000..fef44096b --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/BlockTester.java @@ -0,0 +1,342 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.moose; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; + +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.item.utilities.moose.Block; +import org.eclipse.ice.item.utilities.moose.Parameter; +import org.junit.Test; + +/** + * This operation checks the MOOSE Block class. The loadFromMap() operation is + * checked by the MOOSEFileHandlerTester class because it requires integration + * with SnakeYAML. + * + * @author Jay Jay Billings + */ +public class BlockTester { + /** + * This operation checks the accessors for the Block class. + */ + @Test + public void checkAccessors() { + + // Local Declarations + String name = "Snow", description = "Snow always mirrors"; + String comment = "Some comment", type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + ArrayList paramList = new ArrayList(); + Block block = new Block(), subBlock = new Block(); + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setDescription(description); + block.setComment(comment); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type("Test Param 1"); + param1.setDescription("Test Param 1"); + param1.setRequired(true); + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault("Test Param 2"); + param2.setCpp_type("Test Param 2"); + param2.setDescription("Test Param 2"); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + block.setActive(true); + + // Check the block + assertEquals(name, block.getName()); + assertEquals(description, block.getDescription()); + assertEquals(comment, block.getComment()); + assertEquals(type, block.getType()); + assertEquals(blockList.size(), block.getSubblocks().size()); + assertEquals(true, block.isActive()); + assertEquals(paramList.size(), block.getParameters().size()); + + // Check switching the required mode off + block.setActive(false); + assertEquals(false, block.isActive()); + + return; + + } + + /** + * This operation checks the ability of the Block to write itself to an ICE + * TreeComposite. + */ + @Test + public void checkToTreeComposite() { + + // Local Declarations + String name = "Snow", description = "Snow always mirrors"; + String type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + ArrayList paramList = new ArrayList(); + Block block = new Block(), subBlock = new Block(); + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setDescription(description); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type("Test Param 1"); + param1.setDescription("Test Param 1"); + param1.setRequired(true); + + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault("Test Param 2"); + param2.setCpp_type("Test Param 2"); + param2.setDescription("Test Param 2"); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + block.setActive(true); + + // Create a TreeComposite from the Block + TreeComposite tree = block.toTreeComposite(); + + // Check the tree + assertEquals(name, tree.getName()); + assertEquals(description, tree.getDescription()); + assertEquals(true, tree.isActive()); + // Check the parameters + assertEquals(1, tree.getNumberOfDataNodes()); + assertTrue(tree.getComponent(1) instanceof DataComponent); + DataComponent parameters = (DataComponent) tree.getComponent(1); + assertEquals(paramList.size(), parameters.retrieveAllEntries().size()); + // Check the subblocks + assertEquals(blockList.size(), tree.getNumberOfChildren()); + + return; + } + + /** + * This operation checks the ability of the block to write itself in a + * GetPot compatible string. + */ + @Test + public void checkToGetPot() { + + // Local Declarations + String name = "Snow", comment = "Snow always mirrors"; + String type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + Parameter param3 = new Parameter(); + ArrayList paramList = new ArrayList(); + ArrayList subBlockParamList = new ArrayList(); + Block block = new Block(), subBlock = new Block(); + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setComment(comment); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type("Test Param 1"); + param1.setRequired(true); + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault(""); + param2.setCpp_type("Test Param 2"); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + block.setActive(true); + + // Setup the subblock + param3.setName("Test Param 3"); + param3.setDefault("Test Param 3"); + param3.setCpp_type("Test Param 3"); + param3.setRequired(true); + subBlockParamList.add(param3); + subBlock.setParameters(subBlockParamList); + subBlock.setActive(true); + + // Create a GetPot string from the Block and check it + // System.out.println(block.toGetPot(null)); + String testString = + "[Snow] # Snow always mirrors\n" + + " Test Param 1 = Test Param 1\n" + + "# Test Param 2 = \n" + + " [./]\n" + + " Test Param 3 = Test Param 3\n" + + " [../]\n" + + "[]\n"; + // System.out.println(testString); + assertEquals(testString, block.toGetPot(null)); + // Make sure that toString() works as described. + // System.out.println(testString); + assertEquals(testString, block.toString()); + + return; + } + + /** + * This operation checks the Block to make sure that it can be loaded from a + * GetPot-compatible string. + */ + @Test + public void checkFromGetPot() { + + // Local Declarations + String name = "Snow", description = "Snow always mirrors"; + String type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + Parameter param3 = new Parameter(); + ArrayList paramList = new ArrayList(); + ArrayList subBlockParamList = new ArrayList(); + Block block = new Block(), subBlock = new Block(); + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setDescription(description); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type("Test Param 1"); + param1.setRequired(true); + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault("Test Param 2"); + param2.setCpp_type("Test Param 2"); + param2.setRequired(true); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + block.setActive(true); + + // Setup the subblock + param3.setName("Test Param 3"); + param3.setDefault("Test Param 3"); + param3.setCpp_type("Test Param 3"); + param3.setRequired(true); + subBlockParamList.add(param3); + subBlock.setParameters(subBlockParamList); + subBlock.setActive(true); + + // Create a block to test + Block testBlock = new Block(); + testBlock.fromGetPot(block.toGetPot(null)); + System.out.println(block.toGetPot(null)); + + // Check the block information + assertEquals(block.getName(), testBlock.getName()); + + // Grab the parameters from the test block + ArrayList testParameters = testBlock.getParameters(); + assertEquals(block.getParameters().size(), testParameters.size()); + // Check the first one + Parameter testParam = testParameters.get(0); + assertEquals(param1.getName(), testParam.getName()); + assertEquals(param1.getDefault(), testParam.getDefault()); + // Check the second one + testParam = testParameters.get(1); + assertEquals(param2.getName(), testParam.getName()); + assertEquals(param2.getDefault(), testParam.getDefault()); + + // Grab the subblock and check it + ArrayList testSubBlocks = testBlock.getSubblocks(); + assertEquals(block.getSubblocks().size(), testSubBlocks.size()); + Block testSubBlock = testSubBlocks.get(0); + assertEquals(subBlock.getName(), testSubBlock.getName()); + // Check the parameter list of the subblock + testParameters = testSubBlock.getParameters(); + assertEquals(subBlock.getParameters().size(), testParameters.size()); + // Check the parameter + testParam = testParameters.get(0); + assertEquals(param3.getName(), testParam.getName()); + assertEquals(param3.getDefault(), testParam.getDefault()); + + return; + } + + /** + * This operation checks the Block to make sure that it can be loaded from a + * TreeComposite. + */ + @Test + public void checkFromTreeComposite() { + + // Local Declarations + String name = "Snow", description = "Snow always mirrors"; + String type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + ArrayList paramList = new ArrayList(); + Block block = new Block(), subBlock = new Block(), testBlock = null; + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setDescription(description); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type(type); + param1.setDescription("Test Param 1"); + param1.setRequired(true); + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault("Test Param 2"); + param2.setCpp_type(type); + param2.setDescription("Test Param 2"); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + block.setActive(true); + + // Create a TreeComposite from the Block + TreeComposite tree = block.toTreeComposite(); + assertNotNull(tree); + + // Load the test block + testBlock = new Block(); + testBlock.fromTreeComposite(tree); + + // Check the Block + assertEquals(block.getName(), testBlock.getName()); + assertEquals(block.getDescription(), testBlock.getDescription()); + assertEquals(block.getParameters().size(), testBlock.getParameters() + .size()); + assertEquals(block.getSubblocks().size(), testBlock.getSubblocks() + .size()); + assertEquals(block.isActive(), testBlock.isActive()); + // System.out.println(block.toGetPot(null)); + + // There's no need to check the children thoroughly. At least, not yet. + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/MOOSEFileHandlerTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/MOOSEFileHandlerTester.java new file mode 100644 index 000000000..8c4c9ec9b --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/MOOSEFileHandlerTester.java @@ -0,0 +1,397 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.moose; + +import static org.junit.Assert.*; + +import org.eclipse.ice.datastructures.form.AdaptiveTreeComposite; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.item.utilities.moose.MOOSEFileHandler; +import org.eclipse.ice.item.utilities.moose.Parameter; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; + +import org.junit.Test; + +/** + * This class tests the MOOSEFileHandler. + * + * @author Jay Jay Billings + */ +public class MOOSEFileHandlerTester { + /** + * This operation makes sure that MOOSE data can be loaded a gold-standard + * YAML file. + */ + @Test + public void checkLoadingFromYAML() { + + // Local Declarations + String separator = System.getProperty("file.separator"); + DataComponent parameters = null; + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String shortFilePath = userDir + separator + "bison_short.yaml"; + String mediumFilePath = userDir + separator + "bison_medium.yaml"; + String largeFilePath = userDir + separator + "bison.yaml"; + MOOSEFileHandler handler = new MOOSEFileHandler(); + + System.out.println("MOOSEFileHandlerTester Message: " + + "Checking small sized file."); + + // Load the blocks for a file with only a single parent block + ArrayList blocks = null; + try { + blocks = handler.loadYAML(shortFilePath); + } catch (IOException e) { + e.printStackTrace(); + } + + // Check the blocks. This file should only have one block. + assertNotNull(blocks); + assertEquals(3, blocks.size()); + assertEquals("Adaptivity", blocks.get(0).getName()); + // But that block should have several parameters + parameters = (DataComponent) blocks.get(0).getComponent(1); + assertNotNull(parameters); + assertEquals(3, parameters.retrieveAllEntries().size()); + // And it should also have a couple of exemplar children + assertTrue(blocks.get(0).hasChildExemplars()); + assertEquals(2, blocks.get(0).getChildExemplars().size()); + + System.out.println("MOOSEFileHandlerTester Message: " + + "Checking medium sized file."); + + // Load the blocks for a file with multiple parent blocks + try { + blocks = handler.loadYAML(mediumFilePath); + } catch (IOException e) { + e.printStackTrace(); + } + + for (TreeComposite block : blocks) { + System.out.println("Block name = " + block.getName()); + } + + // Check the blocks + assertNotNull(blocks); + assertEquals(4, blocks.size()); + + System.out.println("MOOSEFileHandlerTester Message: " + + "Checking large sized file."); + + // Load the blocks for a file with multiple parent blocks + try { + blocks = handler.loadYAML(largeFilePath); + } catch (IOException e) { + e.printStackTrace(); + } + + for (TreeComposite block : blocks) { + System.out.println("Block name = " + block.getName()); + } + + // Check the blocks + assertNotNull(blocks); + assertEquals(34, blocks.size()); + + // Verify blocks 17 and 23 are actually AdaptiveTreeComposites + assertTrue(blocks.get(17) instanceof AdaptiveTreeComposite); + assertTrue(blocks.get(23) instanceof AdaptiveTreeComposite); + + return; + + } + + /** + * This method is responsible for checking that action syntax file is + * correctly loaded. + * + * @throws IOException + */ + @Test + public void checkLoadingActionSyntax() throws IOException { + + // Local declarations + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String pathName = userDir + separator + "bison.syntax"; + + // Create a new MOOSEFileHandler + MOOSEFileHandler handler = new MOOSEFileHandler(); + + // Load the action syntax + ArrayList actionSyntax = handler.loadActionSyntax(pathName); + + // Verify it loaded an ArrayList correctly + assertNotNull(actionSyntax); + assertEquals(21, actionSyntax.size()); + + // Verify a couple of the entries + assertEquals("Adaptivity", actionSyntax.get(0)); + assertEquals("AuxVariables/*/InitialCondition", actionSyntax.get(1)); + assertEquals("BCs/PlenumPressure", actionSyntax.get(4)); + assertEquals("Executioner/Adaptivity", actionSyntax.get(10)); + assertEquals("Executioner/TimeStepper", actionSyntax.get(13)); + assertEquals("GlobalParams", actionSyntax.get(14)); + assertEquals("Problem", actionSyntax.get(19)); + assertEquals("Variables/*/InitialCondition", actionSyntax.get(20)); + + // Try loading with an invalid pathname + actionSyntax = handler.loadActionSyntax(null); + + // Check that it didn't work + assertNull(actionSyntax); + + return; + } + + /** + * This operation ensures that the MOOSEFileHandler can create a MOOSE input + * file from a set of incoming TreeComposites. + */ + @Test + public void checkWritingInputFileFromTree() { + + // Local Declarations + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String filePath = userDir + separator + "bison_short.yaml"; + String inputFilePath = userDir + separator + "bison_short.input"; + String outputFilePath = userDir + separator + "bison_short.output"; + String refFilePath = userDir + separator + "bison_short.input.ref"; + File outputFile = null; + MOOSEFileHandler handler = new MOOSEFileHandler(); + TreeComposite adaptivity = null, indicators = null; + TreeComposite analyticalIndicator = null, fluxJumpIndicator = null; + TreeComposite function = null, variable = null, dispX = null, powerHistory = null; + + // Load the blocks + ArrayList blocks = null; + try { + blocks = handler.loadYAML(filePath); + } catch (IOException e1) { + e1.printStackTrace(); + } + + // Create an analytical indicator + adaptivity = blocks.get(0); + indicators = (TreeComposite) adaptivity.getChildExemplars().get(0) + .clone(); + analyticalIndicator = (TreeComposite) indicators.getChildExemplars() + .get(1).clone(); + fluxJumpIndicator = (TreeComposite) indicators.getChildExemplars() + .get(2).clone(); + // Add these to the block. It *MUST* be done in this order. + adaptivity.setNextChild(indicators); + indicators.setNextChild(analyticalIndicator); + analyticalIndicator.setActive(true); + indicators.setNextChild(fluxJumpIndicator); + // Make the blocks active + adaptivity.setActive(true); + indicators.setActive(true); + analyticalIndicator.setActive(true); + fluxJumpIndicator.setActive(true); + + // Get and mark the enabled entries for the Adaptivity tree. + DataComponent adaptivityData = (DataComponent) adaptivity.getDataNodes().get(0); + adaptivity.setActiveDataNode(adaptivityData); + adaptivityData.retrieveEntry("initial_steps").setTag("true"); + adaptivityData.retrieveEntry("marker").setTag("true"); + adaptivityData.retrieveEntry("steps").setTag("true"); + + // Get and set entries for the Indicators subblocks + DataComponent analyticalIndicatorsComponent = + (DataComponent) analyticalIndicator.getDataNodes().get(0); + analyticalIndicatorsComponent.retrieveEntry("block").setTag("false"); + analyticalIndicatorsComponent.retrieveEntry("type").setTag("true"); + // "function" and "variable" are marked required by the YAML file + DataComponent fluxJumpIndicatorComponent = + (DataComponent) fluxJumpIndicator.getDataNodes().get(0); + fluxJumpIndicatorComponent.retrieveEntry("block").setTag("false"); + fluxJumpIndicatorComponent.retrieveEntry("scale_by_flux_faces").setTag("false"); + fluxJumpIndicatorComponent.retrieveEntry("type").setTag("true"); + // "property" and "variable" are marked required by the YAML file + + // Create a variable. Variable does not have any exemplars in this + // example, so we can just create a tree for this test. + variable = (TreeComposite) blocks.get(2); + dispX = new TreeComposite(); + dispX.setName("disp_x"); + variable.setNextChild(dispX); + // Activate both nodes + dispX.setActive(true); + variable.setActive(true); + + // Create a function + function = (TreeComposite) blocks.get(1); + powerHistory = (TreeComposite) function.getChildExemplars().get(0) + .clone(); + // Add the exemplar clone back into the function. Again it *MUST* be + // done this way. + function.setNextChild(powerHistory); + // Configure the power history + powerHistory.setName("power_history"); + // Activate both nodes + function.setActive(true); + powerHistory.setActive(true); + + // Configure the power history tree's data + DataComponent powerData = (DataComponent) powerHistory.getDataNodes().get(0); + powerData.retrieveEntry("type").setTag("true"); + powerData.retrieveEntry("scale_factor").setTag("true"); + // Add a parameter for the data file + Parameter dataFileParam = new Parameter(); + dataFileParam.setName("data_file"); + dataFileParam.setDefault("powerhistory.csv"); + dataFileParam.setEnabled(true); + powerData.addEntry(dataFileParam.toEntry()); + + // Dump the input file + handler.dumpInputFile(outputFilePath, blocks); + + // Check to see if the file(s) exists + outputFile = new File(outputFilePath); + assertTrue(outputFile.exists()); + + // Compare the input file to the reference file + int firstHash, lastHash; + try { + // Load the input file into a byte array + RandomAccessFile inputFileRAF = new RandomAccessFile(inputFilePath, + "r"); + byte[] inputBytes = new byte[(int) inputFileRAF.length()]; + inputFileRAF.read(inputBytes); + // Convert to a string + String inputString = new String(inputBytes); + + // Chop off the comments at the end of each line. The parameter + // descriptions from the YAML file are appended as comments via the + // process loading YAML through the MOOSEFileHandler. But this is + // an additional feature, and these comments aren't found in the + // original reference file, so we must remove them for testing + String[] inputArray = inputString.split("\\n+"); + inputString = ""; + boolean hasComment = false; + for (String line : inputArray) { + hasComment = !(line.lastIndexOf(" # ") == -1); + if (hasComment) { + + // Figure out if it's the whole line commented out, or just + // an in-line comment (only remove the inline) + firstHash = line.trim().indexOf("#"); + lastHash = line.trim().lastIndexOf("#"); + + // If the whole line is commented out, and has no in-line + // comment + if (firstHash == 0 && firstHash == lastHash) { + // do nothing + } else { + // Lop off the in-line comment. Unfortunately we must + // do this, as loading up a YAML file adds descriptions + // as comments, so the files won't be exactly the same. + line = line.substring(0, line.lastIndexOf(" # ")); + line = line.replaceAll("\\s+$", ""); + } + + if (line.endsWith("=")) { + line += " "; + } + } + + inputString += line + "\n"; + } + + // Load the reference file into a byte array + RandomAccessFile refFileRAF = new RandomAccessFile(refFilePath, "r"); + byte[] refBytes = new byte[(int) refFileRAF.length()]; + refFileRAF.read(refBytes); + // Convert to a string + String refString = new String(refBytes); + + // Compare the strings + System.out.println(inputString); + assertEquals(refString, inputString); + // Close everything + inputFileRAF.close(); + refFileRAF.close(); + outputFile.deleteOnExit(); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + + return; + } + + /** + * This operation checks the MOOSEFileHandler to make sure that it can load + * a MOOSE GetPot file into a TreeComposite. + */ + @Test + public void checkLoadingFromGetPot() { + + // Local Declarations + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String refFilePath = userDir + separator + "bison_short.input.ref"; + String outFilePath = userDir + separator + "bison_short.input.out"; + // Turn debugging on + System.setProperty("DebugICE", "on"); + // Create the handler + MOOSEFileHandler handler = new MOOSEFileHandler(); + + // Load the file into a TreeComposite with the Handler + ArrayList potTree = handler.loadFromGetPot(refFilePath); + + // Hehe... "potTree." + + // Write an output file based on the tree that was loaded + handler.dumpInputFile(outFilePath, potTree); + + // Compare the input file to the reference file + try { + // Load the reference file into a byte array + RandomAccessFile refFileRAF = new RandomAccessFile(refFilePath, "r"); + byte[] refBytes = new byte[(int) refFileRAF.length()]; + refFileRAF.read(refBytes); + // Load the input file into a byte array + RandomAccessFile outputFileRAF = new RandomAccessFile(outFilePath, + "r"); + byte[] outputBytes = new byte[(int) outputFileRAF.length()]; + outputFileRAF.read(outputBytes); + // Compare the strings + assertEquals(new String(refBytes), new String(outputBytes)); + // Close everything + outputFileRAF.close(); + refFileRAF.close(); + // Delete the output file + File inputFile = new File(outFilePath); + inputFile.delete(); + } catch (IOException e) { + e.printStackTrace(); + // One reason that this might happen is because the tree wasn't + // loaded from the pot file correctly. + fail(); + } + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/ParameterTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/ParameterTester.java new file mode 100644 index 000000000..7909622ec --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/ParameterTester.java @@ -0,0 +1,201 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.moose; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.item.utilities.moose.Parameter; + +/** + * This operation checks the MOOSE Parameter class. + * + * @author Jay Jay Billings + */ +public class ParameterTester { + + /** + * This operation checks the accessors for the Parameter class. + */ + @Test + public void checkAccessors() { + + // Local Declarations + String name = "Clara", description = "Companion", defaultValue = "Oswin"; + String comment = "Souffle Girl", group_name = "Oswald", cpp_type = "MooseEnum"; + boolean required = true; + String options = "option1 option2 option3"; + Parameter param = new Parameter(); + + // Setup the parameter + param.setName(name); + param.setCpp_type(cpp_type); + param.setDefault(defaultValue); + param.setDescription(description); + param.setComment(comment); + param.setGroup_name(group_name); + param.setRequired(required); + param.setOptions(options); + + // Check the parameter + assertEquals(name, param.getName()); + assertEquals(description, param.getDescription()); + assertEquals(comment, param.getComment()); + assertEquals(group_name, param.getGroup_name()); + assertEquals(required, param.isRequired()); + assertEquals(cpp_type, param.getCpp_type()); + assertEquals(defaultValue, param.getDefault()); + assertEquals(param.getOptions().toString(), "[option1, option2, option3]"); + + // Check switching the required mode off + param.setRequired(false); + assertEquals(false, param.isRequired()); + + return; + } + + /** + * This operation checks the ability of the Parameter to write itself to a + * ICE Entry. + */ + @Test + public void checkToEntry() { + + // Local Declarations + String name = "Souffle Girl", description = "Companion", defaultValue = "option1"; + String group_name = "Clara", cpp_type = "MooseEnum", comment = "Some comment"; + boolean required = true; + String options = "option1 option2 option3"; + Parameter param = new Parameter(); + + // Setup the parameter + param.setName(name); + param.setCpp_type(cpp_type); + param.setDefault(defaultValue); + param.setDescription(description); + param.setComment(comment); + param.setGroup_name(group_name); + param.setRequired(required); + param.setOptions(options); + + // Get the Entry + Entry entry = param.toEntry(); + + // Check the Entry + assertEquals(name, entry.getName()); + assertEquals(description, entry.getDescription()); + assertEquals(comment, entry.getComment()); + assertEquals(defaultValue, entry.getDefaultValue()); + assertEquals(required, entry.isRequired()); + assertEquals(entry.getValueType(), AllowedValueType.Discrete); + assertEquals(entry.getAllowedValues().toString(), + "[option1, option2, option3]"); + + return; + } + + /** + * This operation checks the ability of the parameter to write itself as a + * string. + */ + @Test + public void checkToString() { + + // Local Declarations + String name = "Clara", description = "Companion", defaultValue = "Oswin"; + String group_name = "Oswald", cpp_type = "std::string"; + boolean required = true; + Parameter param = new Parameter(); + + // Setup the parameter + param.setName(name); + param.setCpp_type(cpp_type); + param.setDefault(defaultValue); + param.setDescription(description); + param.setGroup_name(group_name); + param.setRequired(required); + + // Check the string + assertEquals(name + " = " + defaultValue, param.toString()); + + return; + } + + /** + * This operation checks the Parameter class to make sure that it can be + * loaded from a string. + */ + @Test + public void checkFromString() { + + // Local Declarations + String name = "Clara", defaultValue = "Companion"; + String paramString = name + " = " + defaultValue; + Parameter param = new Parameter(); + + // Load the parameter + param.fromString(paramString); + // Check the parameter + assertEquals(name, param.getName()); + assertEquals(defaultValue, param.getDefault()); + + return; + } + + /** + * This operation checks the Parameter to make sure that it can be loaded + * from an Entry. + */ + @Test + public void checkFromEntry() { + + // Local Declarations + String name = "Amy", description = "Companion", defaultValue = "option2"; + String group_name = "Pond", cpp_type = "MooseEnum", comment = "Scottish"; + boolean required = true; + String options = "option1 option2 option3"; + Parameter param = new Parameter(), testParam = null; + Entry paramEntry = null; + + // Setup the parameter + param.setName(name); + param.setCpp_type(cpp_type); + param.setDefault(defaultValue); + param.setDescription(description); + param.setComment(comment); + param.setGroup_name(group_name); + param.setRequired(required); + param.setOptions(options); + + // Create an Entry from the parameter + paramEntry = param.toEntry(); + assertNotNull(paramEntry); + + // Load the test parameter + testParam = new Parameter(); + testParam.fromEntry(paramEntry); + + // Check the Parameter. Only the name, description and value are + // converted. + assertEquals(param.getName(), testParam.getName()); + assertEquals(param.getDescription(), testParam.getDescription()); + assertEquals(param.getComment(), testParam.getComment()); + assertEquals(param.getDefault(), testParam.getDefault()); + assertEquals(param.isRequired(), testParam.isRequired()); + assertEquals(param.getOptions(), testParam.getOptions()); + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/YAMLBlockTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/YAMLBlockTester.java new file mode 100644 index 000000000..90636f030 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/moose/YAMLBlockTester.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.moose; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.item.utilities.moose.Block; +import org.eclipse.ice.item.utilities.moose.Parameter; +import org.eclipse.ice.item.utilities.moose.YAMLBlock; + +import java.util.ArrayList; + +import org.junit.Test; + +/** + * This class is responsible for testing the YAMLBlock class. + * + * @author Jay Jay Billings + */ +public class YAMLBlockTester { + /** + * This operation checks the ability of the YAMLBlock to write itself to a + * ICE TreeComposite. + */ + @Test + public void checkToTreeComposite() { + + // Local Declarations + String name = "Snow", description = "Snow always mirrors"; + String type = "std::string"; + Parameter param1 = new Parameter(), param2 = new Parameter(); + ArrayList paramList = new ArrayList(); + Block block = new YAMLBlock(), subBlock = new YAMLBlock(); + ArrayList blockList = new ArrayList(); + + // Setup the block + block.setName(name); + block.setType(type); + block.setDescription(description); + param1.setName("Test Param 1"); + param1.setDefault("Test Param 1"); + param1.setCpp_type("Test Param 1"); + param1.setDescription("Test Param 1"); + param1.setComment("Test Param 1"); + param1.setRequired(true); + paramList.add(param1); + param2.setName("Test Param 2"); + param2.setDefault("Test Param 2"); + param2.setCpp_type("Test Param 2"); + param2.setDescription("Test Param 2"); + param2.setComment("Test Param 2"); + paramList.add(param2); + block.setParameters(paramList); + blockList.add(subBlock); + block.setSubblocks(blockList); + + // Create a TreeComposite from the Block + TreeComposite tree = block.toTreeComposite(); + + // Check the tree + assertEquals(name, tree.getName()); + assertEquals(description, tree.getDescription()); + assertEquals(type, block.getType()); + // Check the parameters + assertEquals(1, tree.getNumberOfDataNodes()); + assertTrue(tree.getComponent(1) instanceof DataComponent); + DataComponent parameters = (DataComponent) tree.getComponent(1); + assertEquals(paramList.size(), parameters.retrieveAllEntries().size()); + // Check the subblocks. For YAML blocks they should be configured as + // child exemplars of the TreeComposite. + assertEquals(0, tree.getNumberOfChildren()); + assertTrue(tree.hasChildExemplars()); + assertEquals(blockList.size(), tree.getChildExemplars().size()); + + return; + } +} diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSELauncherTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSELauncherTester.java new file mode 100644 index 000000000..9bb914d06 --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSELauncherTester.java @@ -0,0 +1,227 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.nuclear; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.net.URI; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.ice.datastructures.form.AllowedValueType; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.io.serializable.IOService; +import org.eclipse.ice.item.nuclear.MOOSELauncher; +import org.eclipse.ice.item.utilities.moose.MOOSEFileHandler; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * This class tests the MOOSELauncher Item to make sure that it can correctly + * create its Form and process a modified Form. + * + * @author Jay Jay Billings + */ +public class MOOSELauncherTester { + + /** + * The project space used to create the workspace for the tests. + */ + private static IProject projectSpace; + + /** + * The IO Service used to read/write via MOOSEFileHandler. + */ + private static IOService service; + + /** + * A MOOSE Launcher used for testing. + */ + private static MOOSELauncher launcher; + + /** + * This operation sets up the workspace. It copies the necessary MOOSE data + * files into ${workspace}/MOOSE. + */ + @BeforeClass + public static void beforeTests() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String projectName = "MOOSEModelTesterWorkspace"; + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String filePath = userDir + separator + "input_coarse10.i"; + String filePath2 = userDir + separator + "input_coarse10_filetest.i"; + // Debug information + System.out.println("MOOSE Test Data File: " + filePath); + + // Setup the project + try { + // Get the project handle + project = workspaceRoot.getProject(projectName); + // If the project does not exist, create it + if (!project.exists()) { + // Set the location as + // ${workspace_loc}/MOOSEModelTesterWorkspace + defaultProjectLocation = (new File(userDir + separator + + projectName)).toURI(); + // Create the project description + IProjectDescription desc = ResourcesPlugin.getWorkspace() + .newProjectDescription(projectName); + // 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); + } + + // Create the File handle and input stream for the Bison input + // file + IPath moosePath = new Path(filePath); + File mooseFile = moosePath.toFile(); + FileInputStream mooseStream = new FileInputStream(mooseFile); + // Create the file in the workspace for the Bison input file + IFile bisonInputFile = project.getFile("input_coarse10.i"); + if (!bisonInputFile.exists()) { + bisonInputFile.create(mooseStream, true, null); + } + + IPath moosePath2 = new Path(filePath2); + File mooseFile2 = moosePath2.toFile(); + FileInputStream mooseStream2 = new FileInputStream(mooseFile2); + // Create the file in the workspace for the Bison input file + IFile bisonInputFile2 = project + .getFile("input_coarse10_filetest.i"); + if (!bisonInputFile2.exists()) { + bisonInputFile2.create(mooseStream2, true, null); + } + // Refresh the workspace + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + // Catch exception for creating the project + e.printStackTrace(); + fail(); + } catch (FileNotFoundException e) { + // Catch exception for failing to load the file + e.printStackTrace(); + fail(); + } + + // Set the global project reference. + projectSpace = project; + + // Set up an IO service and add a reader + launcher = new MOOSELauncher(projectSpace); + service = new IOService(); + service.addReader(new MOOSEFileHandler()); + launcher.setIOService(service); + + return; + } + + @Test + public void checkDynamicFileGeneration() { + + // Local Declarations + DataComponent fileDataComp = + (DataComponent) launcher.getForm().getComponent(1); + assertTrue(fileDataComp + .retrieveEntry("Input File").setValue("input_coarse10.i")); + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + e1.printStackTrace(); + } + assertEquals(4, fileDataComp.retrieveAllEntries().size()); + + // Now change the file name + assertTrue(fileDataComp + .retrieveEntry("Input File").setValue("input_coarse10_filetest.i")); + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + assertEquals(3, fileDataComp.retrieveAllEntries().size()); + } + + @Test + public void checkCustomAppEntry() { + + // Local declarations + DataComponent execDataComp = + (DataComponent) launcher.getForm().getComponent(5); + final String customExecName = "Custom executable name"; + Entry standardExecEntry = execDataComp.retrieveEntry("Executable"); + Entry customExecEntry = execDataComp.retrieveEntry(customExecName); + + // Verify the DataComponent that holds the executable Entries + assertEquals(execDataComp.retrieveAllEntries().size(), 2); + assertNotNull(standardExecEntry); + assertNotNull(customExecEntry); + + // Verify the standard Entry contains an option for a custom app + assertTrue(standardExecEntry.getAllowedValues().contains(customExecName)); + + // Verify the custom app Entry's type + assertEquals(customExecEntry.getValueType(), AllowedValueType.Undefined); + + return; + } + + /** + * Closes the MOOSE tester workspace created in the BeforeClass method. + */ + @AfterClass + public static void afterTests() { + + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + try { + // Close and delete the fake workspace created + projectSpace.close(null); + workspaceRoot.delete(true, true, null); + + // Nullify the IO service + service = null; + + } catch (CoreException e) { + e.printStackTrace(); + } + + return; + } + +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelBuilderTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelBuilderTester.java new file mode 100644 index 000000000..68182300f --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelBuilderTester.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.nuclear; + +import static org.junit.Assert.*; + +import org.eclipse.ice.item.Item; +import org.eclipse.ice.item.ItemType; +import org.eclipse.ice.item.nuclear.MOOSEModel; +import org.eclipse.ice.item.nuclear.MOOSEModelBuilder; +import org.junit.Test; + +/** + *

+ * This class is responsible for testing the MOOSEModelBuilder. + *

+ * + * @author Jay Jay Billings + */ +public class MOOSEModelBuilderTester { + /** + *

+ * This operation insures that the builder can properly construct the + * MOOSEModel. + *

+ * + */ + @Test + public void checkItemBuild() { + + MOOSEModelBuilder builder = new MOOSEModelBuilder(); + assertEquals("MOOSE Model Builder", MOOSEModelBuilder.name); + assertEquals("MOOSE Model Builder", builder.getItemName()); + assertEquals(ItemType.Model, MOOSEModelBuilder.type); + assertEquals(ItemType.Model, builder.getItemType()); + Item model = builder.build(null); + assertTrue(model instanceof MOOSEModel); + + return; + } +} \ No newline at end of file diff --git a/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelTester.java b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelTester.java new file mode 100644 index 000000000..8c633278f --- /dev/null +++ b/org.eclipse.ice.item.test/src/org/eclipse/ice/item/test/nuclear/MOOSEModelTester.java @@ -0,0 +1,401 @@ +/******************************************************************************* + * 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, + * Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson, + * Claire Saunders, Matthew Wang, Anna Wojtowicz + *******************************************************************************/ +package org.eclipse.ice.item.test.nuclear; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.net.URI; +import java.util.ArrayList; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.ice.datastructures.ICEObject.Component; +import org.eclipse.ice.datastructures.form.DataComponent; +import org.eclipse.ice.datastructures.form.Entry; +import org.eclipse.ice.datastructures.form.Form; +import org.eclipse.ice.datastructures.form.FormStatus; +import org.eclipse.ice.datastructures.form.ResourceComponent; +import org.eclipse.ice.datastructures.form.TreeComposite; +import org.eclipse.ice.io.serializable.IOService; +import org.eclipse.ice.item.nuclear.MOOSEModel; +import org.eclipse.ice.item.utilities.moose.MOOSEFileHandler; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * This class tests the MOOSEModel Item to make sure that it can correctly + * create its Form and process a modified Form. + * + * @author Jay Jay Billings + */ +public class MOOSEModelTester { + + /** + * The project space used to create the workspace for the tests. + */ + private static IProject projectSpace; + + /** + * The IO Service used to read/write via MOOSEFileHandler. + */ + private static IOService service; + + /** + * This operation sets up the workspace. It copies the necessary MOOSE data + * files into ${workspace}/MOOSE. + */ + @BeforeClass + public static void beforeTests() { + + // Local Declarations + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + URI defaultProjectLocation = null; + IProject project = null; + String projectName = "MOOSEModelTesterWorkspace"; + String separator = System.getProperty("file.separator"); + String userDir = System.getProperty("user.home") + separator + + "ICETests" + separator + "itemData"; + String yamlFile = userDir + separator + "bison.yaml"; + String filePath = userDir + separator + "input_coarse10.i"; + + // Debug information + System.out.println("MOOSE Test Data File: " + filePath); + + // Setup the project + try { + // Get the project handle + project = workspaceRoot.getProject(projectName); + // If the project does not exist, create it + if (!project.exists()) { + // Set the location as + // ${workspace_loc}/MOOSEModelTesterWorkspace + defaultProjectLocation = (new File(userDir + separator + + projectName)).toURI(); + // Create the project description + IProjectDescription desc = ResourcesPlugin.getWorkspace() + .newProjectDescription(projectName); + // 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); + } + + // Create the File handle and input stream for the Bison YAML + // file + IPath bisonPath = new Path(yamlFile); + File bisonFile = bisonPath.toFile(); + FileInputStream bisonStream = new FileInputStream(bisonFile); + // Create the file in the workspace for the Bison YAML file + IFile bisonYAMLFile = project.getFile("bison.yaml"); + if (!bisonYAMLFile.exists()) { + bisonYAMLFile.create(bisonStream, true, null); + } + + // Create the File handle and input stream for the Bison input + // file + IPath moosePath = new Path(filePath); + File mooseFile = moosePath.toFile(); + FileInputStream mooseStream = new FileInputStream(mooseFile); + // Create the file in the workspace for the Bison input file + IFile bisonInputFile = project.getFile("input_coarse10.i"); + if (!bisonInputFile.exists()) { + bisonInputFile.create(mooseStream, true, null); + } + + // Refresh the workspace + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + // Catch exception for creating the project + e.printStackTrace(); + fail(); + } catch (FileNotFoundException e) { + // Catch exception for failing to load the file + e.printStackTrace(); + fail(); + } + + // Set the global project reference. + projectSpace = project; + + // Set up an IO service and add a reader and writer + service = new IOService(); + service.addWriter(new MOOSEFileHandler()); + service.addReader(new MOOSEFileHandler()); + + return; + } + + /** + * This operation checks the MOOSEModel and makes sure that it can properly + * construct its Form. + */ + @Test + public void checkConstruction() { + + // Create a MOOSEModel to test + MOOSEModel model = setupMOOSEItem(); + + // Check the form + Form form = model.getForm(); + assertNotNull(form); + assertEquals(3, form.getComponents().size()); + + // Check the data component + assertTrue(form.getComponent(MOOSEModel.fileDataComponentId) instanceof DataComponent); + + // Check the MOOSE app entry + Entry mooseAppEntry = ((DataComponent) form + .getComponent(MOOSEModel.fileDataComponentId)) + .retrieveEntry("MOOSE-Based Application"); + assertNotNull(mooseAppEntry); + assertEquals(1, mooseAppEntry.getId()); + assertEquals("None", mooseAppEntry.getDefaultValue()); + assertEquals(mooseAppEntry.getDefaultValue(), mooseAppEntry.getValue()); + + // Check the output file Entry + Entry outputFileEntry = ((DataComponent) form + .getComponent(MOOSEModel.fileDataComponentId)) + .retrieveEntry("Output File Name"); + assertNotNull(outputFileEntry); + assertEquals(2, outputFileEntry.getId()); + assertEquals("mooseModel.i", outputFileEntry.getValue()); + + // Check the TreeComposite + assertTrue(form.getComponent(MOOSEModel.mooseTreeCompositeId) instanceof TreeComposite); + + // Check the ResourceComponent + assertTrue(form.getComponent(MOOSEModel.resourceComponentId) instanceof ResourceComponent); + + return; + } + + /** + * This operation checks the MOOSEModel to make sure that it can correctly + * process its Form and generate a MOOSE input file. + */ + @Test + public void checkProcessing() { + + // Local Declarations + String testFilename = "bison_test_file.inp"; + + // Create a MOOSEModel to test + MOOSEModel model = setupMOOSEItem(); + + // Set the IOService on the model so we can write out + model.setIOService(service); + + // Check the form + Form form = model.getForm(); + assertNotNull(form); + + // Check the action list + assertEquals(2, form.getActionList().size()); + assertTrue(form.getActionList().contains("Write MOOSE File")); + + // Change the output file name to make sure that it is possible + Entry outputFileEntry = ((DataComponent) form.getComponent(1)) + .retrieveEntry("Output File Name"); + outputFileEntry.setValue(testFilename); + + // Resubmit the form + assertEquals(FormStatus.ReadyToProcess, model.submitForm(form)); + + // Direct the model to write the output file + assertEquals(FormStatus.Processed, model.process("Write MOOSE File")); + + // Check that the file exists + assertTrue(projectSpace.getFile(testFilename).exists()); + + return; + } + + /** + * This operation is responsible for ensuring that the MOOSEModel can load + * input. This operation checks this by passing it an input file for Bison. + */ + @Test + public void checkLoadingInput() { + + // Local Declarations + int numMooseBlocks = 20; + + // Create a MOOSE Item + MOOSEModel mooseItem = setupMOOSEItem(); + + // Set the IO service on the item so we can read/load data in + mooseItem.setIOService(service); + + // Load the input + mooseItem.loadInput("input_coarse10.i"); + + // Pull the Form + Form form = mooseItem.getForm(); + + // Get the TreeComposite to search it for known blocks and parameters + TreeComposite mooseTree = (TreeComposite) form + .getComponent(MOOSEModel.mooseTreeCompositeId); + + // Get its children + ArrayList subMooseTrees = new ArrayList(); + int loopSize = mooseTree.getNumberOfChildren(); + for (int i = 0; i < loopSize; i++) { + subMooseTrees.add(mooseTree.getChildAtIndex(i)); + } + + // Make sure we have the correct number of sub trees + assertEquals(numMooseBlocks, subMooseTrees.size()); + + // Get the names of the blocks + ArrayList blockNames = new ArrayList(); + loopSize = subMooseTrees.size(); + int outputsBlockIndex = 0; + for (int i = 0; i < loopSize; i++) { + // System.out.println("Blocknames: " + + // subMooseTrees.get(i).getName()); + blockNames.add(subMooseTrees.get(i).getName()); + + // Determine the index of the "Outputs" block (used in the next set + // of tests) + if ("Outputs".equals(subMooseTrees.get(i).getName())) { + outputsBlockIndex = i; + } + } + + // Check all of the block names. They should all be in the tree. + assertTrue(blockNames.contains("GlobalParams")); + assertTrue(blockNames.contains("Problem")); + assertTrue(blockNames.contains("Mesh")); + assertTrue(blockNames.contains("Variables")); + assertTrue(blockNames.contains("AuxVariables")); + assertTrue(blockNames.contains("Functions")); + assertTrue(blockNames.contains("SolidMechanics")); + assertTrue(blockNames.contains("Kernels")); + assertTrue(blockNames.contains("Burnup")); + assertTrue(blockNames.contains("AuxKernels")); + assertTrue(blockNames.contains("AuxBCs")); + assertTrue(blockNames.contains("Contact")); + assertTrue(blockNames.contains("ThermalContact")); + assertTrue(blockNames.contains("BCs")); + assertTrue(blockNames.contains("CoolantChannel")); + assertTrue(blockNames.contains("Materials")); + assertTrue(blockNames.contains("Dampers")); + assertTrue(blockNames.contains("Executioner")); + assertTrue(blockNames.contains("Postprocessors")); + assertTrue(blockNames.contains("Outputs")); + + // Get the "Outputs" block and its data node + TreeComposite outputsTree = (TreeComposite) subMooseTrees + .get(outputsBlockIndex); + DataComponent dataNode = (DataComponent) outputsTree + .getActiveDataNode(); + assertNotNull(dataNode); + + // Get the parameters off the data node + ArrayList parameters = dataNode.retrieveAllEntries(); + assertNotNull(parameters); + assertEquals(3, parameters.size()); + // Check the first one + Entry param = parameters.get(0); + assertEquals("interval", param.getName()); + assertEquals("1", param.getValue()); + // Check the second one + param = parameters.get(1); + assertEquals("output_initial", param.getName()); + assertEquals("true", param.getValue()); + // Check the third one + param = parameters.get(2); + assertEquals("exodus", param.getName()); + assertEquals("true", param.getValue()); + + // Get the console block off the output block + TreeComposite consoleTree = outputsTree.getChildAtIndex(0); + assertNotNull(consoleTree); + assertEquals("console", consoleTree.getName()); + + // Get the parameters from the console block + dataNode = (DataComponent) consoleTree.getActiveDataNode(); + parameters = dataNode.retrieveAllEntries(); + assertNotNull(parameters); + assertEquals(4, parameters.size()); + // Check the first one + param = parameters.get(0); + assertEquals("type", param.getName()); + assertEquals("Console", param.getValue()); + // Check the second one + param = parameters.get(1); + assertEquals("perf_log", param.getName()); + assertEquals("true", param.getValue()); + // Check the third one + param = parameters.get(2); + assertEquals("linear_residuals", param.getName()); + assertEquals("true", param.getValue()); + // Check the fourth one + param = parameters.get(3); + assertEquals("max_rows", param.getName()); + assertEquals("25", param.getValue()); + + return; + } + + /** + * This operation configures a MOOSEModel. It is used by both test + * operations. + * + * @return A newly instantiated MOOSEModel. + */ + private MOOSEModel setupMOOSEItem() { + + // Local Declarations + MOOSEModel model = new MOOSEModel(projectSpace); + + return model; + } + + /** + * Closes the MOOSE tester workspace created in the BeforeClass method. + */ + @AfterClass + public static void afterTests() { + try { + // Close and delete the fake workspace created + projectSpace.close(null); + + // Nullify the IO service + service = null; + } catch (CoreException e) { + e.printStackTrace(); + } + + return; + } + +} diff --git a/org.eclipse.ice.item.test/taggedTestFile.txt b/org.eclipse.ice.item.test/taggedTestFile.txt new file mode 100644 index 000000000..d790166f2 --- /dev/null +++ b/org.eclipse.ice.item.test/taggedTestFile.txt @@ -0,0 +1,4 @@ +Scotty=chief engineer +Kirk=captain +Bones=chief medical officer +Spock=first officer diff --git a/repository/org.eclipse.ice.repository/ice.product.launch b/repository/org.eclipse.ice.repository/ice.product.launch index 771126024..3996da07f 100644 --- a/repository/org.eclipse.ice.repository/ice.product.launch +++ b/repository/org.eclipse.ice.repository/ice.product.launch @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/org.eclipse.ice.materials/data/userMatDB.xml b/src/org.eclipse.ice.materials/data/userMatDB.xml index 9454e9fb1..f34df51c8 100644 --- a/src/org.eclipse.ice.materials/data/userMatDB.xml +++ b/src/org.eclipse.ice.materials/data/userMatDB.xml @@ -4,33 +4,33 @@ Ga 1 - - mmabs/l (Ã…-2) - 1.32E14 - - - Abs xs - 2.75 - Inc xs 0.16 - Dens (at/nm3) - 51.0 + mmabs/l (Ã…-2) + 1.32E14 M (amu) 69.72 + + Coh b + 7.288 + Dens (g/cm3) 5.9 - Coh b - 7.288 + Abs xs + 2.75 + + + Dens (at/nm3) + 51.0 mminc (Ã…-1) @@ -42,33 +42,33 @@ 188Os 1 - - mmabs/l (Ã…-2) - 8.37E13 - - - Abs xs - 4.7 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.37E13 M (amu) 188.0 + + Coh b + 7.6 + Dens (g/cm3) 0.0 - Coh b - 7.6 + Abs xs + 4.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -80,33 +80,33 @@ 137Ba 1 - - mmabs/l (Ã…-2) - 8.8E13 - - - Abs xs - 3.6 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.8E13 M (amu) 137.0 + + Coh b + 6.83 + Dens (g/cm3) 0.0 - Coh b - 6.83 + Abs xs + 3.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -118,33 +118,33 @@ 22Ne 1 - - mmabs/l (Ã…-2) - 7.0E12 - - - Abs xs - 0.046 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.0E12 M (amu) 22.0 + + Coh b + 3.87 + Dens (g/cm3) 0.0 - Coh b - 3.87 + Abs xs + 0.046 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -156,33 +156,33 @@ 184Os 1 - - mmabs/l (Ã…-2) - 5.46E16 - - - Abs xs - 3000.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.46E16 M (amu) 184.0 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 3000.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -194,33 +194,33 @@ Fe 1 - - mmabs/l (Ã…-2) - 1.53E14 - - - Abs xs - 2.56 - Inc xs 0.4 - Dens (at/nm3) - 84.76 + mmabs/l (Ã…-2) + 1.53E14 M (amu) 55.847 + + Coh b + 9.45 + Dens (g/cm3) 7.86 - Coh b - 9.45 + Abs xs + 2.56 + + + Dens (at/nm3) + 84.76 mminc (Ã…-1) @@ -232,33 +232,33 @@ 29Si 1 - - mmabs/l (Ã…-2) - 1.17E13 - - - Abs xs - 0.101 - Inc xs 0.001 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.17E13 M (amu) 29.0 + + Coh b + 4.7 + Dens (g/cm3) 0.0 - Coh b - 4.7 + Abs xs + 0.101 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -270,33 +270,33 @@ 26Mg 1 - - mmabs/l (Ã…-2) - 4.92E12 - - - Abs xs - 0.0382 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.92E12 M (amu) 26.0 + + Coh b + 4.89 + Dens (g/cm3) 0.0 - Coh b - 4.89 + Abs xs + 0.0382 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -308,33 +308,33 @@ 3He 1 - - mmabs/l (Ã…-2) - 5.95E18 - - - Abs xs - 5333.0 - Inc xs 1.6 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.95E18 M (amu) 3.0 + + Coh b + 5.74 + Dens (g/cm3) 0.0 - Coh b - 5.74 + Abs xs + 5333.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -346,33 +346,33 @@ 130Te 1 - - mmabs/l (Ã…-2) - 7.47E12 - - - Abs xs - 0.29 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.47E12 M (amu) 130.0 + + Coh b + 6.02 + Dens (g/cm3) 0.0 - Coh b - 6.02 + Abs xs + 0.29 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -384,33 +384,33 @@ Eu 1 - - mmabs/l (Ã…-2) - 9.98E16 - - - Abs xs - 4530.0 - Inc xs 2.5 - Dens (at/nm3) - 20.77 + mmabs/l (Ã…-2) + 9.98E16 M (amu) 151.96 + + Coh b + 7.22 + Dens (g/cm3) 5.24 - Coh b - 7.22 + Abs xs + 4530.0 + + + Dens (at/nm3) + 20.77 mminc (Ã…-1) @@ -422,33 +422,33 @@ 85Rb 1 - - mmabs/l (Ã…-2) - 1.89E13 - - - Abs xs - 0.48 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.89E13 M (amu) 85.0 + + Coh b + 7.03 + Dens (g/cm3) 0.0 - Coh b - 7.03 + Abs xs + 0.48 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -460,33 +460,33 @@ 160Gd 1 - - mmabs/l (Ã…-2) - 1.61E13 - - - Abs xs - 0.77 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.61E13 M (amu) 160.0 + + Coh b + 9.15 + Dens (g/cm3) 0.0 - Coh b - 9.15 + Abs xs + 0.77 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -498,33 +498,33 @@ Er 1 - - mmabs/l (Ã…-2) - 3.18E15 - - - Abs xs - 159.0 - Inc xs 1.1 - Dens (at/nm3) - 32.42 + mmabs/l (Ã…-2) + 3.18E15 M (amu) 167.28 + + Coh b + 7.79 + Dens (g/cm3) 9.01 - Coh b - 7.79 + Abs xs + 159.0 + + + Dens (at/nm3) + 32.42 mminc (Ã…-1) @@ -536,33 +536,33 @@ 86Kr 1 - - mmabs/l (Ã…-2) - 1.17E11 - - - Abs xs - 0.003 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.17E11 M (amu) 86.0 + + Coh b + 8.1 + Dens (g/cm3) 0.0 - Coh b - 8.1 + Abs xs + 0.003 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -574,33 +574,33 @@ 109Ag 1 - - mmabs/l (Ã…-2) - 2.8E15 - - - Abs xs - 91.0 - Inc xs 0.32 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.8E15 M (amu) 109.0 + + Coh b + 4.165 + Dens (g/cm3) 0.0 - Coh b - 4.165 + Abs xs + 91.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -612,33 +612,33 @@ 46Ti 1 - - mmabs/l (Ã…-2) - 4.29E13 - - - Abs xs - 0.59 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.29E13 M (amu) 46.0 + + Coh b + 4.93 + Dens (g/cm3) 0.0 - Coh b - 4.93 + Abs xs + 0.59 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -650,33 +650,33 @@ 76Ge 1 - - mmabs/l (Ã…-2) - 7.05E12 - - - Abs xs - 0.16 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.05E12 M (amu) 76.0 + + Coh b + 8.2 + Dens (g/cm3) 0.0 - Coh b - 8.2 + Abs xs + 0.16 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -688,33 +688,33 @@ Dy 1 - - mmabs/l (Ã…-2) - 2.05E16 - - - Abs xs - 994.0 - Inc xs 54.4 - Dens (at/nm3) - 31.69 + mmabs/l (Ã…-2) + 2.05E16 M (amu) 162.5 + + Coh b + 16.9 + Dens (g/cm3) 8.55 - Coh b - 16.9 + Abs xs + 994.0 + + + Dens (at/nm3) + 31.69 mminc (Ã…-1) @@ -726,33 +726,33 @@ 78Se 1 - - mmabs/l (Ã…-2) - 1.85E13 - - - Abs xs - 0.43 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.85E13 M (amu) 78.0 + + Coh b + 8.24 + Dens (g/cm3) 0.0 - Coh b - 8.24 + Abs xs + 0.43 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -764,33 +764,33 @@ 72Ge 1 - - mmabs/l (Ã…-2) - 3.72E13 - - - Abs xs - 0.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.72E13 M (amu) 72.0 + + Coh b + 8.51 + Dens (g/cm3) 0.0 - Coh b - 8.51 + Abs xs + 0.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -802,33 +802,33 @@ 168Er 1 - - mmabs/l (Ã…-2) - 5.46E13 - - - Abs xs - 2.74 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.46E13 M (amu) 168.0 + + Coh b + 7.4 + Dens (g/cm3) 0.0 - Coh b - 7.4 + Abs xs + 2.74 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -840,33 +840,33 @@ 238Pu 1 - - mmabs/l (Ã…-2) - 7.85E15 - - - Abs xs - 558.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.85E15 M (amu) 238.0 + + Coh b + 14.1 + Dens (g/cm3) 0.0 - Coh b - 14.1 + Abs xs + 558.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -878,33 +878,33 @@ 74Se 1 - - mmabs/l (Ã…-2) - 2.34E15 - - - Abs xs - 51.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.34E15 M (amu) 74.0 + + Coh b + 0.8 + Dens (g/cm3) 0.0 - Coh b - 0.8 + Abs xs + 51.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -916,33 +916,33 @@ 139La 1 - - mmabs/l (Ã…-2) - 2.15E14 - - - Abs xs - 8.93 - Inc xs 1.13 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.15E14 M (amu) 139.0 + + Coh b + 8.24 + Dens (g/cm3) 0.0 - Coh b - 8.24 + Abs xs + 8.93 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -954,33 +954,33 @@ 164Er 1 - - mmabs/l (Ã…-2) - 2.65E14 - - - Abs xs - 13.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.65E14 M (amu) 164.0 + + Coh b + 8.2 + Dens (g/cm3) 0.0 - Coh b - 8.2 + Abs xs + 13.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -992,33 +992,33 @@ 94Zr 1 - - mmabs/l (Ã…-2) - 1.78E12 - - - Abs xs - 0.0499 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.78E12 M (amu) 94.0 + + Coh b + 8.2 + Dens (g/cm3) 0.0 - Coh b - 8.2 + Abs xs + 0.0499 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1030,33 +1030,33 @@ 198Pt 1 - - mmabs/l (Ã…-2) - 6.19E13 - - - Abs xs - 3.66 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.19E13 M (amu) 198.0 + + Coh b + 7.8 + Dens (g/cm3) 0.0 - Coh b - 7.8 + Abs xs + 3.66 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1068,33 +1068,33 @@ 157Gd 1 - - mmabs/l (Ã…-2) - 5.52E18 - - - Abs xs - 259000.0 - Inc xs 394.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.52E18 M (amu) 157.0 + + Coh b + -1.14 + Dens (g/cm3) 0.0 - Coh b - -1.14 + Abs xs + 259000.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1106,33 +1106,33 @@ 6Li 1 - - mmabs/l (Ã…-2) - 5.25E17 - - - Abs xs - 940.0 - Inc xs 0.46 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.25E17 M (amu) 6.0 + + Coh b + 2.0 + Dens (g/cm3) 0.0 - Coh b - 2.0 + Abs xs + 940.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1144,33 +1144,33 @@ 90Zr 1 - - mmabs/l (Ã…-2) - 4.09E11 - - - Abs xs - 0.011 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.09E11 M (amu) 90.0 + + Coh b + 6.4 + Dens (g/cm3) 0.0 - Coh b - 6.4 + Abs xs + 0.011 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1182,33 +1182,33 @@ Cu 1 - - mmabs/l (Ã…-2) - 1.99E14 - - - Abs xs - 3.78 - Inc xs 0.55 - Dens (at/nm3) - 84.53 + mmabs/l (Ã…-2) + 1.99E14 M (amu) 63.5406 + + Coh b + 7.718 + Dens (g/cm3) 8.92 - Coh b - 7.718 + Abs xs + 3.78 + + + Dens (at/nm3) + 84.53 mminc (Ã…-1) @@ -1220,33 +1220,33 @@ 123Te 1 - - mmabs/l (Ã…-2) - 1.14E16 - - - Abs xs - 418.0 - Inc xs 0.52 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.14E16 M (amu) 123.0 + + Coh b + -0.05 + Dens (g/cm3) 0.0 - Coh b - -0.05 + Abs xs + 418.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1258,33 +1258,33 @@ Cs 1 - - mmabs/l (Ã…-2) - 7.31E14 - - - Abs xs - 29.0 - Inc xs 0.21 - Dens (at/nm3) - 8.52 + mmabs/l (Ã…-2) + 7.31E14 M (amu) 132.905 + + Coh b + 5.42 + Dens (g/cm3) 1.88 - Coh b - 5.42 + Abs xs + 29.0 + + + Dens (at/nm3) + 8.52 mminc (Ã…-1) @@ -1296,33 +1296,33 @@ 194Pt 1 - - mmabs/l (Ã…-2) - 2.49E13 - - - Abs xs - 1.44 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.49E13 M (amu) 194.0 + + Coh b + 10.55 + Dens (g/cm3) 0.0 - Coh b - 10.55 + Abs xs + 1.44 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1334,33 +1334,33 @@ Cr 1 - - mmabs/l (Ã…-2) - 1.96E14 - - - Abs xs - 3.05 - Inc xs 1.83 - Dens (at/nm3) - 83.39 + mmabs/l (Ã…-2) + 1.96E14 M (amu) 51.996 + + Coh b + 3.635 + Dens (g/cm3) 7.2 - Coh b - 3.635 + Abs xs + 3.05 + + + Dens (at/nm3) + 83.39 mminc (Ã…-1) @@ -1372,33 +1372,33 @@ 164Dy 1 - - mmabs/l (Ã…-2) - 5.8E16 - - - Abs xs - 2840.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.8E16 M (amu) 164.0 + + Coh b + 49.4 + Dens (g/cm3) 0.0 - Coh b - 49.4 + Abs xs + 2840.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1410,33 +1410,33 @@ 64Ni 1 - - mmabs/l (Ã…-2) - 7.95E13 - - - Abs xs - 1.52 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.95E13 M (amu) 64.0 + + Coh b + -0.37 + Dens (g/cm3) 0.0 - Coh b - -0.37 + Abs xs + 1.52 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1448,33 +1448,33 @@ Co 1 - - mmabs/l (Ã…-2) - 2.11E15 - - - Abs xs - 37.18 - Inc xs 4.8 - Dens (at/nm3) - 90.94 + mmabs/l (Ã…-2) + 2.11E15 M (amu) 58.9332 + + Coh b + 2.49 + Dens (g/cm3) 8.9 - Coh b - 2.49 + Abs xs + 37.18 + + + Dens (at/nm3) + 90.94 mminc (Ã…-1) @@ -1486,33 +1486,33 @@ 66Zn 1 - - mmabs/l (Ã…-2) - 3.15E13 - - - Abs xs - 0.62 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.15E13 M (amu) 66.0 + + Coh b + 5.97 + Dens (g/cm3) 0.0 - Coh b - 5.97 + Abs xs + 0.62 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1524,33 +1524,33 @@ 96Mo 1 - - mmabs/l (Ã…-2) - 1.74E13 - - - Abs xs - 0.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.74E13 M (amu) 96.0 + + Coh b + 6.2 + Dens (g/cm3) 0.0 - Coh b - 6.2 + Abs xs + 0.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1562,33 +1562,33 @@ Cl 1 - - mmabs/l (Ã…-2) - 3.16E15 - - - Abs xs - 33.5 - Inc xs 5.3 - Dens (at/nm3) - 0.05 + mmabs/l (Ã…-2) + 3.16E15 M (amu) 35.453 + + Coh b + 9.577 + Dens (g/cm3) 0.0 - Coh b - 9.577 + Abs xs + 33.5 + + + Dens (at/nm3) + 0.05 mminc (Ã…-1) @@ -1600,33 +1600,33 @@ 178Hf 1 - - mmabs/l (Ã…-2) - 1.58E15 - - - Abs xs - 84.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.58E15 M (amu) 178.0 + + Coh b + 5.9 + Dens (g/cm3) 0.0 - Coh b - 5.9 + Abs xs + 84.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1638,33 +1638,33 @@ 190Pt 1 - - mmabs/l (Ã…-2) - 2.68E15 - - - Abs xs - 152.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.68E15 M (amu) 190.0 + + Coh b + 9.0 + Dens (g/cm3) 0.0 - Coh b - 9.0 + Abs xs + 152.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1676,33 +1676,33 @@ 160Dy 1 - - mmabs/l (Ã…-2) - 1.17E15 - - - Abs xs - 56.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.17E15 M (amu) 160.0 + + Coh b + 6.7 + Dens (g/cm3) 0.0 - Coh b - 6.7 + Abs xs + 56.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1714,33 +1714,33 @@ 60Ni 1 - - mmabs/l (Ã…-2) - 1.62E14 - - - Abs xs - 2.9 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.62E14 M (amu) 60.0 + + Coh b + 2.8 + Dens (g/cm3) 0.0 - Coh b - 2.8 + Abs xs + 2.9 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1752,33 +1752,33 @@ Ce 1 - - mmabs/l (Ã…-2) - 1.51E13 - - - Abs xs - 0.63 - Inc xs 0.001 - Dens (at/nm3) - 28.62 + mmabs/l (Ã…-2) + 1.51E13 M (amu) 140.12 + + Coh b + 4.84 + Dens (g/cm3) 6.66 - Coh b - 4.84 + Abs xs + 0.63 + + + Dens (at/nm3) + 28.62 mminc (Ã…-1) @@ -1790,33 +1790,33 @@ 206Pb 1 - - mmabs/l (Ã…-2) - 4.88E11 - - - Abs xs - 0.03 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.88E11 M (amu) 206.0 + + Coh b + 9.22 + Dens (g/cm3) 0.0 - Coh b - 9.22 + Abs xs + 0.03 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1828,33 +1828,33 @@ Cd 1 - - mmabs/l (Ã…-2) - 7.51E16 - - - Abs xs - 2520.0 - Inc xs 3.46 - Dens (at/nm3) - 46.3 + mmabs/l (Ã…-2) + 7.51E16 M (amu) 112.41 + + Coh b + 4.87 + Dens (g/cm3) 8.64 - Coh b - 4.87 + Abs xs + 2520.0 + + + Dens (at/nm3) + 46.3 mminc (Ã…-1) @@ -1866,33 +1866,33 @@ 92Mo 1 - - mmabs/l (Ã…-2) - 6.91E11 - - - Abs xs - 0.019 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.91E11 M (amu) 92.0 + + Coh b + 6.91 + Dens (g/cm3) 0.0 - Coh b - 6.91 + Abs xs + 0.019 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1904,33 +1904,33 @@ 187Re 1 - - mmabs/l (Ã…-2) - 1.37E15 - - - Abs xs - 76.4 - Inc xs 1.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.37E15 M (amu) 187.0 + + Coh b + 9.3 + Dens (g/cm3) 0.0 - Coh b - 9.3 + Abs xs + 76.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -1942,33 +1942,33 @@ Ca 1 - - mmabs/l (Ã…-2) - 3.59E13 - - - Abs xs - 0.43 - Inc xs 0.05 - Dens (at/nm3) - 23.14 + mmabs/l (Ã…-2) + 3.59E13 M (amu) 40.08 + + Coh b + 4.7 + Dens (g/cm3) 1.54 - Coh b - 4.7 + Abs xs + 0.43 + + + Dens (at/nm3) + 23.14 mminc (Ã…-1) @@ -1980,33 +1980,33 @@ 174Hf 1 - - mmabs/l (Ã…-2) - 1.08E16 - - - Abs xs - 561.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.08E16 M (amu) 174.0 + + Coh b + 10.9 + Dens (g/cm3) 0.0 - Coh b - 10.9 + Abs xs + 561.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2018,33 +2018,33 @@ 38Ar 1 - - mmabs/l (Ã…-2) - 7.05E13 - - - Abs xs - 0.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.05E13 M (amu) 38.0 + + Coh b + 3.5 + Dens (g/cm3) 0.0 - Coh b - 3.5 + Abs xs + 0.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2056,33 +2056,33 @@ 69Ga 1 - - mmabs/l (Ã…-2) - 1.06E14 - - - Abs xs - 2.18 - Inc xs 0.091 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.06E14 M (amu) 69.0 + + Coh b + 7.88 + Dens (g/cm3) 0.0 - Coh b - 7.88 + Abs xs + 2.18 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2094,33 +2094,33 @@ 111Cd 1 - - mmabs/l (Ã…-2) - 7.24E14 - - - Abs xs - 24.0 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.24E14 M (amu) 111.0 + + Coh b + 6.5 + Dens (g/cm3) 0.0 - Coh b - 6.5 + Abs xs + 24.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2132,33 +2132,33 @@ Br 1 - - mmabs/l (Ã…-2) - 2.89E14 - - - Abs xs - 6.9 - Inc xs 0.1 - Dens (at/nm3) - 0.02 + mmabs/l (Ã…-2) + 2.89E14 M (amu) 79.904 + + Coh b + 6.795 + Dens (g/cm3) 0.0 - Coh b - 6.795 + Abs xs + 6.9 + + + Dens (at/nm3) + 0.02 mminc (Ã…-1) @@ -2170,33 +2170,33 @@ 123Sb 1 - - mmabs/l (Ã…-2) - 1.03E14 - - - Abs xs - 3.8 - Inc xs 0.001 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.03E14 M (amu) 123.0 + + Coh b + 5.38 + Dens (g/cm3) 0.0 - Coh b - 5.38 + Abs xs + 3.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2208,33 +2208,33 @@ Bi 1 - - mmabs/l (Ã…-2) - 5.42E11 - - - Abs xs - 0.0338 - Inc xs 0.0084 - Dens (at/nm3) - 28.24 + mmabs/l (Ã…-2) + 5.42E11 M (amu) 208.98 + + Coh b + 8.532 + Dens (g/cm3) 9.8 - Coh b - 8.532 + Abs xs + 0.0338 + + + Dens (at/nm3) + 28.24 mminc (Ã…-1) @@ -2246,33 +2246,33 @@ 145Nd 1 - - mmabs/l (Ã…-2) - 9.7E14 - - - Abs xs - 42.0 - Inc xs 5.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.7E14 M (amu) 145.0 + + Coh b + 14.0 + Dens (g/cm3) 0.0 - Coh b - 14.0 + Abs xs + 42.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2284,33 +2284,33 @@ 190Os 1 - - mmabs/l (Ã…-2) - 2.31E14 - - - Abs xs - 13.1 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.31E14 M (amu) 190.0 + + Coh b + 11.0 + Dens (g/cm3) 0.0 - Coh b - 11.0 + Abs xs + 13.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2322,33 +2322,33 @@ Be 1 - - mmabs/l (Ã…-2) - 2.82E12 - - - Abs xs - 0.0076 - Inc xs 0.0018 - Dens (at/nm3) - 123.62 + mmabs/l (Ã…-2) + 2.82E12 M (amu) 9.0122 + + Coh b + 7.79 + Dens (g/cm3) 1.85 - Coh b - 7.79 + Abs xs + 0.0076 + + + Dens (at/nm3) + 123.62 mminc (Ã…-1) @@ -2360,33 +2360,33 @@ 153Eu 1 - - mmabs/l (Ã…-2) - 6.83E15 - - - Abs xs - 312.0 - Inc xs 1.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.83E15 M (amu) 153.0 + + Coh b + 8.22 + Dens (g/cm3) 0.0 - Coh b - 8.22 + Abs xs + 312.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2398,33 +2398,33 @@ Ba 1 - - mmabs/l (Ã…-2) - 2.68E13 - - - Abs xs - 1.1 - Inc xs 0.15 - Dens (at/nm3) - 15.35 + mmabs/l (Ã…-2) + 2.68E13 M (amu) 137.33 + + Coh b + 5.07 + Dens (g/cm3) 3.5 - Coh b - 5.07 + Abs xs + 1.1 + + + Dens (at/nm3) + 15.35 mminc (Ã…-1) @@ -2436,33 +2436,33 @@ Zr 1 - - mmabs/l (Ã…-2) - 6.79E12 - - - Abs xs - 0.185 - Inc xs 0.02 - Dens (at/nm3) - 42.85 + mmabs/l (Ã…-2) + 6.79E12 M (amu) 91.22 + + Coh b + 7.16 + Dens (g/cm3) 6.49 - Coh b - 7.16 + Abs xs + 0.185 + + + Dens (at/nm3) + 42.85 mminc (Ã…-1) @@ -2474,33 +2474,33 @@ Zn 1 - - mmabs/l (Ã…-2) - 5.68E13 - - - Abs xs - 1.11 - Inc xs 0.077 - Dens (at/nm3) - 65.77 + mmabs/l (Ã…-2) + 5.68E13 M (amu) 65.38 + + Coh b + 5.68 + Dens (g/cm3) 7.14 - Coh b - 5.68 + Abs xs + 1.11 + + + Dens (at/nm3) + 65.77 mminc (Ã…-1) @@ -2512,33 +2512,33 @@ 199Hg 1 - - mmabs/l (Ã…-2) - 3.62E16 - - - Abs xs - 2150.0 - Inc xs 30.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.62E16 M (amu) 199.0 + + Coh b + 16.9 + Dens (g/cm3) 0.0 - Coh b - 16.9 + Abs xs + 2150.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2550,33 +2550,33 @@ Au 1 - - mmabs/l (Ã…-2) - 1.68E15 - - - Abs xs - 98.65 - Inc xs 0.43 - Dens (at/nm3) - 57.72 + mmabs/l (Ã…-2) + 1.68E15 M (amu) 196.97 + + Coh b + 7.63 + Dens (g/cm3) 18.88 - Coh b - 7.63 + Abs xs + 98.65 + + + Dens (at/nm3) + 57.72 mminc (Ã…-1) @@ -2588,33 +2588,33 @@ As 1 - - mmabs/l (Ã…-2) - 2.01E14 - - - Abs xs - 4.5 - Inc xs 0.06 - Dens (at/nm3) - 46.03 + mmabs/l (Ã…-2) + 2.01E14 M (amu) 74.9216 + + Coh b + 6.58 + Dens (g/cm3) 5.73 - Coh b - 6.58 + Abs xs + 4.5 + + + Dens (at/nm3) + 46.03 mminc (Ã…-1) @@ -2626,33 +2626,33 @@ 148Sm 1 - - mmabs/l (Ã…-2) - 5.43E13 - - - Abs xs - 2.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.43E13 M (amu) 148.0 + + Coh b + -3.0 + Dens (g/cm3) 0.0 - Coh b - -3.0 + Abs xs + 2.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2664,33 +2664,33 @@ Ar 1 - - mmabs/l (Ã…-2) - 5.66E13 - - - Abs xs - 0.675 - Inc xs 0.225 - Dens (at/nm3) - 0.03 + mmabs/l (Ã…-2) + 5.66E13 M (amu) 39.948 + + Coh b + 1.909 + Dens (g/cm3) 0.0 - Coh b - 1.909 + Abs xs + 0.675 + + + Dens (at/nm3) + 0.03 mminc (Ã…-1) @@ -2702,33 +2702,33 @@ 106Pd 1 - - mmabs/l (Ã…-2) - 9.6E12 - - - Abs xs - 0.304 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.6E12 M (amu) 106.0 + + Coh b + 6.4 + Dens (g/cm3) 0.0 - Coh b - 6.4 + Abs xs + 0.304 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2740,33 +2740,33 @@ 136Ce 1 - - mmabs/l (Ã…-2) - 1.8E14 - - - Abs xs - 7.3 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.8E14 M (amu) 136.0 + + Coh b + 5.8 + Dens (g/cm3) 0.0 - Coh b - 5.8 + Abs xs + 7.3 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2778,33 +2778,33 @@ Am 1 - - mmabs/l (Ã…-2) - 1.04E15 - - - Abs xs - 75.3 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.04E15 M (amu) 243.0 + + Coh b + 8.3 + Dens (g/cm3) 0.0 - Coh b - 8.3 + Abs xs + 75.3 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2816,33 +2816,33 @@ Al 1 - - mmabs/l (Ã…-2) - 2.87E13 - - - Abs xs - 0.231 - Inc xs 0.0082 - Dens (at/nm3) - 60.31 + mmabs/l (Ã…-2) + 2.87E13 M (amu) 26.9815 + + Coh b + 3.449 + Dens (g/cm3) 2.7 - Coh b - 3.449 + Abs xs + 0.231 + + + Dens (at/nm3) + 60.31 mminc (Ã…-1) @@ -2854,33 +2854,33 @@ 144Sm 1 - - mmabs/l (Ã…-2) - 1.63E13 - - - Abs xs - 0.7 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.63E13 M (amu) 144.0 + + Coh b + -3.0 + Dens (g/cm3) 0.0 - Coh b - -3.0 + Abs xs + 0.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2892,33 +2892,33 @@ Ag 1 - - mmabs/l (Ã…-2) - 1.96E15 - - - Abs xs - 63.3 - Inc xs 0.58 - Dens (at/nm3) - 58.62 + mmabs/l (Ã…-2) + 1.96E15 M (amu) 107.868 + + Coh b + 5.922 + Dens (g/cm3) 10.5 - Coh b - 5.922 + Abs xs + 63.3 + + + Dens (at/nm3) + 58.62 mminc (Ã…-1) @@ -2930,33 +2930,33 @@ 102Pd 1 - - mmabs/l (Ã…-2) - 1.12E14 - - - Abs xs - 3.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.12E14 M (amu) 102.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 3.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -2968,33 +2968,33 @@ 205Tl 1 - - mmabs/l (Ã…-2) - 1.7E12 - - - Abs xs - 0.104 - Inc xs 0.007 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.7E12 M (amu) 205.0 + + Coh b + 9.52 + Dens (g/cm3) 0.0 - Coh b - 9.52 + Abs xs + 0.104 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3006,33 +3006,33 @@ 88Sr 1 - - mmabs/l (Ã…-2) - 2.21E12 - - - Abs xs - 0.058 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.21E12 M (amu) 88.0 + + Coh b + 7.15 + Dens (g/cm3) 0.0 - Coh b - 7.15 + Abs xs + 0.058 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3044,33 +3044,33 @@ 18O 1 - - mmabs/l (Ã…-2) - 2.98E10 - - - Abs xs - 1.6E-4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.98E10 M (amu) 18.0 + + Coh b + 5.84 + Dens (g/cm3) 0.0 - Coh b - 5.84 + Abs xs + 1.6E-4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3082,33 +3082,33 @@ 171Yb 1 - - mmabs/l (Ã…-2) - 9.52E14 - - - Abs xs - 48.6 - Inc xs 3.9 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.52E14 M (amu) 171.0 + + Coh b + 9.66 + Dens (g/cm3) 0.0 - Coh b - 9.66 + Abs xs + 48.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3120,33 +3120,33 @@ 108Cd 1 - - mmabs/l (Ã…-2) - 3.41E13 - - - Abs xs - 1.1 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.41E13 M (amu) 108.0 + + Coh b + 5.4 + Dens (g/cm3) 0.0 - Coh b - 5.4 + Abs xs + 1.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3158,33 +3158,33 @@ 84Sr 1 - - mmabs/l (Ã…-2) - 3.47E13 - - - Abs xs - 0.87 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.47E13 M (amu) 84.0 + + Coh b + 7.0 + Dens (g/cm3) 0.0 - Coh b - 7.0 + Abs xs + 0.87 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3196,33 +3196,33 @@ 116Sn 1 - - mmabs/l (Ã…-2) - 4.04E12 - - - Abs xs - 0.14 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.04E12 M (amu) 116.0 + + Coh b + 5.93 + Dens (g/cm3) 0.0 - Coh b - 5.93 + Abs xs + 0.14 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3234,33 +3234,33 @@ 112Sn 1 - - mmabs/l (Ã…-2) - 2.99E13 - - - Abs xs - 1.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.99E13 M (amu) 112.0 + + Coh b + 6.0 + Dens (g/cm3) 0.0 - Coh b - 6.0 + Abs xs + 1.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3272,33 +3272,33 @@ 187Os 1 - - mmabs/l (Ã…-2) - 5.73E15 - - - Abs xs - 320.0 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.73E15 M (amu) 187.0 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 320.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3310,33 +3310,33 @@ 48Ca 1 - - mmabs/l (Ã…-2) - 7.6E13 - - - Abs xs - 1.09 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.6E13 M (amu) 48.0 + + Coh b + 0.39 + Dens (g/cm3) 0.0 - Coh b - 0.39 + Abs xs + 1.09 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3348,33 +3348,33 @@ 136Ba 1 - - mmabs/l (Ã…-2) - 1.67E13 - - - Abs xs - 0.68 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.67E13 M (amu) 136.0 + + Coh b + 4.91 + Dens (g/cm3) 0.0 - Coh b - 4.91 + Abs xs + 0.68 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3386,33 +3386,33 @@ Yb 1 - - mmabs/l (Ã…-2) - 6.73E14 - - - Abs xs - 34.8 - Inc xs 4.0 - Dens (at/nm3) - 24.24 + mmabs/l (Ã…-2) + 6.73E14 M (amu) 173.04 + + Coh b + 12.43 + Dens (g/cm3) 6.97 - Coh b - 12.43 + Abs xs + 34.8 + + + Dens (at/nm3) + 24.24 mminc (Ã…-1) @@ -3424,33 +3424,33 @@ 21Ne 1 - - mmabs/l (Ã…-2) - 1.07E14 - - - Abs xs - 0.67 - Inc xs 0.05 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.07E14 M (amu) 21.0 + + Coh b + 6.66 + Dens (g/cm3) 0.0 - Coh b - 6.66 + Abs xs + 0.67 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3462,33 +3462,33 @@ 80Se 1 - - mmabs/l (Ã…-2) - 2.55E13 - - - Abs xs - 0.61 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.55E13 M (amu) 80.0 + + Coh b + 7.48 + Dens (g/cm3) 0.0 - Coh b - 7.48 + Abs xs + 0.61 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3500,33 +3500,33 @@ 17O 1 - - mmabs/l (Ã…-2) - 4.65E13 - - - Abs xs - 0.236 - Inc xs 0.004 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.65E13 M (amu) 17.0 + + Coh b + 5.78 + Dens (g/cm3) 0.0 - Coh b - 5.78 + Abs xs + 0.236 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3538,33 +3538,33 @@ 170Er 1 - - mmabs/l (Ã…-2) - 1.14E14 - - - Abs xs - 5.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.14E14 M (amu) 170.0 + + Coh b + 9.6 + Dens (g/cm3) 0.0 - Coh b - 9.6 + Abs xs + 5.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3576,33 +3576,33 @@ 44Ca 1 - - mmabs/l (Ã…-2) - 6.7E13 - - - Abs xs - 0.88 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.7E13 M (amu) 44.0 + + Coh b + 1.42 + Dens (g/cm3) 0.0 - Coh b - 1.42 + Abs xs + 0.88 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3614,33 +3614,33 @@ 132Ba 1 - - mmabs/l (Ã…-2) - 1.78E14 - - - Abs xs - 7.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.78E14 M (amu) 132.0 + + Coh b + 7.8 + Dens (g/cm3) 0.0 - Coh b - 7.8 + Abs xs + 7.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3652,33 +3652,33 @@ 240Pu 1 - - mmabs/l (Ã…-2) - 4.04E15 - - - Abs xs - 289.6 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.04E15 M (amu) 240.0 + + Coh b + 3.5 + Dens (g/cm3) 0.0 - Coh b - 3.5 + Abs xs + 289.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3690,33 +3690,33 @@ 40Ca 1 - - mmabs/l (Ã…-2) - 3.43E13 - - - Abs xs - 0.41 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.43E13 M (amu) 40.0 + + Coh b + 4.8 + Dens (g/cm3) 0.0 - Coh b - 4.8 + Abs xs + 0.41 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3728,33 +3728,33 @@ 28Si 1 - - mmabs/l (Ã…-2) - 2.12E13 - - - Abs xs - 0.177 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.12E13 M (amu) 28.0 + + Coh b + 4.107 + Dens (g/cm3) 0.0 - Coh b - 4.107 + Abs xs + 0.177 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3766,33 +3766,33 @@ 25Mg 1 - - mmabs/l (Ã…-2) - 2.54E13 - - - Abs xs - 0.19 - Inc xs 0.28 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.54E13 M (amu) 25.0 + + Coh b + 3.62 + Dens (g/cm3) 0.0 - Coh b - 3.62 + Abs xs + 0.19 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3804,33 +3804,33 @@ 58Fe 1 - - mmabs/l (Ã…-2) - 7.39E13 - - - Abs xs - 1.28 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.39E13 M (amu) 58.0 + + Coh b + 15.0 + Dens (g/cm3) 0.0 - Coh b - 15.0 + Abs xs + 1.28 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3842,33 +3842,33 @@ 246Cm 1 - - mmabs/l (Ã…-2) - 1.85E13 - - - Abs xs - 1.36 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.85E13 M (amu) 246.0 + + Coh b + 9.3 + Dens (g/cm3) 0.0 - Coh b - 9.3 + Abs xs + 1.36 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3880,33 +3880,33 @@ Xe 1 - - mmabs/l (Ã…-2) - 6.09E14 - - - Abs xs - 23.9 - Inc xs 0.0 - Dens (at/nm3) - 0.03 + mmabs/l (Ã…-2) + 6.09E14 M (amu) 131.3 + + Coh b + 4.92 + Dens (g/cm3) 0.01 - Coh b - 4.92 + Abs xs + 23.9 + + + Dens (at/nm3) + 0.03 mminc (Ã…-1) @@ -3918,33 +3918,33 @@ 168Yb 1 - - mmabs/l (Ã…-2) - 4.44E16 - - - Abs xs - 2230.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.44E16 M (amu) 168.0 + + Coh b + -4.07 + Dens (g/cm3) 0.0 - Coh b - -4.07 + Abs xs + 2230.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3956,33 +3956,33 @@ 54Fe 1 - - mmabs/l (Ã…-2) - 1.4E14 - - - Abs xs - 2.25 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.4E14 M (amu) 54.0 + + Coh b + 4.2 + Dens (g/cm3) 0.0 - Coh b - 4.2 + Abs xs + 2.25 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -3994,33 +3994,33 @@ 16O 1 - - mmabs/l (Ã…-2) - 2.09E10 - - - Abs xs - 1.0E-4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.09E10 M (amu) 16.0 + + Coh b + 5.803 + Dens (g/cm3) 0.0 - Coh b - 5.803 + Abs xs + 1.0E-4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4032,33 +4032,33 @@ 49Ti 1 - - mmabs/l (Ã…-2) - 1.5E14 - - - Abs xs - 2.2 - Inc xs 3.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.5E14 M (amu) 49.0 + + Coh b + 1.04 + Dens (g/cm3) 0.0 - Coh b - 1.04 + Abs xs + 2.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4070,33 +4070,33 @@ 65Cu 1 - - mmabs/l (Ã…-2) - 1.12E14 - - - Abs xs - 2.17 - Inc xs 0.4 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.12E14 M (amu) 65.0 + + Coh b + 10.61 + Dens (g/cm3) 0.0 - Coh b - 10.61 + Abs xs + 2.17 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4108,33 +4108,33 @@ 186W 1 - - mmabs/l (Ã…-2) - 6.82E14 - - - Abs xs - 37.9 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.82E14 M (amu) 186.0 + + Coh b + -0.72 + Dens (g/cm3) 0.0 - Coh b - -0.72 + Abs xs + 37.9 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4146,33 +4146,33 @@ 180Hf 1 - - mmabs/l (Ã…-2) - 2.43E14 - - - Abs xs - 13.04 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.43E14 M (amu) 180.0 + + Coh b + 13.2 + Dens (g/cm3) 0.0 - Coh b - 13.2 + Abs xs + 13.04 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4184,33 +4184,33 @@ 77Se 1 - - mmabs/l (Ã…-2) - 1.83E15 - - - Abs xs - 42.0 - Inc xs 0.05 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.83E15 M (amu) 77.0 + + Coh b + 8.25 + Dens (g/cm3) 0.0 - Coh b - 8.25 + Abs xs + 42.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4222,33 +4222,33 @@ 37Cl 1 - - mmabs/l (Ã…-2) - 3.92E13 - - - Abs xs - 0.433 - Inc xs 0.001 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.92E13 M (amu) 37.0 + + Coh b + 3.08 + Dens (g/cm3) 0.0 - Coh b - 3.08 + Abs xs + 0.433 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4260,33 +4260,33 @@ 167Er 1 - - mmabs/l (Ã…-2) - 1.32E16 - - - Abs xs - 659.0 - Inc xs 0.13 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.32E16 M (amu) 167.0 + + Coh b + 3.0 + Dens (g/cm3) 0.0 - Coh b - 3.0 + Abs xs + 659.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4298,33 +4298,33 @@ 40Ar 1 - - mmabs/l (Ã…-2) - 5.52E13 - - - Abs xs - 0.66 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.52E13 M (amu) 40.0 + + Coh b + 1.83 + Dens (g/cm3) 0.0 - Coh b - 1.83 + Abs xs + 0.66 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4336,33 +4336,33 @@ 71Ga 1 - - mmabs/l (Ã…-2) - 1.7E14 - - - Abs xs - 3.61 - Inc xs 0.084 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.7E14 M (amu) 71.0 + + Coh b + 6.4 + Dens (g/cm3) 0.0 - Coh b - 6.4 + Abs xs + 3.61 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4374,33 +4374,33 @@ 15N 1 - - mmabs/l (Ã…-2) - 5.36E9 - - - Abs xs - 2.4E-5 - Inc xs 5.0E-5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.36E9 M (amu) 15.0 + + Coh b + 6.44 + Dens (g/cm3) 0.0 - Coh b - 6.44 + Abs xs + 2.4E-5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4412,33 +4412,33 @@ 138La 1 - - mmabs/l (Ã…-2) - 1.38E15 - - - Abs xs - 57.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.38E15 M (amu) 138.0 + + Coh b + 8.0 + Dens (g/cm3) 0.0 - Coh b - 8.0 + Abs xs + 57.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4450,33 +4450,33 @@ 126Te 1 - - mmabs/l (Ã…-2) - 2.76E13 - - - Abs xs - 1.04 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.76E13 M (amu) 126.0 + + Coh b + 5.56 + Dens (g/cm3) 0.0 - Coh b - 5.56 + Abs xs + 1.04 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4488,33 +4488,33 @@ 156Gd 1 - - mmabs/l (Ã…-2) - 3.22E13 - - - Abs xs - 1.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.22E13 M (amu) 156.0 + + Coh b + 6.3 + Dens (g/cm3) 0.0 - Coh b - 6.3 + Abs xs + 1.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4526,33 +4526,33 @@ 122Te 1 - - mmabs/l (Ã…-2) - 9.33E13 - - - Abs xs - 3.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.33E13 M (amu) 122.0 + + Coh b + 3.8 + Dens (g/cm3) 0.0 - Coh b - 3.8 + Abs xs + 3.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4564,33 +4564,33 @@ 154Sm 1 - - mmabs/l (Ã…-2) - 1.83E14 - - - Abs xs - 8.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.83E14 M (amu) 154.0 + + Coh b + 9.3 + Dens (g/cm3) 0.0 - Coh b - 9.3 + Abs xs + 8.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4602,33 +4602,33 @@ 152Gd 1 - - mmabs/l (Ã…-2) - 1.62E16 - - - Abs xs - 735.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.62E16 M (amu) 152.0 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 735.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4640,33 +4640,33 @@ 163Dy 1 - - mmabs/l (Ã…-2) - 2.55E15 - - - Abs xs - 124.0 - Inc xs 0.21 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.55E15 M (amu) 163.0 + + Coh b + 5.0 + Dens (g/cm3) 0.0 - Coh b - 5.0 + Abs xs + 124.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4678,33 +4678,33 @@ 142Ce 1 - - mmabs/l (Ã…-2) - 2.24E13 - - - Abs xs - 0.95 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.24E13 M (amu) 142.0 + + Coh b + 4.75 + Dens (g/cm3) 0.0 - Coh b - 4.75 + Abs xs + 0.95 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4716,33 +4716,33 @@ 14N 1 - - mmabs/l (Ã…-2) - 4.57E14 - - - Abs xs - 1.91 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.57E14 M (amu) 14.0 + + Coh b + 9.37 + Dens (g/cm3) 0.0 - Coh b - 9.37 + Abs xs + 1.91 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4754,33 +4754,33 @@ 95Mo 1 - - mmabs/l (Ã…-2) - 4.62E14 - - - Abs xs - 13.1 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.62E14 M (amu) 95.0 + + Coh b + 6.91 + Dens (g/cm3) 0.0 - Coh b - 6.91 + Abs xs + 13.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4792,33 +4792,33 @@ 150Sm 1 - - mmabs/l (Ã…-2) - 2.32E15 - - - Abs xs - 104.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.32E15 M (amu) 150.0 + + Coh b + 14.0 + Dens (g/cm3) 0.0 - Coh b - 14.0 + Abs xs + 104.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4830,33 +4830,33 @@ 177Hf 1 - - mmabs/l (Ã…-2) - 7.06E15 - - - Abs xs - 373.0 - Inc xs 0.1 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.06E15 M (amu) 177.0 + + Coh b + 0.8 + Dens (g/cm3) 0.0 - Coh b - 0.8 + Abs xs + 373.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4868,33 +4868,33 @@ 184W 1 - - mmabs/l (Ã…-2) - 3.09E13 - - - Abs xs - 1.7 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.09E13 M (amu) 184.0 + + Coh b + 7.48 + Dens (g/cm3) 0.0 - Coh b - 7.48 + Abs xs + 1.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4906,33 +4906,33 @@ 113In 1 - - mmabs/l (Ã…-2) - 3.56E14 - - - Abs xs - 12.0 - Inc xs 3.7E-5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.56E14 M (amu) 113.0 + + Coh b + 5.39 + Dens (g/cm3) 0.0 - Coh b - 5.39 + Abs xs + 12.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4944,33 +4944,33 @@ 114Cd 1 - - mmabs/l (Ã…-2) - 9.99E12 - - - Abs xs - 0.34 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.99E12 M (amu) 114.0 + + Coh b + 7.5 + Dens (g/cm3) 0.0 - Coh b - 7.5 + Abs xs + 0.34 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -4982,33 +4982,33 @@ 54Cr 1 - - mmabs/l (Ã…-2) - 2.23E13 - - - Abs xs - 0.36 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.23E13 M (amu) 54.0 + + Coh b + 4.55 + Dens (g/cm3) 0.0 - Coh b - 4.55 + Abs xs + 0.36 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5020,33 +5020,33 @@ 122Sn 1 - - mmabs/l (Ã…-2) - 4.94E12 - - - Abs xs - 0.18 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.94E12 M (amu) 122.0 + + Coh b + 5.74 + Dens (g/cm3) 0.0 - Coh b - 5.74 + Abs xs + 0.18 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5058,33 +5058,33 @@ 110Cd 1 - - mmabs/l (Ã…-2) - 3.35E14 - - - Abs xs - 11.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.35E14 M (amu) 110.0 + + Coh b + 5.9 + Dens (g/cm3) 0.0 - Coh b - 5.9 + Abs xs + 11.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5096,33 +5096,33 @@ 50Cr 1 - - mmabs/l (Ã…-2) - 1.06E15 - - - Abs xs - 15.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.06E15 M (amu) 50.0 + + Coh b + -4.5 + Dens (g/cm3) 0.0 - Coh b - -4.5 + Abs xs + 15.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5134,33 +5134,33 @@ 148Nd 1 - - mmabs/l (Ã…-2) - 5.66E13 - - - Abs xs - 2.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.66E13 M (amu) 148.0 + + Coh b + 5.7 + Dens (g/cm3) 0.0 - Coh b - 5.7 + Abs xs + 2.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5172,33 +5172,33 @@ 144Nd 1 - - mmabs/l (Ã…-2) - 8.37E13 - - - Abs xs - 3.6 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.37E13 M (amu) 144.0 + + Coh b + 2.8 + Dens (g/cm3) 0.0 - Coh b - 2.8 + Abs xs + 3.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5210,33 +5210,33 @@ 183W 1 - - mmabs/l (Ã…-2) - 1.85E14 - - - Abs xs - 10.1 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.85E14 M (amu) 183.0 + + Coh b + 6.53 + Dens (g/cm3) 0.0 - Coh b - 6.53 + Abs xs + 10.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5248,33 +5248,33 @@ 13C 1 - - mmabs/l (Ã…-2) - 3.53E11 - - - Abs xs - 0.00137 - Inc xs 0.034 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.53E11 M (amu) 13.0 + + Coh b + 6.19 + Dens (g/cm3) 0.0 - Coh b - 6.19 + Abs xs + 0.00137 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5286,33 +5286,33 @@ Tm 1 - - mmabs/l (Ã…-2) - 1.98E15 - - - Abs xs - 100.0 - Inc xs 0.1 - Dens (at/nm3) - 33.22 + mmabs/l (Ã…-2) + 1.98E15 M (amu) 168.934 + + Coh b + 7.07 + Dens (g/cm3) 9.32 - Coh b - 7.07 + Abs xs + 100.0 + + + Dens (at/nm3) + 33.22 mminc (Ã…-1) @@ -5324,33 +5324,33 @@ Tl 1 - - mmabs/l (Ã…-2) - 5.62E13 - - - Abs xs - 3.43 - Inc xs 0.21 - Dens (at/nm3) - 34.92 + mmabs/l (Ã…-2) + 5.62E13 M (amu) 204.37 + + Coh b + 8.776 + Dens (g/cm3) 11.85 - Coh b - 8.776 + Abs xs + 3.43 + + + Dens (at/nm3) + 34.92 mminc (Ã…-1) @@ -5362,33 +5362,33 @@ Ti 1 - - mmabs/l (Ã…-2) - 4.26E14 - - - Abs xs - 6.09 - Inc xs 2.87 - Dens (at/nm3) - 56.57 + mmabs/l (Ã…-2) + 4.26E14 M (amu) 47.9 + + Coh b + -3.438 + Dens (g/cm3) 4.5 - Coh b - -3.438 + Abs xs + 6.09 + + + Dens (at/nm3) + 56.57 mminc (Ã…-1) @@ -5400,33 +5400,33 @@ Th 1 - - mmabs/l (Ã…-2) - 1.06E14 - - - Abs xs - 7.37 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.06E14 M (amu) 232.0381 + + Coh b + 10.31 + Dens (g/cm3) 0.0 - Coh b - 10.31 + Abs xs + 7.37 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5438,33 +5438,33 @@ Te 1 - - mmabs/l (Ã…-2) - 1.23E14 - - - Abs xs - 4.7 - Inc xs 0.09 - Dens (at/nm3) - 28.32 + mmabs/l (Ã…-2) + 1.23E14 M (amu) 127.6 + + Coh b + 5.8 + Dens (g/cm3) 6.0 - Coh b - 5.8 + Abs xs + 4.7 + + + Dens (at/nm3) + 28.32 mminc (Ã…-1) @@ -5476,33 +5476,33 @@ Tc 1 - - mmabs/l (Ã…-2) - 6.83E14 - - - Abs xs - 20.0 - Inc xs 0.5 - Dens (at/nm3) - 70.67 + mmabs/l (Ã…-2) + 6.83E14 M (amu) 98.0 + + Coh b + 6.8 + Dens (g/cm3) 11.5 - Coh b - 6.8 + Abs xs + 20.0 + + + Dens (at/nm3) + 70.67 mminc (Ã…-1) @@ -5514,33 +5514,33 @@ Tb 1 - - mmabs/l (Ã…-2) - 4.93E14 - - - Abs xs - 23.4 - Inc xs 0.004 - Dens (at/nm3) - 31.18 + mmabs/l (Ã…-2) + 4.93E14 M (amu) 158.924 + + Coh b + 7.38 + Dens (g/cm3) 8.23 - Coh b - 7.38 + Abs xs + 23.4 + + + Dens (at/nm3) + 31.18 mminc (Ã…-1) @@ -5552,33 +5552,33 @@ 147Sm 1 - - mmabs/l (Ã…-2) - 1.3E15 - - - Abs xs - 57.0 - Inc xs 143.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.3E15 M (amu) 147.0 + + Coh b + 14.0 + Dens (g/cm3) 0.0 - Coh b - 14.0 + Abs xs + 57.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5590,33 +5590,33 @@ Ta 1 - - mmabs/l (Ã…-2) - 3.81E14 - - - Abs xs - 20.6 - Inc xs 0.01 - Dens (at/nm3) - 55.25 + mmabs/l (Ã…-2) + 3.81E14 M (amu) 180.948 + + Coh b + 6.91 + Dens (g/cm3) 16.6 - Coh b - 6.91 + Abs xs + 20.6 + + + Dens (at/nm3) + 55.25 mminc (Ã…-1) @@ -5628,33 +5628,33 @@ 105Pd 1 - - mmabs/l (Ã…-2) - 6.38E14 - - - Abs xs - 20.0 - Inc xs 0.8 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.38E14 M (amu) 105.0 + + Coh b + 5.5 + Dens (g/cm3) 0.0 - Coh b - 5.5 + Abs xs + 20.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5666,33 +5666,33 @@ 30Si 1 - - mmabs/l (Ã…-2) - 1.19E13 - - - Abs xs - 0.107 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.19E13 M (amu) 30.0 + + Coh b + 4.58 + Dens (g/cm3) 0.0 - Coh b - 4.58 + Abs xs + 0.107 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5704,33 +5704,33 @@ 156Dy 1 - - mmabs/l (Ã…-2) - 7.08E14 - - - Abs xs - 33.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.08E14 M (amu) 156.0 + + Coh b + 6.1 + Dens (g/cm3) 0.0 - Coh b - 6.1 + Abs xs + 33.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5742,33 +5742,33 @@ 176Lu 1 - - mmabs/l (Ã…-2) - 3.93E16 - - - Abs xs - 2065.0 - Inc xs 1.2 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.93E16 M (amu) 176.0 + + Coh b + 6.1 + Dens (g/cm3) 0.0 - Coh b - 6.1 + Abs xs + 2065.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5780,33 +5780,33 @@ 174Yb 1 - - mmabs/l (Ã…-2) - 1.34E15 - - - Abs xs - 69.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.34E15 M (amu) 174.0 + + Coh b + 19.3 + Dens (g/cm3) 0.0 - Coh b - 19.3 + Abs xs + 69.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5818,33 +5818,33 @@ 119Sn 1 - - mmabs/l (Ã…-2) - 6.19E13 - - - Abs xs - 2.2 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.19E13 M (amu) 119.0 + + Coh b + 6.12 + Dens (g/cm3) 0.0 - Coh b - 6.12 + Abs xs + 2.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5856,33 +5856,33 @@ 87Sr 1 - - mmabs/l (Ã…-2) - 6.16E14 - - - Abs xs - 16.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.16E14 M (amu) 87.0 + + Coh b + 7.4 + Dens (g/cm3) 0.0 - Coh b - 7.4 + Abs xs + 16.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5894,33 +5894,33 @@ 182W 1 - - mmabs/l (Ã…-2) - 3.81E14 - - - Abs xs - 20.7 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.81E14 M (amu) 182.0 + + Coh b + 6.97 + Dens (g/cm3) 0.0 - Coh b - 6.97 + Abs xs + 20.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -5932,33 +5932,33 @@ Sr 1 - - mmabs/l (Ã…-2) - 4.89E13 - - - Abs xs - 1.28 - Inc xs 0.06 - Dens (at/nm3) - 17.87 + mmabs/l (Ã…-2) + 4.89E13 M (amu) 87.62 + + Coh b + 7.02 + Dens (g/cm3) 2.6 - Coh b - 7.02 + Abs xs + 1.28 + + + Dens (at/nm3) + 17.87 mminc (Ã…-1) @@ -5970,33 +5970,33 @@ 170Yb 1 - - mmabs/l (Ã…-2) - 2.25E14 - - - Abs xs - 11.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.25E14 M (amu) 170.0 + + Coh b + 6.77 + Dens (g/cm3) 0.0 - Coh b - 6.77 + Abs xs + 11.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6008,33 +6008,33 @@ 12C 1 - - mmabs/l (Ã…-2) - 9.85E11 - - - Abs xs - 0.00353 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.85E11 M (amu) 12.0 + + Coh b + 6.6511 + Dens (g/cm3) 0.0 - Coh b - 6.6511 + Abs xs + 0.00353 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6046,33 +6046,33 @@ Sn 1 - - mmabs/l (Ã…-2) - 1.77E13 - - - Abs xs - 0.626 - Inc xs 0.022 - Dens (at/nm3) - 36.94 + mmabs/l (Ã…-2) + 1.77E13 M (amu) 118.69 + + Coh b + 6.225 + Dens (g/cm3) 7.28 - Coh b - 6.225 + Abs xs + 0.626 + + + Dens (at/nm3) + 36.94 mminc (Ã…-1) @@ -6084,33 +6084,33 @@ 51V 1 - - mmabs/l (Ã…-2) - 3.22E14 - - - Abs xs - 4.9 - Inc xs 5.07 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.22E14 M (amu) 51.0 + + Coh b + -0.402 + Dens (g/cm3) 0.0 - Coh b - -0.402 + Abs xs + 4.9 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6122,33 +6122,33 @@ Sm 1 - - mmabs/l (Ã…-2) - 1.32E17 - - - Abs xs - 5922.0 - Inc xs 39.0 - Dens (at/nm3) - 30.12 + mmabs/l (Ã…-2) + 1.32E17 M (amu) 150.35 + + Coh b + 0.8 + Dens (g/cm3) 7.52 - Coh b - 0.8 + Abs xs + 5922.0 + + + Dens (at/nm3) + 30.12 mminc (Ã…-1) @@ -6160,33 +6160,33 @@ 115Sn 1 - - mmabs/l (Ã…-2) - 8.73E14 - - - Abs xs - 30.0 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.73E14 M (amu) 115.0 + + Coh b + 6.0 + Dens (g/cm3) 0.0 - Coh b - 6.0 + Abs xs + 30.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6198,33 +6198,33 @@ Si 1 - - mmabs/l (Ã…-2) - 2.04E13 - - - Abs xs - 0.171 - Inc xs 0.004 - Dens (at/nm3) - 49.96 + mmabs/l (Ã…-2) + 2.04E13 M (amu) 28.0855 + + Coh b + 4.1491 + Dens (g/cm3) 2.33 - Coh b - 4.1491 + Abs xs + 0.171 + + + Dens (at/nm3) + 49.96 mminc (Ã…-1) @@ -6236,33 +6236,33 @@ Se 1 - - mmabs/l (Ã…-2) - 4.96E14 - - - Abs xs - 11.7 - Inc xs 0.32 - Dens (at/nm3) - 36.68 + mmabs/l (Ã…-2) + 4.96E14 M (amu) 78.96 + + Coh b + 7.97 + Dens (g/cm3) 4.81 - Coh b - 7.97 + Abs xs + 11.7 + + + Dens (at/nm3) + 36.68 mminc (Ã…-1) @@ -6274,33 +6274,33 @@ 79Br 1 - - mmabs/l (Ã…-2) - 4.66E14 - - - Abs xs - 11.0 - Inc xs 0.15 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.66E14 M (amu) 79.0 + + Coh b + 6.8 + Dens (g/cm3) 0.0 - Coh b - 6.8 + Abs xs + 11.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6312,33 +6312,33 @@ Sc 1 - - mmabs/l (Ã…-2) - 2.05E15 - - - Abs xs - 27.5 - Inc xs 4.5 - Dens (at/nm3) - 40.04 + mmabs/l (Ã…-2) + 2.05E15 M (amu) 44.9559 + + Coh b + 12.29 + Dens (g/cm3) 2.99 - Coh b - 12.29 + Abs xs + 27.5 + + + Dens (at/nm3) + 40.04 mminc (Ã…-1) @@ -6350,33 +6350,33 @@ Sb 1 - - mmabs/l (Ã…-2) - 1.35E14 - - - Abs xs - 4.91 - Inc xs 0.007 - Dens (at/nm3) - 33.06 + mmabs/l (Ã…-2) + 1.35E14 M (amu) 121.75 + + Coh b + 5.57 + Dens (g/cm3) 6.68 - Coh b - 5.57 + Abs xs + 4.91 + + + Dens (at/nm3) + 33.06 mminc (Ã…-1) @@ -6388,33 +6388,33 @@ 186Os 1 - - mmabs/l (Ã…-2) - 1.44E15 - - - Abs xs - 80.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.44E15 M (amu) 186.0 + + Coh b + 11.6 + Dens (g/cm3) 0.0 - Coh b - 11.6 + Abs xs + 80.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6426,33 +6426,33 @@ 135Ba 1 - - mmabs/l (Ã…-2) - 1.44E14 - - - Abs xs - 5.8 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.44E14 M (amu) 135.0 + + Coh b + 4.67 + Dens (g/cm3) 0.0 - Coh b - 4.67 + Abs xs + 5.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6464,33 +6464,33 @@ 20Ne 1 - - mmabs/l (Ã…-2) - 6.03E12 - - - Abs xs - 0.036 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.03E12 M (amu) 20.0 + + Coh b + 4.631 + Dens (g/cm3) 0.0 - Coh b - 4.631 + Abs xs + 0.036 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6502,33 +6502,33 @@ Ru 1 - - mmabs/l (Ã…-2) - 8.48E13 - - - Abs xs - 2.56 - Inc xs 0.4 - Dens (at/nm3) - 73.29 + mmabs/l (Ã…-2) + 8.48E13 M (amu) 101.07 + + Coh b + 7.03 + Dens (g/cm3) 12.3 - Coh b - 7.03 + Abs xs + 2.56 + + + Dens (at/nm3) + 73.29 mminc (Ã…-1) @@ -6540,33 +6540,33 @@ 43Ca 1 - - mmabs/l (Ã…-2) - 4.83E14 - - - Abs xs - 6.2 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.83E14 M (amu) 43.0 + + Coh b + -1.56 + Dens (g/cm3) 0.0 - Coh b - -1.56 + Abs xs + 6.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6578,33 +6578,33 @@ 11B 1 - - mmabs/l (Ã…-2) - 1.67E12 - - - Abs xs - 0.0055 - Inc xs 0.21 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.67E12 M (amu) 11.0 + + Coh b + 6.65 + Dens (g/cm3) 0.0 - Coh b - 6.65 + Abs xs + 0.0055 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6616,33 +6616,33 @@ 50V 1 - - mmabs/l (Ã…-2) - 4.02E15 - - - Abs xs - 60.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.02E15 M (amu) 50.0 + + Coh b + 7.6 + Dens (g/cm3) 0.0 - Coh b - 7.6 + Abs xs + 60.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6654,33 +6654,33 @@ Rh 1 - - mmabs/l (Ã…-2) - 4.71E15 - - - Abs xs - 144.8 - Inc xs 0.3 - Dens (at/nm3) - 72.56 + mmabs/l (Ã…-2) + 4.71E15 M (amu) 102.906 + + Coh b + 5.88 + Dens (g/cm3) 12.4 - Coh b - 5.88 + Abs xs + 144.8 + + + Dens (at/nm3) + 72.56 mminc (Ã…-1) @@ -6692,33 +6692,33 @@ 24Mg 1 - - mmabs/l (Ã…-2) - 6.98E12 - - - Abs xs - 0.05 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.98E12 M (amu) 24.0 + + Coh b + 5.66 + Dens (g/cm3) 0.0 - Coh b - 5.66 + Abs xs + 0.05 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6730,33 +6730,33 @@ 87Rb 1 - - mmabs/l (Ã…-2) - 4.62E12 - - - Abs xs - 0.12 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.62E12 M (amu) 87.0 + + Coh b + 7.23 + Dens (g/cm3) 0.0 - Coh b - 7.23 + Abs xs + 0.12 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6768,33 +6768,33 @@ Re 1 - - mmabs/l (Ã…-2) - 1.61E15 - - - Abs xs - 89.7 - Inc xs 0.9 - Dens (at/nm3) - 66.4 + mmabs/l (Ã…-2) + 1.61E15 M (amu) 186.2 + + Coh b + 9.2 + Dens (g/cm3) 20.53 - Coh b - 9.2 + Abs xs + 89.7 + + + Dens (at/nm3) + 66.4 mminc (Ã…-1) @@ -6806,33 +6806,33 @@ 57Fe 1 - - mmabs/l (Ã…-2) - 1.46E14 - - - Abs xs - 2.48 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.46E14 M (amu) 57.0 + + Coh b + 2.3 + Dens (g/cm3) 0.0 - Coh b - 2.3 + Abs xs + 2.48 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6844,33 +6844,33 @@ Rb 1 - - mmabs/l (Ã…-2) - 1.49E13 - - - Abs xs - 0.38 - Inc xs 0.5 - Dens (at/nm3) - 10.79 + mmabs/l (Ã…-2) + 1.49E13 M (amu) 85.4678 + + Coh b + 7.09 + Dens (g/cm3) 1.53 - Coh b - 7.09 + Abs xs + 0.38 + + + Dens (at/nm3) + 10.79 mminc (Ã…-1) @@ -6882,33 +6882,33 @@ Ra 1 - - mmabs/l (Ã…-2) - 1.9E14 - - - Abs xs - 12.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.9E14 M (amu) 226.0254 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 12.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6920,33 +6920,33 @@ 48Ti 1 - - mmabs/l (Ã…-2) - 5.47E14 - - - Abs xs - 7.84 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.47E14 M (amu) 48.0 + + Coh b + -6.08 + Dens (g/cm3) 0.0 - Coh b - -6.08 + Abs xs + 7.84 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6958,33 +6958,33 @@ 180W 1 - - mmabs/l (Ã…-2) - 5.58E14 - - - Abs xs - 30.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.58E14 M (amu) 180.0 + + Coh b + 5.0 + Dens (g/cm3) 0.0 - Coh b - 5.0 + Abs xs + 30.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -6996,33 +6996,33 @@ 107Ag 1 - - mmabs/l (Ã…-2) - 1.18E15 - - - Abs xs - 37.6 - Inc xs 0.13 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.18E15 M (amu) 107.0 + + Coh b + 7.555 + Dens (g/cm3) 0.0 - Coh b - 7.555 + Abs xs + 37.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7034,33 +7034,33 @@ 10B 1 - - mmabs/l (Ã…-2) - 1.28E18 - - - Abs xs - 3835.0 - Inc xs 3.0 - Dens (at/nm3) - 130.36 + mmabs/l (Ã…-2) + 1.28E18 M (amu) 10.0 + + Coh b + -0.1 + Dens (g/cm3) 2.34 - Coh b - -0.1 + Abs xs + 3835.0 + + + Dens (at/nm3) + 130.36 mminc (Ã…-1) @@ -7072,33 +7072,33 @@ 74Ge 1 - - mmabs/l (Ã…-2) - 1.81E13 - - - Abs xs - 0.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.81E13 M (amu) 74.0 + + Coh b + 7.58 + Dens (g/cm3) 0.0 - Coh b - 7.58 + Abs xs + 0.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7110,33 +7110,33 @@ 76Se 1 - - mmabs/l (Ã…-2) - 3.74E15 - - - Abs xs - 85.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.74E15 M (amu) 76.0 + + Coh b + 12.2 + Dens (g/cm3) 0.0 - Coh b - 12.2 + Abs xs + 85.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7148,33 +7148,33 @@ 70Ge 1 - - mmabs/l (Ã…-2) - 1.43E14 - - - Abs xs - 3.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.43E14 M (amu) 70.0 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 3.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7186,33 +7186,33 @@ 181Ta 1 - - mmabs/l (Ã…-2) - 3.79E14 - - - Abs xs - 20.5 - Inc xs 0.011 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.79E14 M (amu) 181.0 + + Coh b + 6.91 + Dens (g/cm3) 0.0 - Coh b - 6.91 + Abs xs + 20.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7224,33 +7224,33 @@ 166Er 1 - - mmabs/l (Ã…-2) - 3.95E14 - - - Abs xs - 19.6 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.95E14 M (amu) 166.0 + + Coh b + 10.6 + Dens (g/cm3) 0.0 - Coh b - 10.6 + Abs xs + 19.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7262,33 +7262,33 @@ Pt 1 - - mmabs/l (Ã…-2) - 1.77E14 - - - Abs xs - 10.3 - Inc xs 0.13 - Dens (at/nm3) - 66.21 + mmabs/l (Ã…-2) + 1.77E14 M (amu) 195.09 + + Coh b + 9.6 + Dens (g/cm3) 21.45 - Coh b - 9.6 + Abs xs + 10.3 + + + Dens (at/nm3) + 66.21 mminc (Ã…-1) @@ -7300,33 +7300,33 @@ Pr 1 - - mmabs/l (Ã…-2) - 2.73E14 - - - Abs xs - 11.5 - Inc xs 0.015 - Dens (at/nm3) - 28.95 + mmabs/l (Ã…-2) + 2.73E14 M (amu) 140.907 + + Coh b + 4.58 + Dens (g/cm3) 6.77 - Coh b - 4.58 + Abs xs + 11.5 + + + Dens (at/nm3) + 28.95 mminc (Ã…-1) @@ -7338,33 +7338,33 @@ 162Er 1 - - mmabs/l (Ã…-2) - 3.93E14 - - - Abs xs - 19.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.93E14 M (amu) 162.0 + + Coh b + 8.8 + Dens (g/cm3) 0.0 - Coh b - 8.8 + Abs xs + 19.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7376,33 +7376,33 @@ 150Nd 1 - - mmabs/l (Ã…-2) - 2.68E13 - - - Abs xs - 1.2 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.68E13 M (amu) 150.0 + + Coh b + 5.3 + Dens (g/cm3) 0.0 - Coh b - 5.3 + Abs xs + 1.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7414,33 +7414,33 @@ 96Zr 1 - - mmabs/l (Ã…-2) - 7.99E11 - - - Abs xs - 0.0229 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.99E11 M (amu) 96.0 + + Coh b + 5.5 + Dens (g/cm3) 0.0 - Coh b - 5.5 + Abs xs + 0.0229 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7452,33 +7452,33 @@ Pm 1 - - mmabs/l (Ã…-2) - 3.89E15 - - - Abs xs - 168.4 - Inc xs 1.3 - Dens (at/nm3) - 26.89 + mmabs/l (Ã…-2) + 3.89E15 M (amu) 145.0 + + Coh b + 12.6 + Dens (g/cm3) 6.48 - Coh b - 12.6 + Abs xs + 168.4 + + + Dens (at/nm3) + 26.89 mminc (Ã…-1) @@ -7490,33 +7490,33 @@ 92Zr 1 - - mmabs/l (Ã…-2) - 8.01E12 - - - Abs xs - 0.22 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.01E12 M (amu) 92.0 + + Coh b + 7.4 + Dens (g/cm3) 0.0 - Coh b - 7.4 + Abs xs + 0.22 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7528,33 +7528,33 @@ 125Te 1 - - mmabs/l (Ã…-2) - 4.15E13 - - - Abs xs - 1.55 - Inc xs 0.008 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.15E13 M (amu) 125.0 + + Coh b + 5.02 + Dens (g/cm3) 0.0 - Coh b - 5.02 + Abs xs + 1.55 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7566,33 +7566,33 @@ Pd 1 - - mmabs/l (Ã…-2) - 2.17E14 - - - Abs xs - 6.9 - Inc xs 0.093 - Dens (at/nm3) - 68.03 + mmabs/l (Ã…-2) + 2.17E14 M (amu) 106.4 + + Coh b + 5.91 + Dens (g/cm3) 12.02 - Coh b - 5.91 + Abs xs + 6.9 + + + Dens (at/nm3) + 68.03 mminc (Ã…-1) @@ -7604,33 +7604,33 @@ 196Pt 1 - - mmabs/l (Ã…-2) - 1.23E13 - - - Abs xs - 0.72 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.23E13 M (amu) 196.0 + + Coh b + 9.89 + Dens (g/cm3) 0.0 - Coh b - 9.89 + Abs xs + 0.72 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7642,33 +7642,33 @@ 155Gd 1 - - mmabs/l (Ã…-2) - 1.32E18 - - - Abs xs - 61100.0 - Inc xs 25.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.32E18 M (amu) 155.0 + + Coh b + 6.0 + Dens (g/cm3) 0.0 - Coh b - 6.0 + Abs xs + 61100.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7680,33 +7680,33 @@ Pb 1 - - mmabs/l (Ã…-2) - 2.76E12 - - - Abs xs - 0.171 - Inc xs 0.003 - Dens (at/nm3) - 32.97 + mmabs/l (Ã…-2) + 2.76E12 M (amu) 207.19 + + Coh b + 9.405 + Dens (g/cm3) 11.34 - Coh b - 9.405 + Abs xs + 0.171 + + + Dens (at/nm3) + 32.97 mminc (Ã…-1) @@ -7718,33 +7718,33 @@ Pa 1 - - mmabs/l (Ã…-2) - 2.91E15 - - - Abs xs - 200.6 - Inc xs 0.1 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.91E15 M (amu) 231.0359 + + Coh b + 9.1 + Dens (g/cm3) 0.0 - Coh b - 9.1 + Abs xs + 200.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7756,33 +7756,33 @@ 68Zn 1 - - mmabs/l (Ã…-2) - 5.42E13 - - - Abs xs - 1.1 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.42E13 M (amu) 68.0 + + Coh b + 6.03 + Dens (g/cm3) 0.0 - Coh b - 6.03 + Abs xs + 1.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7794,33 +7794,33 @@ 98Mo 1 - - mmabs/l (Ã…-2) - 4.34E12 - - - Abs xs - 0.127 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.34E12 M (amu) 98.0 + + Coh b + 6.58 + Dens (g/cm3) 0.0 - Coh b - 6.58 + Abs xs + 0.127 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7832,33 +7832,33 @@ 192Pt 1 - - mmabs/l (Ã…-2) - 1.74E14 - - - Abs xs - 10.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.74E14 M (amu) 192.0 + + Coh b + 9.9 + Dens (g/cm3) 0.0 - Coh b - 9.9 + Abs xs + 10.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7870,33 +7870,33 @@ 162Dy 1 - - mmabs/l (Ã…-2) - 4.01E15 - - - Abs xs - 194.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.01E15 M (amu) 162.0 + + Coh b + -1.4 + Dens (g/cm3) 0.0 - Coh b - -1.4 + Abs xs + 194.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7908,33 +7908,33 @@ 62Ni 1 - - mmabs/l (Ã…-2) - 7.83E14 - - - Abs xs - 14.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.83E14 M (amu) 62.0 + + Coh b + -8.7 + Dens (g/cm3) 0.0 - Coh b - -8.7 + Abs xs + 14.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7946,33 +7946,33 @@ 208Pb 1 - - mmabs/l (Ã…-2) - 7.73E9 - - - Abs xs - 4.8E-4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.73E9 M (amu) 208.0 + + Coh b + 9.5 + Dens (g/cm3) 0.0 - Coh b - 9.5 + Abs xs + 4.8E-4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -7984,33 +7984,33 @@ 64Zn 1 - - mmabs/l (Ã…-2) - 4.87E13 - - - Abs xs - 0.93 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.87E13 M (amu) 64.0 + + Coh b + 5.22 + Dens (g/cm3) 0.0 - Coh b - 5.22 + Abs xs + 0.93 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8022,33 +8022,33 @@ 94Mo 1 - - mmabs/l (Ã…-2) - 5.34E11 - - - Abs xs - 0.015 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.34E11 M (amu) 94.0 + + Coh b + 6.8 + Dens (g/cm3) 0.0 - Coh b - 6.8 + Abs xs + 0.015 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8060,33 +8060,33 @@ Os 1 - - mmabs/l (Ã…-2) - 2.82E14 - - - Abs xs - 16.0 - Inc xs 0.3 - Dens (at/nm3) - 71.18 + mmabs/l (Ã…-2) + 2.82E14 M (amu) 190.2 + + Coh b + 10.7 + Dens (g/cm3) 22.48 - Coh b - 10.7 + Abs xs + 16.0 + + + Dens (at/nm3) + 71.18 mminc (Ã…-1) @@ -8098,33 +8098,33 @@ 176Hf 1 - - mmabs/l (Ã…-2) - 4.47E14 - - - Abs xs - 23.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.47E14 M (amu) 176.0 + + Coh b + 6.61 + Dens (g/cm3) 0.0 - Coh b - 6.61 + Abs xs + 23.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8136,33 +8136,33 @@ 204Pb 1 - - mmabs/l (Ã…-2) - 1.07E13 - - - Abs xs - 0.65 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.07E13 M (amu) 204.0 + + Coh b + 9.9 + Dens (g/cm3) 0.0 - Coh b - 9.9 + Abs xs + 0.65 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8174,33 +8174,33 @@ 185Re 1 - - mmabs/l (Ã…-2) - 2.03E15 - - - Abs xs - 112.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.03E15 M (amu) 185.0 + + Coh b + 9.0 + Dens (g/cm3) 0.0 - Coh b - 9.0 + Abs xs + 112.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8212,33 +8212,33 @@ 113Cd 1 - - mmabs/l (Ã…-2) - 6.1E17 - - - Abs xs - 20600.0 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.1E17 M (amu) 113.0 + + Coh b + -8.0 + Dens (g/cm3) 0.0 - Coh b - -8.0 + Abs xs + 20600.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8250,33 +8250,33 @@ 53Cr 1 - - mmabs/l (Ã…-2) - 1.14E15 - - - Abs xs - 18.1 - Inc xs 5.93 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.14E15 M (amu) 53.0 + + Coh b + -4.2 + Dens (g/cm3) 0.0 - Coh b - -4.2 + Abs xs + 18.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8288,33 +8288,33 @@ 36Ar 1 - - mmabs/l (Ã…-2) - 4.84E14 - - - Abs xs - 5.2 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.84E14 M (amu) 36.0 + + Coh b + 24.9 + Dens (g/cm3) 0.0 - Coh b - 24.9 + Abs xs + 5.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8326,33 +8326,33 @@ 238U 1 - - mmabs/l (Ã…-2) - 3.77E13 - - - Abs xs - 2.68 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.77E13 M (amu) 238.0 + + Coh b + 8.402 + Dens (g/cm3) 0.0 - Coh b - 8.402 + Abs xs + 2.68 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8364,33 +8364,33 @@ 192Os 1 - - mmabs/l (Ã…-2) - 3.49E13 - - - Abs xs - 2.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.49E13 M (amu) 192.0 + + Coh b + 11.5 + Dens (g/cm3) 0.0 - Coh b - 11.5 + Abs xs + 2.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8402,33 +8402,33 @@ 121Sb 1 - - mmabs/l (Ã…-2) - 1.59E14 - - - Abs xs - 5.75 - Inc xs 3.0E-4 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.59E14 M (amu) 121.0 + + Coh b + 5.71 + Dens (g/cm3) 0.0 - Coh b - 5.71 + Abs xs + 5.75 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8440,33 +8440,33 @@ 81Br 1 - - mmabs/l (Ã…-2) - 1.12E14 - - - Abs xs - 2.7 - Inc xs 0.05 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.12E14 M (amu) 81.0 + + Coh b + 6.79 + Dens (g/cm3) 0.0 - Coh b - 6.79 + Abs xs + 2.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8478,33 +8478,33 @@ 39K 1 - - mmabs/l (Ã…-2) - 1.8E14 - - - Abs xs - 2.1 - Inc xs 0.25 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.8E14 M (amu) 39.0 + + Coh b + 3.74 + Dens (g/cm3) 0.0 - Coh b - 3.74 + Abs xs + 2.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8516,33 +8516,33 @@ Np 1 - - mmabs/l (Ã…-2) - 2.48E15 - - - Abs xs - 175.9 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.48E15 M (amu) 237.0482 + + Coh b + 10.55 + Dens (g/cm3) 0.0 - Coh b - 10.55 + Abs xs + 175.9 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8554,33 +8554,33 @@ 143Nd 1 - - mmabs/l (Ã…-2) - 7.89E15 - - - Abs xs - 337.0 - Inc xs 55.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.89E15 M (amu) 143.0 + + Coh b + 14.0 + Dens (g/cm3) 0.0 - Coh b - 14.0 + Abs xs + 337.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8592,33 +8592,33 @@ 151Eu 1 - - mmabs/l (Ã…-2) - 2.02E17 - - - Abs xs - 9100.0 - Inc xs 3.1 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.02E17 M (amu) 151.0 + + Coh b + 6.13 + Dens (g/cm3) 0.0 - Coh b - 6.13 + Abs xs + 9100.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8630,33 +8630,33 @@ Ni 1 - - mmabs/l (Ã…-2) - 2.56E14 - - - Abs xs - 4.49 - Inc xs 5.2 - Dens (at/nm3) - 91.31 + mmabs/l (Ã…-2) + 2.56E14 M (amu) 58.7 + + Coh b + 10.3 + Dens (g/cm3) 8.9 - Coh b - 10.3 + Abs xs + 4.49 + + + Dens (at/nm3) + 91.31 mminc (Ã…-1) @@ -8668,33 +8668,33 @@ Ne 1 - - mmabs/l (Ã…-2) - 6.47E12 - - - Abs xs - 0.039 - Inc xs 0.008 - Dens (at/nm3) - 0.03 + mmabs/l (Ã…-2) + 6.47E12 M (amu) 20.179 + + Coh b + 4.566 + Dens (g/cm3) 0.0 - Coh b - 4.566 + Abs xs + 0.039 + + + Dens (at/nm3) + 0.03 mminc (Ã…-1) @@ -8706,33 +8706,33 @@ Nd 1 - - mmabs/l (Ã…-2) - 1.17E15 - - - Abs xs - 50.5 - Inc xs 9.2 - Dens (at/nm3) - 29.24 + mmabs/l (Ã…-2) + 1.17E15 M (amu) 144.24 + + Coh b + 7.69 + Dens (g/cm3) 7.0 - Coh b - 7.69 + Abs xs + 50.5 + + + Dens (at/nm3) + 29.24 mminc (Ã…-1) @@ -8744,33 +8744,33 @@ Nb 1 - - mmabs/l (Ã…-2) - 4.14E13 - - - Abs xs - 1.15 - Inc xs 0.0024 - Dens (at/nm3) - 55.55 + mmabs/l (Ã…-2) + 4.14E13 M (amu) 92.9064 + + Coh b + 7.054 + Dens (g/cm3) 8.57 - Coh b - 7.054 + Abs xs + 1.15 + + + Dens (at/nm3) + 55.55 mminc (Ã…-1) @@ -8782,33 +8782,33 @@ Na 1 - - mmabs/l (Ã…-2) - 7.72E13 - - - Abs xs - 0.53 - Inc xs 1.62 - Dens (at/nm3) - 25.41 + mmabs/l (Ã…-2) + 7.72E13 M (amu) 22.9898 + + Coh b + 3.63 + Dens (g/cm3) 0.97 - Coh b - 3.63 + Abs xs + 0.53 + + + Dens (at/nm3) + 25.41 mminc (Ã…-1) @@ -8820,33 +8820,33 @@ 108Pd 1 - - mmabs/l (Ã…-2) - 2.65E14 - - - Abs xs - 8.55 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.65E14 M (amu) 108.0 + + Coh b + 4.1 + Dens (g/cm3) 0.0 - Coh b - 4.1 + Abs xs + 8.55 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8858,33 +8858,33 @@ 138Ce 1 - - mmabs/l (Ã…-2) - 2.67E13 - - - Abs xs - 1.1 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.67E13 M (amu) 138.0 + + Coh b + 6.7 + Dens (g/cm3) 0.0 - Coh b - 6.7 + Abs xs + 1.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8896,33 +8896,33 @@ 175Lu 1 - - mmabs/l (Ã…-2) - 4.02E14 - - - Abs xs - 21.0 - Inc xs 0.6 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.02E14 M (amu) 175.0 + + Coh b + 7.24 + Dens (g/cm3) 0.0 - Coh b - 7.24 + Abs xs + 21.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8934,33 +8934,33 @@ 104Pd 1 - - mmabs/l (Ã…-2) - 1.93E13 - - - Abs xs - 0.6 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.93E13 M (amu) 104.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 0.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -8972,33 +8972,33 @@ 173Yb 1 - - mmabs/l (Ã…-2) - 3.31E14 - - - Abs xs - 17.1 - Inc xs 3.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.31E14 M (amu) 173.0 + + Coh b + 9.56 + Dens (g/cm3) 0.0 - Coh b - 9.56 + Abs xs + 17.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9010,33 +9010,33 @@ Mo 1 - - mmabs/l (Ã…-2) - 8.65E13 - - - Abs xs - 2.48 - Inc xs 0.04 - Dens (at/nm3) - 64.02 + mmabs/l (Ã…-2) + 8.65E13 M (amu) 95.94 + + Coh b + 6.715 + Dens (g/cm3) 10.2 - Coh b - 6.715 + Abs xs + 2.48 + + + Dens (at/nm3) + 64.02 mminc (Ã…-1) @@ -9048,33 +9048,33 @@ Mn 1 - - mmabs/l (Ã…-2) - 8.11E14 - - - Abs xs - 13.3 - Inc xs 0.4 - Dens (at/nm3) - 78.92 + mmabs/l (Ã…-2) + 8.11E14 M (amu) 54.938 + + Coh b + -3.73 + Dens (g/cm3) 7.2 - Coh b - -3.73 + Abs xs + 13.3 + + + Dens (at/nm3) + 78.92 mminc (Ã…-1) @@ -9086,33 +9086,33 @@ 203Tl 1 - - mmabs/l (Ã…-2) - 1.88E14 - - - Abs xs - 11.4 - Inc xs 0.14 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.88E14 M (amu) 203.0 + + Coh b + 6.99 + Dens (g/cm3) 0.0 - Coh b - 6.99 + Abs xs + 11.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9124,33 +9124,33 @@ 86Sr 1 - - mmabs/l (Ã…-2) - 4.05E13 - - - Abs xs - 1.04 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.05E13 M (amu) 86.0 + + Coh b + 5.67 + Dens (g/cm3) 0.0 - Coh b - 5.67 + Abs xs + 1.04 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9162,33 +9162,33 @@ 118Sn 1 - - mmabs/l (Ã…-2) - 6.24E12 - - - Abs xs - 0.22 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.24E12 M (amu) 118.0 + + Coh b + 6.07 + Dens (g/cm3) 0.0 - Coh b - 6.07 + Abs xs + 0.22 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9200,33 +9200,33 @@ 106Cd 1 - - mmabs/l (Ã…-2) - 3.16E13 - - - Abs xs - 1.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.16E13 M (amu) 106.0 + + Coh b + 5.0 + Dens (g/cm3) 0.0 - Coh b - 5.0 + Abs xs + 1.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9238,33 +9238,33 @@ Mg 1 - - mmabs/l (Ã…-2) - 8.68E12 - - - Abs xs - 0.063 - Inc xs 0.08 - Dens (at/nm3) - 43.11 + mmabs/l (Ã…-2) + 8.68E12 M (amu) 24.305 + + Coh b + 5.375 + Dens (g/cm3) 1.74 - Coh b - 5.375 + Abs xs + 0.063 + + + Dens (at/nm3) + 43.11 mminc (Ã…-1) @@ -9276,33 +9276,33 @@ 50Ti 1 - - mmabs/l (Ã…-2) - 1.2E13 - - - Abs xs - 0.179 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.2E13 M (amu) 50.0 + + Coh b + 6.18 + Dens (g/cm3) 0.0 - Coh b - 6.18 + Abs xs + 0.179 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9314,33 +9314,33 @@ 114Sn 1 - - mmabs/l (Ã…-2) - 3.35E12 - - - Abs xs - 0.114 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.35E12 M (amu) 114.0 + + Coh b + 6.2 + Dens (g/cm3) 0.0 - Coh b - 6.2 + Abs xs + 0.114 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9352,33 +9352,33 @@ 189Os 1 - - mmabs/l (Ã…-2) - 4.43E14 - - - Abs xs - 25.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.43E14 M (amu) 189.0 + + Coh b + 10.7 + Dens (g/cm3) 0.0 - Coh b - 10.7 + Abs xs + 25.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9390,33 +9390,33 @@ 138Ba 1 - - mmabs/l (Ã…-2) - 6.55E12 - - - Abs xs - 0.27 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.55E12 M (amu) 138.0 + + Coh b + 4.84 + Dens (g/cm3) 0.0 - Coh b - 4.84 + Abs xs + 0.27 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9428,33 +9428,33 @@ 41K 1 - - mmabs/l (Ã…-2) - 1.19E14 - - - Abs xs - 1.46 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.19E14 M (amu) 41.0 + + Coh b + 2.69 + Dens (g/cm3) 0.0 - Coh b - 2.69 + Abs xs + 1.46 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9466,33 +9466,33 @@ 82Se 1 - - mmabs/l (Ã…-2) - 1.8E12 - - - Abs xs - 0.044 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.8E12 M (amu) 82.0 + + Coh b + 6.34 + Dens (g/cm3) 0.0 - Coh b - 6.34 + Abs xs + 0.044 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9504,33 +9504,33 @@ Lu 1 - - mmabs/l (Ã…-2) - 1.42E15 - - - Abs xs - 74.0 - Inc xs 0.7 - Dens (at/nm3) - 33.87 + mmabs/l (Ã…-2) + 1.42E15 M (amu) 174.97 + + Coh b + 7.21 + Dens (g/cm3) 9.84 - Coh b - 7.21 + Abs xs + 74.0 + + + Dens (at/nm3) + 33.87 mminc (Ã…-1) @@ -9542,33 +9542,33 @@ 46Ca 1 - - mmabs/l (Ã…-2) - 5.39E13 - - - Abs xs - 0.74 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.39E13 M (amu) 46.0 + + Coh b + 3.6 + Dens (g/cm3) 0.0 - Coh b - 3.6 + Abs xs + 0.74 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9580,33 +9580,33 @@ 134Ba 1 - - mmabs/l (Ã…-2) - 5.0E13 - - - Abs xs - 2.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.0E13 M (amu) 134.0 + + Coh b + 5.7 + Dens (g/cm3) 0.0 - Coh b - 5.7 + Abs xs + 2.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9618,33 +9618,33 @@ 242Pu 1 - - mmabs/l (Ã…-2) - 2.56E14 - - - Abs xs - 18.5 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.56E14 M (amu) 242.0 + + Coh b + 8.1 + Dens (g/cm3) 0.0 - Coh b - 8.1 + Abs xs + 18.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9656,33 +9656,33 @@ 42Ca 1 - - mmabs/l (Ã…-2) - 5.42E13 - - - Abs xs - 0.68 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.42E13 M (amu) 42.0 + + Coh b + 3.36 + Dens (g/cm3) 0.0 - Coh b - 3.36 + Abs xs + 0.68 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9694,33 +9694,33 @@ Li 1 - - mmabs/l (Ã…-2) - 3.4E16 - - - Abs xs - 70.5 - Inc xs 0.92 - Dens (at/nm3) - 46.33 + mmabs/l (Ã…-2) + 3.4E16 M (amu) 6.941 + + Coh b + -1.9 + Dens (g/cm3) 0.53 - Coh b - -1.9 + Abs xs + 70.5 + + + Dens (at/nm3) + 46.33 mminc (Ã…-1) @@ -9732,33 +9732,33 @@ 130Ba 1 - - mmabs/l (Ã…-2) - 7.73E14 - - - Abs xs - 30.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.73E14 M (amu) 130.0 + + Coh b + -3.6 + Dens (g/cm3) 0.0 - Coh b - -3.6 + Abs xs + 30.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9770,33 +9770,33 @@ 235U 1 - - mmabs/l (Ã…-2) - 9.7E15 - - - Abs xs - 680.9 - Inc xs 0.2 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.7E15 M (amu) 235.0 + + Coh b + 10.47 + Dens (g/cm3) 0.0 - Coh b - 10.47 + Abs xs + 680.9 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9808,33 +9808,33 @@ 248Cm 1 - - mmabs/l (Ã…-2) - 4.05E13 - - - Abs xs - 3.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.05E13 M (amu) 248.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 3.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9846,33 +9846,33 @@ La 1 - - mmabs/l (Ã…-2) - 2.16E14 - - - Abs xs - 8.97 - Inc xs 1.13 - Dens (at/nm3) - 26.62 + mmabs/l (Ã…-2) + 2.16E14 M (amu) 138.906 + + Coh b + 8.24 + Dens (g/cm3) 6.14 - Coh b - 8.24 + Abs xs + 8.97 + + + Dens (at/nm3) + 26.62 mminc (Ã…-1) @@ -9884,33 +9884,33 @@ 4He 1 - - mmabs/l (Ã…-2) - 0.0 - - - Abs xs - 0.0 - Inc xs 0.0 - Dens (at/nm3) + mmabs/l (Ã…-2) 0.0 M (amu) 4.0026 + + Coh b + 3.26 + Dens (g/cm3) 0.0 - Coh b - 3.26 + Abs xs + 0.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9920,35 +9920,35 @@ 36S - 1 - - - mmabs/l (Ã…-2) - 1.4E13 - - - Abs xs - 0.15 - + 1 + Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.4E13 M (amu) 36.0 + + Coh b + 3.0 + Dens (g/cm3) 0.0 - Coh b - 3.0 + Abs xs + 0.15 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9960,33 +9960,33 @@ 40K 1 - - mmabs/l (Ã…-2) - 2.93E15 - - - Abs xs - 35.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.93E15 M (amu) 40.0 + + Coh b + 3.0 + Dens (g/cm3) 0.0 - Coh b - 3.0 + Abs xs + 35.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -9998,33 +9998,33 @@ 56Fe 1 - - mmabs/l (Ã…-2) - 1.55E14 - - - Abs xs - 2.59 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.55E14 M (amu) 56.0 + + Coh b + 9.94 + Dens (g/cm3) 0.0 - Coh b - 9.94 + Abs xs + 2.59 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10036,33 +10036,33 @@ 244Cm 1 - - mmabs/l (Ã…-2) - 2.22E14 - - - Abs xs - 16.2 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.22E14 M (amu) 244.0 + + Coh b + 9.5 + Dens (g/cm3) 0.0 - Coh b - 9.5 + Abs xs + 16.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10074,33 +10074,33 @@ Kr 1 - - mmabs/l (Ã…-2) - 9.99E14 - - - Abs xs - 25.0 - Inc xs 0.01 - Dens (at/nm3) - 0.03 + mmabs/l (Ã…-2) + 9.99E14 M (amu) 83.8 + + Coh b + 7.81 + Dens (g/cm3) 0.0 - Coh b - 7.81 + Abs xs + 25.0 + + + Dens (at/nm3) + 0.03 mminc (Ã…-1) @@ -10112,33 +10112,33 @@ 70Zn 1 - - mmabs/l (Ã…-2) - 4.4E12 - - - Abs xs - 0.092 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.4E12 M (amu) 70.0 + + Coh b + 6.0 + Dens (g/cm3) 0.0 - Coh b - 6.0 + Abs xs + 0.092 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10150,33 +10150,33 @@ 47Ti 1 - - mmabs/l (Ã…-2) - 1.21E14 - - - Abs xs - 1.7 - Inc xs 1.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.21E14 M (amu) 47.0 + + Coh b + 3.63 + Dens (g/cm3) 0.0 - Coh b - 3.63 + Abs xs + 1.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10188,33 +10188,33 @@ 63Cu 1 - - mmabs/l (Ã…-2) - 2.39E14 - - - Abs xs - 4.5 - Inc xs 0.006 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.39E14 M (amu) 63.0 + + Coh b + 6.43 + Dens (g/cm3) 0.0 - Coh b - 6.43 + Abs xs + 4.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10226,33 +10226,33 @@ 234U 1 - - mmabs/l (Ã…-2) - 1.43E15 - - - Abs xs - 100.1 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.43E15 M (amu) 234.0 + + Coh b + 12.4 + Dens (g/cm3) 0.0 - Coh b - 12.4 + Abs xs + 100.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10264,33 +10264,33 @@ 3H 1 - - mmabs/l (Ã…-2) - 0.0 - - - Abs xs - 0.0 - Inc xs 0.14 - Dens (at/nm3) + mmabs/l (Ã…-2) 0.0 M (amu) 3.0 + + Coh b + 4.792 + Dens (g/cm3) 0.0 - Coh b - 4.792 + Abs xs + 0.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10302,33 +10302,33 @@ 73Ge 1 - - mmabs/l (Ã…-2) - 6.93E14 - - - Abs xs - 15.1 - Inc xs 1.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.93E14 M (amu) 73.0 + + Coh b + 5.02 + Dens (g/cm3) 0.0 - Coh b - 5.02 + Abs xs + 15.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10340,33 +10340,33 @@ 100Mo 1 - - mmabs/l (Ã…-2) - 1.34E13 - - - Abs xs - 0.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.34E13 M (amu) 100.0 + + Coh b + 6.73 + Dens (g/cm3) 0.0 - Coh b - 6.73 + Abs xs + 0.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10378,33 +10378,33 @@ 239Pu 1 - - mmabs/l (Ã…-2) - 1.43E16 - - - Abs xs - 1017.3 - Inc xs 0.2 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.43E16 M (amu) 239.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 1017.3 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10416,33 +10416,33 @@ 35Cl 1 - - mmabs/l (Ã…-2) - 4.22E15 - - - Abs xs - 44.1 - Inc xs 4.7 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.22E15 M (amu) 35.0 + + Coh b + 11.65 + Dens (g/cm3) 0.0 - Coh b - 11.65 + Abs xs + 44.1 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10454,33 +10454,33 @@ 180Ta 1 - - mmabs/l (Ã…-2) - 1.05E16 - - - Abs xs - 563.0 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.05E16 M (amu) 180.0 + + Coh b + 7.0 + Dens (g/cm3) 0.0 - Coh b - 7.0 + Abs xs + 563.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10492,33 +10492,33 @@ 128Te 1 - - mmabs/l (Ã…-2) - 5.62E12 - - - Abs xs - 0.215 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.62E12 M (amu) 128.0 + + Coh b + 5.89 + Dens (g/cm3) 0.0 - Coh b - 5.89 + Abs xs + 0.215 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10530,33 +10530,33 @@ 7Li 1 - - mmabs/l (Ã…-2) - 2.17E13 - - - Abs xs - 0.0454 - Inc xs 0.78 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.17E13 M (amu) 7.0 + + Coh b + -2.22 + Dens (g/cm3) 0.0 - Coh b - -2.22 + Abs xs + 0.0454 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10568,33 +10568,33 @@ 158Gd 1 - - mmabs/l (Ã…-2) - 4.66E13 - - - Abs xs - 2.2 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.66E13 M (amu) 158.0 + + Coh b + 9.0 + Dens (g/cm3) 0.0 - Coh b - 9.0 + Abs xs + 2.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10606,33 +10606,33 @@ 233U 1 - - mmabs/l (Ã…-2) - 8.26E15 - - - Abs xs - 574.7 - Inc xs 0.1 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.26E15 M (amu) 233.0 + + Coh b + 10.1 + Dens (g/cm3) 0.0 - Coh b - 10.1 + Abs xs + 574.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10644,33 +10644,33 @@ Y 1 - - mmabs/l (Ã…-2) - 4.82E13 - - - Abs xs - 1.28 - Inc xs 0.15 - Dens (at/nm3) - 30.28 + mmabs/l (Ã…-2) + 4.82E13 M (amu) 88.9059 + + Coh b + 7.75 + Dens (g/cm3) 4.47 - Coh b - 7.75 + Abs xs + 1.28 + + + Dens (at/nm3) + 30.28 mminc (Ã…-1) @@ -10682,33 +10682,33 @@ 2H 1 - - mmabs/l (Ã…-2) - 8.69E11 - - - Abs xs - 5.19E-4 - Inc xs 2.05 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.69E11 M (amu) 2.0 + + Coh b + 6.671 + Dens (g/cm3) 0.0 - Coh b - 6.671 + Abs xs + 5.19E-4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10720,33 +10720,33 @@ 91Zr 1 - - mmabs/l (Ã…-2) - 4.3E13 - - - Abs xs - 1.17 - Inc xs 0.15 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.3E13 M (amu) 91.0 + + Coh b + 8.7 + Dens (g/cm3) 0.0 - Coh b - 8.7 + Abs xs + 1.17 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10758,33 +10758,33 @@ W 1 - - mmabs/l (Ã…-2) - 3.33E14 - - - Abs xs - 18.3 - Inc xs 1.63 - Dens (at/nm3) - 63.38 + mmabs/l (Ã…-2) + 3.33E14 M (amu) 183.85 + + Coh b + 4.86 + Dens (g/cm3) 19.35 - Coh b - 4.86 + Abs xs + 18.3 + + + Dens (at/nm3) + 63.38 mminc (Ã…-1) @@ -10796,33 +10796,33 @@ V 1 - - mmabs/l (Ã…-2) - 3.34E14 - - - Abs xs - 5.08 - Inc xs 5.08 - Dens (at/nm3) - 70.46 + mmabs/l (Ã…-2) + 3.34E14 M (amu) 50.9415 + + Coh b + -0.3824 + Dens (g/cm3) 5.96 - Coh b - -0.3824 + Abs xs + 5.08 + + + Dens (at/nm3) + 70.46 mminc (Ã…-1) @@ -10834,33 +10834,33 @@ 124Te 1 - - mmabs/l (Ã…-2) - 1.84E14 - - - Abs xs - 6.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.84E14 M (amu) 124.0 + + Coh b + 7.96 + Dens (g/cm3) 0.0 - Coh b - 7.96 + Abs xs + 6.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10872,33 +10872,33 @@ U 1 - - mmabs/l (Ã…-2) - 1.06E14 - - - Abs xs - 7.57 - Inc xs 0.005 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.06E14 M (amu) 238.029 + + Coh b + 8.417 + Dens (g/cm3) 0.0 - Coh b - 8.417 + Abs xs + 7.57 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10910,33 +10910,33 @@ 195Pt 1 - - mmabs/l (Ã…-2) - 4.72E14 - - - Abs xs - 27.5 - Inc xs 0.13 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.72E14 M (amu) 195.0 + + Coh b + 8.83 + Dens (g/cm3) 0.0 - Coh b - 8.83 + Abs xs + 27.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10948,33 +10948,33 @@ 34S 1 - - mmabs/l (Ã…-2) - 2.24E13 - - - Abs xs - 0.227 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.24E13 M (amu) 34.0 + + Coh b + 3.48 + Dens (g/cm3) 0.0 - Coh b - 3.48 + Abs xs + 0.227 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -10986,33 +10986,33 @@ S 1 - - mmabs/l (Ã…-2) - 5.54E13 - - - Abs xs - 0.53 - Inc xs 0.007 - Dens (at/nm3) - 38.88 + mmabs/l (Ã…-2) + 5.54E13 M (amu) 32.06 + + Coh b + 2.847 + Dens (g/cm3) 2.07 - Coh b - 2.847 + Abs xs + 0.53 + + + Dens (at/nm3) + 38.88 mminc (Ã…-1) @@ -11024,33 +11024,33 @@ 154Gd 1 - - mmabs/l (Ã…-2) - 1.85E15 - - - Abs xs - 85.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.85E15 M (amu) 154.0 + + Coh b + 10.0 + Dens (g/cm3) 0.0 - Coh b - 10.0 + Abs xs + 85.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11062,33 +11062,33 @@ P 1 - - mmabs/l (Ã…-2) - 1.86E13 - - - Abs xs - 0.172 - Inc xs 0.005 - Dens (at/nm3) - 44.72 + mmabs/l (Ã…-2) + 1.86E13 M (amu) 30.9738 + + Coh b + 5.13 + Dens (g/cm3) 2.3 - Coh b - 5.13 + Abs xs + 0.172 + + + Dens (at/nm3) + 44.72 mminc (Ã…-1) @@ -11100,33 +11100,33 @@ O 1 - - mmabs/l (Ã…-2) - 3.98E10 - - - Abs xs - 1.9E-4 - Inc xs 8.0E-4 - Dens (at/nm3) - 0.05 + mmabs/l (Ã…-2) + 3.98E10 M (amu) 15.9994 + + Coh b + 5.803 + Dens (g/cm3) 0.0 - Coh b - 5.803 + Abs xs + 1.9E-4 + + + Dens (at/nm3) + 0.05 mminc (Ã…-1) @@ -11138,33 +11138,33 @@ 67Zn 1 - - mmabs/l (Ã…-2) - 3.4E14 - - - Abs xs - 6.8 - Inc xs 0.28 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.4E14 M (amu) 67.0 + + Coh b + 7.56 + Dens (g/cm3) 0.0 - Coh b - 7.56 + Abs xs + 6.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11176,33 +11176,33 @@ 97Mo 1 - - mmabs/l (Ã…-2) - 8.63E13 - - - Abs xs - 2.5 - Inc xs 0.5 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 8.63E13 M (amu) 97.0 + + Coh b + 7.24 + Dens (g/cm3) 0.0 - Coh b - 7.24 + Abs xs + 2.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11214,33 +11214,33 @@ N 1 - - mmabs/l (Ã…-2) - 4.54E14 - - - Abs xs - 1.9 - Inc xs 0.5 - Dens (at/nm3) - 0.05 + mmabs/l (Ã…-2) + 4.54E14 M (amu) 14.0067 + + Coh b + 9.36 + Dens (g/cm3) 0.0 - Coh b - 9.36 + Abs xs + 1.9 + + + Dens (at/nm3) + 0.05 mminc (Ã…-1) @@ -11252,33 +11252,33 @@ 120Te 1 - - mmabs/l (Ã…-2) - 6.42E13 - - - Abs xs - 2.3 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.42E13 M (amu) 120.0 + + Coh b + 5.3 + Dens (g/cm3) 0.0 - Coh b - 5.3 + Abs xs + 2.3 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11290,33 +11290,33 @@ Ir 1 - - mmabs/l (Ã…-2) - 7.4E15 - - - Abs xs - 425.0 - Inc xs 0.0 - Dens (at/nm3) - 70.25 + mmabs/l (Ã…-2) + 7.4E15 M (amu) 192.2 + + Coh b + 10.6 + Dens (g/cm3) 22.42 - Coh b - 10.6 + Abs xs + 425.0 + + + Dens (at/nm3) + 70.25 mminc (Ã…-1) @@ -11328,33 +11328,33 @@ 152Sm 1 - - mmabs/l (Ã…-2) - 4.54E15 - - - Abs xs - 206.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.54E15 M (amu) 152.0 + + Coh b + -5.0 + Dens (g/cm3) 0.0 - Coh b - -5.0 + Abs xs + 206.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11366,33 +11366,33 @@ 179Hf 1 - - mmabs/l (Ã…-2) - 7.67E14 - - - Abs xs - 41.0 - Inc xs 0.14 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 7.67E14 M (amu) 179.0 + + Coh b + 7.46 + Dens (g/cm3) 0.0 - Coh b - 7.46 + Abs xs + 41.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11404,33 +11404,33 @@ K 1 - - mmabs/l (Ã…-2) - 1.8E14 - - - Abs xs - 2.1 - Inc xs 0.27 - Dens (at/nm3) - 13.25 + mmabs/l (Ã…-2) + 1.8E14 M (amu) 39.0963 + + Coh b + 3.67 + Dens (g/cm3) 0.86 - Coh b - 3.67 + Abs xs + 2.1 + + + Dens (at/nm3) + 13.25 mminc (Ã…-1) @@ -11442,33 +11442,33 @@ 110Pd 1 - - mmabs/l (Ã…-2) - 6.88E12 - - - Abs xs - 0.226 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.88E12 M (amu) 110.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 0.226 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11480,33 +11480,33 @@ 161Dy 1 - - mmabs/l (Ã…-2) - 1.25E16 - - - Abs xs - 600.0 - Inc xs 3.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.25E16 M (amu) 161.0 + + Coh b + 10.3 + Dens (g/cm3) 0.0 - Coh b - 10.3 + Abs xs + 600.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11518,33 +11518,33 @@ I 1 - - mmabs/l (Ã…-2) - 1.62E14 - - - Abs xs - 6.15 - Inc xs 0.31 - Dens (at/nm3) - 0.02 + mmabs/l (Ã…-2) + 1.62E14 M (amu) 126.91 + + Coh b + 5.28 + Dens (g/cm3) 0.0 - Coh b - 5.28 + Abs xs + 6.15 + + + Dens (at/nm3) + 0.02 mminc (Ã…-1) @@ -11556,33 +11556,33 @@ 140Ce 1 - - mmabs/l (Ã…-2) - 1.36E13 - - - Abs xs - 0.57 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.36E13 M (amu) 140.0 + + Coh b + 4.84 + Dens (g/cm3) 0.0 - Coh b - 4.84 + Abs xs + 0.57 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11594,33 +11594,33 @@ H 1 - - mmabs/l (Ã…-2) - 1.1E15 - - - Abs xs - 0.3326 - Inc xs 80.26 - Dens (at/nm3) - 0.05 + mmabs/l (Ã…-2) + 1.1E15 M (amu) 1.0079 + + Coh b + -3.739 + Dens (g/cm3) 0.0 - Coh b - -3.739 + Abs xs + 0.3326 + + + Dens (at/nm3) + 0.05 mminc (Ã…-1) @@ -11632,33 +11632,33 @@ In 1 - - mmabs/l (Ã…-2) - 5.65E15 - - - Abs xs - 193.8 - Inc xs 0.54 - Dens (at/nm3) - 38.29 + mmabs/l (Ã…-2) + 5.65E15 M (amu) 114.82 + + Coh b + 4.065 + Dens (g/cm3) 7.3 - Coh b - 4.065 + Abs xs + 193.8 + + + Dens (at/nm3) + 38.29 mminc (Ã…-1) @@ -11670,33 +11670,33 @@ 61Ni 1 - - mmabs/l (Ã…-2) - 1.37E14 - - - Abs xs - 2.5 - Inc xs 1.9 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.37E14 M (amu) 61.0 + + Coh b + 7.6 + Dens (g/cm3) 0.0 - Coh b - 7.6 + Abs xs + 2.5 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11708,33 +11708,33 @@ 207Pb 1 - - mmabs/l (Ã…-2) - 1.13E13 - - - Abs xs - 0.699 - Inc xs 0.002 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.13E13 M (amu) 207.0 + + Coh b + 9.28 + Dens (g/cm3) 0.0 - Coh b - 9.28 + Abs xs + 0.699 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11746,33 +11746,33 @@ F 1 - - mmabs/l (Ã…-2) - 1.69E12 - - - Abs xs - 0.0096 - Inc xs 8.0E-4 - Dens (at/nm3) - 0.05 + mmabs/l (Ã…-2) + 1.69E12 M (amu) 18.9984 + + Coh b + 5.654 + Dens (g/cm3) 0.0 - Coh b - 5.654 + Abs xs + 0.0096 + + + Dens (at/nm3) + 0.05 mminc (Ã…-1) @@ -11784,33 +11784,33 @@ 115In 1 - - mmabs/l (Ã…-2) - 5.88E15 - - - Abs xs - 202.0 - Inc xs 0.55 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.88E15 M (amu) 115.0 + + Coh b + 4.01 + Dens (g/cm3) 0.0 - Coh b - 4.01 + Abs xs + 202.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11822,33 +11822,33 @@ 116Cd 1 - - mmabs/l (Ã…-2) - 2.16E12 - - - Abs xs - 0.075 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.16E12 M (amu) 116.0 + + Coh b + 6.3 + Dens (g/cm3) 0.0 - Coh b - 6.3 + Abs xs + 0.075 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11860,33 +11860,33 @@ C 1 - - mmabs/l (Ã…-2) - 9.76E11 - - - Abs xs - 0.0035 - Inc xs 0.001 - Dens (at/nm3) - 112.81 + mmabs/l (Ã…-2) + 9.76E11 M (amu) 12.011 + + Coh b + 6.646 + Dens (g/cm3) 2.25 - Coh b - 6.646 + Abs xs + 0.0035 + + + Dens (at/nm3) + 112.81 mminc (Ã…-1) @@ -11898,33 +11898,33 @@ B 1 - - mmabs/l (Ã…-2) - 2.38E17 - - - Abs xs - 767.0 - Inc xs 1.7 - Dens (at/nm3) - 130.36 + mmabs/l (Ã…-2) + 2.38E17 M (amu) 10.81 + + Coh b + 5.3 + Dens (g/cm3) 2.34 - Coh b - 5.3 + Abs xs + 767.0 + + + Dens (at/nm3) + 130.36 mminc (Ã…-1) @@ -11936,33 +11936,33 @@ 124Sn 1 - - mmabs/l (Ã…-2) - 3.59E12 - - - Abs xs - 0.133 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.59E12 M (amu) 124.0 + + Coh b + 5.97 + Dens (g/cm3) 0.0 - Coh b - 5.97 + Abs xs + 0.133 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -11974,33 +11974,33 @@ 112Cd 1 - - mmabs/l (Ã…-2) - 6.58E13 - - - Abs xs - 2.2 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.58E13 M (amu) 112.0 + + Coh b + 6.4 + Dens (g/cm3) 0.0 - Coh b - 6.4 + Abs xs + 2.2 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12012,33 +12012,33 @@ 1H 1 - - mmabs/l (Ã…-2) - 1.1E15 - - - Abs xs - 0.3326 - Inc xs 80.27 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.1E15 M (amu) 1.0079 + + Coh b + -3.7406 + Dens (g/cm3) 0.0 - Coh b - -3.7406 + Abs xs + 0.3326 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12050,33 +12050,33 @@ 52Cr 1 - - mmabs/l (Ã…-2) - 4.89E13 - - - Abs xs - 0.76 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.89E13 M (amu) 52.0 + + Coh b + 4.92 + Dens (g/cm3) 0.0 - Coh b - 4.92 + Abs xs + 0.76 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12088,33 +12088,33 @@ 120Sn 1 - - mmabs/l (Ã…-2) - 3.91E12 - - - Abs xs - 0.14 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.91E12 M (amu) 120.0 + + Coh b + 6.49 + Dens (g/cm3) 0.0 - Coh b - 6.49 + Abs xs + 0.14 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12126,33 +12126,33 @@ 33S 1 - - mmabs/l (Ã…-2) - 5.48E13 - - - Abs xs - 0.54 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.48E13 M (amu) 33.0 + + Coh b + 4.74 + Dens (g/cm3) 0.0 - Coh b - 4.74 + Abs xs + 0.54 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12164,33 +12164,33 @@ 146Nd 1 - - mmabs/l (Ã…-2) - 3.21E13 - - - Abs xs - 1.4 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 3.21E13 M (amu) 146.0 + + Coh b + 8.7 + Dens (g/cm3) 0.0 - Coh b - 8.7 + Abs xs + 1.4 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12202,33 +12202,33 @@ Ho 1 - - mmabs/l (Ã…-2) - 1.31E15 - - - Abs xs - 64.7 - Inc xs 0.36 - Dens (at/nm3) - 32.11 + mmabs/l (Ã…-2) + 1.31E15 M (amu) 164.93 + + Coh b + 8.01 + Dens (g/cm3) 8.79 - Coh b - 8.01 + Abs xs + 64.7 + + + Dens (at/nm3) + 32.11 mminc (Ã…-1) @@ -12240,33 +12240,33 @@ Hg 1 - - mmabs/l (Ã…-2) - 6.21E15 - - - Abs xs - 372.3 - Inc xs 6.6 - Dens (at/nm3) - 40.81 + mmabs/l (Ã…-2) + 6.21E15 M (amu) 200.59 + + Coh b + 12.692 + Dens (g/cm3) 13.59 - Coh b - 12.692 + Abs xs + 372.3 + + + Dens (at/nm3) + 40.81 mminc (Ã…-1) @@ -12278,33 +12278,33 @@ 142Nd 1 - - mmabs/l (Ã…-2) - 4.41E14 - - - Abs xs - 18.7 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 4.41E14 M (amu) 142.0 + + Coh b + 7.7 + Dens (g/cm3) 0.0 - Coh b - 7.7 + Abs xs + 18.7 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12316,33 +12316,33 @@ Hf 1 - - mmabs/l (Ã…-2) - 1.95E15 - - - Abs xs - 104.1 - Inc xs 2.6 - Dens (at/nm3) - 44.91 + mmabs/l (Ã…-2) + 1.95E15 M (amu) 178.49 + + Coh b + 7.7 + Dens (g/cm3) 13.31 - Coh b - 7.7 + Abs xs + 104.1 + + + Dens (at/nm3) + 44.91 mminc (Ã…-1) @@ -12354,33 +12354,33 @@ He 1 - - mmabs/l (Ã…-2) - 6.25E12 - - - Abs xs - 0.00747 - Inc xs 0.0 - Dens (at/nm3) - 0.03 + mmabs/l (Ã…-2) + 6.25E12 M (amu) 4.0026 + + Coh b + 3.26 + Dens (g/cm3) 0.0 - Coh b - 3.26 + Abs xs + 0.00747 + + + Dens (at/nm3) + 0.03 mminc (Ã…-1) @@ -12392,33 +12392,33 @@ 32S 1 - - mmabs/l (Ã…-2) - 5.65E13 - - - Abs xs - 0.54 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.65E13 M (amu) 32.0 + + Coh b + 2.804 + Dens (g/cm3) 0.0 - Coh b - 2.804 + Abs xs + 0.54 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12430,33 +12430,33 @@ 149Sm 1 - - mmabs/l (Ã…-2) - 9.46E17 - - - Abs xs - 42080.0 - Inc xs 137.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.46E17 M (amu) 149.0 + + Coh b + -19.2 + Dens (g/cm3) 0.0 - Coh b - -19.2 + Abs xs + 42080.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12468,33 +12468,33 @@ 158Dy 1 - - mmabs/l (Ã…-2) - 9.11E14 - - - Abs xs - 43.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 9.11E14 M (amu) 158.0 + + Coh b + 6.0 + Dens (g/cm3) 0.0 - Coh b - 6.0 + Abs xs + 43.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12506,33 +12506,33 @@ 58Ni 1 - - mmabs/l (Ã…-2) - 2.66E14 - - - Abs xs - 4.6 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 2.66E14 M (amu) 58.0 + + Coh b + 14.4 + Dens (g/cm3) 0.0 - Coh b - 14.4 + Abs xs + 4.6 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12544,33 +12544,33 @@ 196Hg 1 - - mmabs/l (Ã…-2) - 5.26E16 - - - Abs xs - 3080.0 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.26E16 M (amu) 196.0 + + Coh b + 30.3 + Dens (g/cm3) 0.0 - Coh b - 30.3 + Abs xs + 3080.0 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12582,33 +12582,33 @@ 176Yb 1 - - mmabs/l (Ã…-2) - 5.42E13 - - - Abs xs - 2.85 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 5.42E13 M (amu) 176.0 + + Coh b + 8.72 + Dens (g/cm3) 0.0 - Coh b - 8.72 + Abs xs + 2.85 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12620,33 +12620,33 @@ 172Yb 1 - - mmabs/l (Ã…-2) - 1.56E13 - - - Abs xs - 0.8 - Inc xs 0.0 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 1.56E13 M (amu) 172.0 + + Coh b + 9.43 + Dens (g/cm3) 0.0 - Coh b - 9.43 + Abs xs + 0.8 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12658,33 +12658,33 @@ Ge 1 - - mmabs/l (Ã…-2) - 1.01E14 - - - Abs xs - 2.2 - Inc xs 0.18 - Dens (at/nm3) - 44.38 + mmabs/l (Ã…-2) + 1.01E14 M (amu) 72.59 + + Coh b + 8.185 + Dens (g/cm3) 5.35 - Coh b - 8.185 + Abs xs + 2.2 + + + Dens (at/nm3) + 44.38 mminc (Ã…-1) @@ -12696,33 +12696,33 @@ 117Sn 1 - - mmabs/l (Ã…-2) - 6.58E13 - - - Abs xs - 2.3 - Inc xs 0.3 - Dens (at/nm3) - 0.0 + mmabs/l (Ã…-2) + 6.58E13 M (amu) 117.0 + + Coh b + 6.48 + Dens (g/cm3) 0.0 - Coh b - 6.48 + Abs xs + 2.3 + + + Dens (at/nm3) + 0.0 mminc (Ã…-1) @@ -12734,33 +12734,33 @@ Gd 1 - - mmabs/l (Ã…-2) - 1.06E18 - - - Abs xs - 49700.0 - Inc xs 151.0 - Dens (at/nm3) - 30.26 + mmabs/l (Ã…-2) + 1.06E18 M (amu) 157.25 + + Coh b + 6.5 + Dens (g/cm3) 7.9 - Coh b - 6.5 + Abs xs + 49700.0 + + + Dens (at/nm3) + 30.26 mminc (Ã…-1) diff --git a/src/org.eclipse.ice.viz.service.visit/src/org/eclipse/ice/viz/service/visit/VisItPlotRender.java b/src/org.eclipse.ice.viz.service.visit/src/org/eclipse/ice/viz/service/visit/VisItPlotRender.java index 2bed1afe3..1da388096 100644 --- a/src/org.eclipse.ice.viz.service.visit/src/org/eclipse/ice/viz/service/visit/VisItPlotRender.java +++ b/src/org.eclipse.ice.viz.service.visit/src/org/eclipse/ice/viz/service/visit/VisItPlotRender.java @@ -15,6 +15,7 @@ import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; import visit.java.client.ViewerMethods; @@ -121,7 +122,7 @@ public class VisItPlotRender extends ConnectionPlotRender { * java.lang.Object) */ @Override - protected Composite createPlotComposite(Composite parent, int style, + protected Composite createPlotComposite(final Composite parent, int style, VisItSwtConnection connection) throws Exception { // Create a new window on the VisIt server if one does not already @@ -166,6 +167,13 @@ public class VisItPlotRender extends ConnectionPlotRender { @Override public void menuShown(MenuEvent e) { + // Rebuild the menu. + Menu menu = (Menu) e.widget; + if (parent.getMenu() == null) { + for (MenuItem item : menu.getItems()) { + item.dispose(); + } + } repTree.getContributionItem().fill((Menu) e.widget, -1); } }); diff --git a/src/org.eclipse.ice.viz.service/.classpath b/src/org.eclipse.ice.viz.service/.classpath index 098194ca4..b1dabee38 100644 --- a/src/org.eclipse.ice.viz.service/.classpath +++ b/src/org.eclipse.ice.viz.service/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/src/org.eclipse.ice.viz.service/META-INF/MANIFEST.MF b/src/org.eclipse.ice.viz.service/META-INF/MANIFEST.MF index 018811b40..c48bdfec2 100644 --- a/src/org.eclipse.ice.viz.service/META-INF/MANIFEST.MF +++ b/src/org.eclipse.ice.viz.service/META-INF/MANIFEST.MF @@ -5,10 +5,13 @@ Bundle-SymbolicName: org.eclipse.ice.viz.service;singleton:=true Bundle-Version: 2.0.0 Bundle-Vendor: Oak Ridge National Laboratory Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.core.commands.common, +Import-Package: org.eclipse.core.commands, + org.eclipse.core.commands.common, org.eclipse.core.runtime;version="3.4.0", + org.eclipse.core.runtime.jobs, org.eclipse.core.runtime.preferences, org.eclipse.draw2d, + org.eclipse.e4.ui.workbench, org.eclipse.equinox.security.storage;version="1.0.0", org.eclipse.ice.analysistool, org.eclipse.ice.client.common, @@ -32,8 +35,10 @@ Import-Package: org.eclipse.core.commands.common, org.eclipse.swt.widgets, org.eclipse.ui, org.eclipse.ui.dialogs, + org.eclipse.ui.forms, org.eclipse.ui.forms.events, org.eclipse.ui.forms.widgets, + org.eclipse.ui.internal.registry, org.eclipse.ui.part, org.eclipse.ui.preferences, org.osgi.framework;version="1.7.0", @@ -41,7 +46,8 @@ Import-Package: org.eclipse.core.commands.common, Export-Package: org.eclipse.ice.viz.service, org.eclipse.ice.viz.service.connections, org.eclipse.ice.viz.service.csv, + org.eclipse.ice.viz.service.internal, org.eclipse.ice.viz.service.preferences -Service-Component: OSGI-INF/vizFactory.xml +Service-Component: OSGI-INF/vizFactory.xml, OSGI-INF/VizServiceFactoryHolder.xml Require-Bundle: org.eclipse.nebula.visualization.widgets;bundle-version="1.0.0", org.eclipse.nebula.visualization.xygraph;bundle-version="1.0.0" diff --git a/src/org.eclipse.ice.viz.service/OSGI-INF/VizServiceFactoryHolder.xml b/src/org.eclipse.ice.viz.service/OSGI-INF/VizServiceFactoryHolder.xml new file mode 100644 index 000000000..17c1785ad --- /dev/null +++ b/src/org.eclipse.ice.viz.service/OSGI-INF/VizServiceFactoryHolder.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/org.eclipse.ice.viz.service/build.properties b/src/org.eclipse.ice.viz.service/build.properties index e64965053..3d482ec99 100644 --- a/src/org.eclipse.ice.viz.service/build.properties +++ b/src/org.eclipse.ice.viz.service/build.properties @@ -3,5 +3,6 @@ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ OSGI-INF/vizFactory.xml,\ + OSGI-INF/VizServiceFactoryHolder.xml,\ plugin.xml source.. = src/ diff --git a/src/org.eclipse.ice.viz.service/plugin.xml b/src/org.eclipse.ice.viz.service/plugin.xml index 8d9dbcf73..1a3277a9c 100644 --- a/src/org.eclipse.ice.viz.service/plugin.xml +++ b/src/org.eclipse.ice.viz.service/plugin.xml @@ -17,4 +17,89 @@ class="org.eclipse.ice.viz.service.VizPreferenceInitializer"> + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/BasicVizServiceFactory.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/BasicVizServiceFactory.java index 5d1b72658..16444de85 100644 --- a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/BasicVizServiceFactory.java +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/BasicVizServiceFactory.java @@ -12,11 +12,18 @@ package org.eclipse.ice.viz.service; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import org.eclipse.ice.viz.service.csv.CSVVizService; import org.eclipse.ice.viz.service.preferences.CustomScopedPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.ui.IFileEditorMapping; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.internal.registry.EditorDescriptor; +import org.eclipse.ui.internal.registry.EditorRegistry; +import org.eclipse.ui.internal.registry.FileEditorMapping; /** * This class is the basic implementation of the IVizServiceFactory in ICE. It @@ -74,6 +81,31 @@ public class BasicVizServiceFactory implements IVizServiceFactory { // Put the service in service map so it can be retrieved later serviceMap.put(name, service); + Set supportedExtensions = new HashSet(); + supportedExtensions + .addAll(((AbstractVizService) service).supportedExtensions); + + // Register the plot editor as default editor for all file + // extensions handled by the new viz service + for (String ext : supportedExtensions) { + EditorRegistry editorReg = (EditorRegistry) PlatformUI + .getWorkbench().getEditorRegistry(); + EditorDescriptor editor = (EditorDescriptor) editorReg + .findEditor("org.eclipse.ice.viz.service.PlotEditor"); + FileEditorMapping mapping = new FileEditorMapping(ext); + mapping.addEditor(editor); + mapping.setDefaultEditor(editor); + + IFileEditorMapping[] mappings = editorReg + .getFileEditorMappings(); + FileEditorMapping[] newMappings = new FileEditorMapping[mappings.length + 1]; + for (int i = 0; i < mappings.length; i++) { + newMappings[i] = (FileEditorMapping) mappings[i]; + } + newMappings[mappings.length] = mapping; + editorReg.setFileEditorMappings(newMappings); + } + System.out.println("VizServiceFactory message: " + "Viz service \"" + name + "\" registered."); diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditor.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditor.java new file mode 100644 index 000000000..dd477fba7 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditor.java @@ -0,0 +1,403 @@ +package org.eclipse.ice.viz.service; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.ice.client.common.ActionTree; +import org.eclipse.ice.viz.service.internal.VizServiceFactoryHolder; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.ToolBarManager; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.ToolBar; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.forms.IManagedForm; +import org.eclipse.ui.forms.ManagedForm; +import org.eclipse.ui.part.EditorPart; +import org.eclipse.ui.part.FileEditorInput; + +/** + * This class implements a plot editor. It can make use of any VizService + * registered to the BasicVizServiceFactory. + * + * @author Robert Smith + * + */ + +public class PlotEditor extends EditorPart { + /** + * Plot editor ID for external reference. + */ + public static final String ID = "org.eclipse.ice.viz.service.PlotEditor"; + + /** + * The FileEditorInput containing the plot the editor contains. + */ + private FileEditorInput plot; + private ManagedForm form; + + /** + * Default constructor. + */ + public PlotEditor() { + super(); + return; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + public void doSave(IProgressMonitor monitor) { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#doSaveAs() + */ + @Override + public void doSaveAs() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, + * org.eclipse.ui.IEditorInput) + */ + @Override + public void init(IEditorSite site, IEditorInput input) + throws PartInitException { + setSite(site); + setInput(input); + return; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#isDirty() + */ + @Override + public boolean isDirty() { + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() + */ + @Override + public boolean isSaveAsAllowed() { + return false; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets + * .Composite) + */ + @Override + public void createPartControl(final Composite parent) { + setPartName("Plot Editor"); + form = new ManagedForm(parent); + createFormContent(form); + return; + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + } + + /* + * + */ + IEditorPart openEditor(IEditorInput input, String editorId) { + return this; + } + + /** + * Opens a plot editor window. All visualization services are taken from the + * BasicVizServiceFactory. If one can render the given file extension, it is + * used. If multiple services can render the file type, the user is queried + * as to which to use. + * + * @param managedForm + */ + private void createFormContent(final IManagedForm managedForm) { + plot = (FileEditorInput) getEditorInput(); + final URI filepath = plot.getURI(); + + // Get the VizServiceFactory and all Viz Services + VizServiceFactoryHolder factoryHolder = new VizServiceFactoryHolder(); + final BasicVizServiceFactory factory = (BasicVizServiceFactory) factoryHolder + .getFactory(); + + // An array of all registered service names. + String[] fullServiceNames = factory.getServiceNames(); + + // An ArrayList of all registered service names. + final ArrayList serviceNames = new ArrayList(); + AbstractVizService service = null; + + // An ArrayList of PlotEditorInputs, one created with each VizService + // capable of handling the file type. + ArrayList inputArray = new ArrayList(); + + for (int i = 0; i < fullServiceNames.length; i++) { + + service = (AbstractVizService) factory.get(fullServiceNames[i]); + + // If this service can handle the file extension, create a + // PlotEditorInput and add its name to the list of applicable + // services. + if (service != null && service.extensionSupported(filepath)) { + IPlot plot = null; + try { + plot = service.createPlot(filepath); + inputArray.add(new PlotEditorInput(plot)); + serviceNames.add(fullServiceNames[i]); + } catch (Exception e1) { + System.out + .println("Problem creating plot with visualization service " + + fullServiceNames[i] + "."); + } + + } + + } + + // If all available services failed to create a plot, give the user an + // error message. + if (serviceNames.isEmpty()) { + System.out + .println("All available visualizaiton services failed to render a plot."); + Status status = new Status(IStatus.ERROR, "org.eclipse.ice", 0, + "No visualization service could render the file.", null); + ErrorDialog + .openError( + Display.getCurrent().getActiveShell(), + "Visualization Failed", + "All visualization services failed to render a plot. \n" + + "If you are using an external rendering program, make sure it is connected to ICE.", + status); + return; + } + + // The number of services which succeeded in creating PlotEditorInputs + int numServices = serviceNames.size(); + + // Set up the editor window. + final Composite body = form.getForm().getBody(); + GridLayout grid = new GridLayout(); + grid.marginHeight = 0; + grid.marginWidth = 0; + body.setLayout(grid); + + // Array of names of all services which succeeded in creating + // PlotEditorInputs + String[] serviceNamesArray = new String[serviceNames.size()]; + serviceNames.toArray(serviceNamesArray); + + // The PlotEditorInput containing the IPlot rendered with the service + // selected for this editor. + final PlotEditorInput selectedService; + + // If more than one service is applicable, create a dialog window to + // prompt the user for which is to be used. Else, use the single + // available service. + if (numServices > 1) { + PlotEditorDialog dialog = new PlotEditorDialog(PlatformUI + .getWorkbench().getActiveWorkbenchWindow().getShell()); + dialog.createDialogArea(new Shell(), serviceNamesArray); + selectedService = inputArray.get(dialog.getSelection()); + } else { + selectedService = inputArray.get(0); + } + + // Reference to this editor instance + final IEditorPart thisEditor = this; + + // Finish loading and drawing the plot in a new thread. + Job drawPlot = new Job("Plot Editor Loading and Rendering") { + @Override + protected IStatus run(IProgressMonitor monitor) { + // Temporary holder for plot types available from the selected + // service + Map selectedServiceTypesTemp = null; + try { + selectedServiceTypesTemp = selectedService.getPlot() + .getPlotTypes(); + } catch (Exception e2) { + System.out.println("Error reading plot types."); + } + + // While loading is not yet complete, wait and periodically + // attempt to read the plot types again. + while (selectedServiceTypesTemp == null + || selectedServiceTypesTemp.isEmpty()) { + try { + Thread.sleep(500); + selectedServiceTypesTemp = selectedService.getPlot() + .getPlotTypes(); + } catch (Exception e1) { + System.out.println("Error reading plot types."); + } + } + + // Plot types available form the selected service + final Map selectedServiceTypes = selectedServiceTypesTemp; + + // The plot categories available from the selected service. + final Set selectedCategorySet = selectedServiceTypes + .keySet(); + + // An array containing the plot categories available from the + // selected service + String[] selectedCategoryArray = selectedCategorySet + .toArray(new String[selectedCategorySet.size()]); + + // The category to use for drawing the plot initially + final String selectedCategory = selectedCategoryArray[0]; + + // The plot type to use for drawing the plot initially. + final String selectedPlotType = selectedServiceTypes + .get(selectedCategory)[0]; + + // Toolbar for the editor window + final ToolBarManager barManager = new ToolBarManager(); + + // Thread for creating the editor UI + body.getDisplay().asyncExec(new Runnable() { + + @Override + public void run() { + // Finish setting up the editor window + ToolBar bar = barManager.createControl(body); + final Composite plotComposite = new Composite(body, + SWT.NONE); + + // Menu manager for toolbar + MenuManager menu = new MenuManager("Menu"); + + // Top level menu + ActionTree menuTree = new ActionTree("Menu"); + + // Second level menu for plot category selection + ActionTree categoriesTree = new ActionTree( + "Plot Categories"); + menuTree.add(categoriesTree); + + // Add all categories and plot types to mene + for (final String category : selectedCategorySet) { + + // Third level menu for plot type selection within a + // specific category + ActionTree plotTree = new ActionTree(category); + categoriesTree.add(plotTree); + + for (final String type : selectedServiceTypes + .get(category)) { + + // A menu item to redraw the plot with the + // selected category and plot type + Action tempAction = new Action(type) { + @Override + public void run() { + try { + selectedService.getPlot().draw( + category, type, + plotComposite); + } catch (Exception e) { + System.out + .println("Error while drawing plot."); + } + } + + }; + plotTree.add(new ActionTree(tempAction)); + + } + + } + + // An action to close the current editor window + Action close = new Action("Close") { + @Override + public void run() { + thisEditor.getEditorSite().getPage() + .closeEditor(thisEditor, false); + } + }; + + // Add close action directly under menu + menuTree.add(new ActionTree(close)); + + // Update menu + categoriesTree.getContributionItem().fill( + menu.getMenu(), -1); + menu.updateAll(true); + barManager.add(menuTree.getContributionItem()); + + bar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, + true, false)); + managedForm.getToolkit().adapt(bar); + barManager.update(true); + + plotComposite.setBackground(body.getBackground()); + plotComposite.setLayoutData(new GridData(SWT.FILL, + SWT.FILL, true, true)); + plotComposite.setLayout(new FillLayout()); + + // Draw the plot. + try { + selectedService.getPlot().draw(selectedCategory, + selectedPlotType, plotComposite); + } catch (Exception e) { + System.out.println("Error drawing plot."); + } + + body.layout(); + + } + }); + return Status.OK_STATUS; + } + + }; + + drawPlot.schedule(); + + } + +} diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorDialog.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorDialog.java new file mode 100644 index 000000000..fea4d9cf7 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorDialog.java @@ -0,0 +1,137 @@ +package org.eclipse.ice.viz.service; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; + +/** + * A dialog box for querying the user about which visualization service to use + * during the opening of a PlotEditor. + * + * @author Robert Smith + * + */ +public class PlotEditorDialog extends Dialog { + // The index of the visualization service selected by the user in the combo + // box. + int selectedServiceIndex; + + /** + * Default constructor. + * + * @param parentShell + */ + protected PlotEditorDialog(Shell parentShell) { + super(parentShell); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets + * .Composite) + */ + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + return container; + } + + /** + * Get method for the index of the selected service. + * + * @return The index of the service selected by the user form the combo box. + */ + protected int getSelection() { + return selectedServiceIndex; + } + + /** + * Creates the dialog box. + * + * @param parent + * The parent composite + * @param serviceNamesArray + * An array of names of available services to populate the combo + * box. + * @return Returns the dialog window's composite. + */ + protected Control createDialogArea(Composite parent, + String[] serviceNamesArray) { + // Set up the window. + Composite container = (Composite) super.createDialogArea(parent); + Display display = Display.getCurrent(); + final Shell shell = container.getShell(); + final Combo combo = new Combo(shell, SWT.NONE); + + shell.setText("Open a Visualization File"); + shell.setLayout(new GridLayout()); + combo.setItems(serviceNamesArray); + combo.setText("Select a visualization service."); + + // Update the selected index when the user makes a new selection. + combo.addListener(SWT.DefaultSelection, new Listener() { + @Override + public void handleEvent(Event e) { + selectedServiceIndex = combo.getSelectionIndex(); + } + }); + combo.setLayoutData(new GridData(SWT.CENTER)); + Button button = new Button(shell, SWT.PUSH); + button.setText("Ok"); + + // Close the window when the ok button is pressed. + button.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + shell.close(); + } + }); + button.setLayoutData(new GridData(SWT.CENTER)); + shell.setDefaultButton(button); + shell.setSize(200, 100); + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + + return container; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets + * .Shell) + */ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.dialogs.Dialog#getInitialSize() + */ + @Override + protected Point getInitialSize() { + return new Point(250, 100); + } + +} diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorInput.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorInput.java new file mode 100644 index 000000000..f183fa9ab --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/PlotEditorInput.java @@ -0,0 +1,101 @@ +package org.eclipse.ice.viz.service; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; + +/** + * An EditorInput for the PlotEditor. + * + * @author Robert Smith + * + */ +public class PlotEditorInput implements IEditorInput { + /** + * The plot to be rendered by the PlotEditor + */ + private IPlot data; + + /** + * Constructor. + * + * @param input + * The IPlot to be rendered by the plot editor. + */ + public PlotEditorInput(IPlot input) { + data = input; + } + + /** + * Getter for the input plot. + * + * @return the plot that is to be rendered by the plot editor. + */ + public IPlot getPlot() { + return data; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @Override + public Object getAdapter(Class adapter) { + return null; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#exists() + */ + @Override + public boolean exists() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getImageDescriptor() + */ + @Override + public ImageDescriptor getImageDescriptor() { + return ImageDescriptor.getMissingImageDescriptor(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getName() + */ + @Override + public String getName() { + String name = data.getDataSource().toString(); + return name; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getPersistable() + */ + @Override + public IPersistableElement getPersistable() { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorInput#getToolTipText() + */ + @Override + public String getToolTipText() { + // TODO Auto-generated method stub + return data.getDataSource().toString(); + } + +} diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/csv/CSVPlot.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/csv/CSVPlot.java index fcf8aaa59..d27b082a8 100644 --- a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/csv/CSVPlot.java +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/csv/CSVPlot.java @@ -30,6 +30,7 @@ import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; /** * This class implements the IPlot interface to provide access to a basic CSV @@ -366,7 +367,7 @@ public class CSVPlot implements IPlot { * The {@code Composite} in which to draw the CSV plot * editor. */ - public DrawnPlot(Composite parent) throws Exception { + public DrawnPlot(final Composite parent) throws Exception { // Create the editor and all required providers. editor = new CSVPlotEditor(); dataProvider = baseProvider; @@ -443,12 +444,19 @@ public class CSVPlot implements IPlot { @Override public void menuShown(MenuEvent e) { + // Rebuild the menu. Menu menu = (Menu) e.widget; + if (parent.getMenu() == null) { + for (MenuItem item : menu.getItems()) { + item.dispose(); + } + } addSeriesTree.getContributionItem().fill(menu, -1); removeSeriesTree.getContributionItem().fill(menu, -1); separator.fill(menu, -1); clearAction.getContributionItem().fill(menu, -1); + } }); diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/internal/VizServiceFactoryHolder.java b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/internal/VizServiceFactoryHolder.java new file mode 100644 index 000000000..f2351a3d9 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/internal/VizServiceFactoryHolder.java @@ -0,0 +1,44 @@ +package org.eclipse.ice.viz.service.internal; + +import org.eclipse.ice.viz.service.IVizServiceFactory; + +/** + * Holder class for a VizServiceFactory. + * + * @author Robert Smith + * + */ + +public class VizServiceFactoryHolder { + private static IVizServiceFactory factory; + + /** + * Setter for the VizServiceFactory. + * + * @param input + * the VizServiceFactory to hold + */ + public static void setVizServiceFactory(IVizServiceFactory input) { + VizServiceFactoryHolder.factory = input; + return; + } + + /** + * Remove the held VizServiceFactory. + * + */ + public static void unsetVizServiceFactory() { + factory = null; + return; + } + + /** + * Getter for the held VizServiceFactory. + * + * @return the held VizServiceFactory + */ + public static IVizServiceFactory getFactory() { + return factory; + } + +} diff --git a/src/org.eclipse.ice.viz/plugin.xml b/src/org.eclipse.ice.viz/plugin.xml index 43737d701..64e4944d7 100644 --- a/src/org.eclipse.ice.viz/plugin.xml +++ b/src/org.eclipse.ice.viz/plugin.xml @@ -1,5 +1,3 @@ - - - + \ No newline at end of file diff --git a/tests/org.eclipse.ice.viz.service.test/META-INF/MANIFEST.MF b/tests/org.eclipse.ice.viz.service.test/META-INF/MANIFEST.MF index c0a8978ad..9bf4e702e 100644 --- a/tests/org.eclipse.ice.viz.service.test/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.ice.viz.service.test/META-INF/MANIFEST.MF @@ -10,6 +10,7 @@ Import-Package: org.eclipse.ice.datastructures.ICEObject, org.eclipse.ice.viz.service, org.eclipse.ice.viz.service.connections, org.eclipse.ice.viz.service.csv, + org.eclipse.ice.viz.service.internal, org.eclipse.swt.widgets Require-Bundle: org.junit, org.eclipse.swtbot.eclipse.core;bundle-version="2.2.1", diff --git a/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/internal/test/VizServiceFactoryHolderTester.java b/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/internal/test/VizServiceFactoryHolderTester.java new file mode 100644 index 000000000..5c12ce7c4 --- /dev/null +++ b/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/internal/test/VizServiceFactoryHolderTester.java @@ -0,0 +1,86 @@ +package org.eclipse.ice.viz.service.internal.test; + +import static org.junit.Assert.*; + +import org.eclipse.ice.viz.service.BasicVizServiceFactory; +import org.eclipse.ice.viz.service.IVizService; +import org.eclipse.ice.viz.service.IVizServiceFactory; +import org.eclipse.ice.viz.service.internal.VizServiceFactoryHolder; +import org.eclipse.ice.viz.service.test.FakeVizService; +import org.junit.Test; + +public class VizServiceFactoryHolderTester { + + /** + * Checks that the factory holder's methods for registering, getting, and + * removing a factory are functioning. + * + */ + @Test + public void checkFactorySetting() { + + // Create a test factory with a test service. + IVizServiceFactory factory = new FakeVizServiceFactory(); + String serviceName = "TestService"; + IVizService service = new FakeVizService(serviceName); + factory.register(service); + + VizServiceFactoryHolder holder = new VizServiceFactoryHolder(); + + // Test that the factory has been registered + holder.setVizServiceFactory(factory); + assertNotNull(holder.getFactory()); + + // Test that the factory in the holder is the same factory registered. + assertEquals("TestService", holder.getFactory().getServiceNames()[0]); + + // Test that the holder is empty after removing the factory. + holder.unsetVizServiceFactory(); + assertNull(holder.getFactory()); + + } + + /** + * Creates a basic VizServiceFactory for testing purposes. + * + * @author Robert Smith + * + */ + private class FakeVizServiceFactory implements IVizServiceFactory { + private IVizService service; + + @Override + public void register(IVizService newService) { + // TODO Auto-generated method stub + service = newService; + } + + @Override + public void unregister(IVizService service) { + // TODO Auto-generated method stub + + } + + @Override + public String[] getServiceNames() { + // TODO Auto-generated method stub + String[] serviceNames = new String[1]; + serviceNames[0] = service.getName(); + return serviceNames; + } + + @Override + public IVizService get(String serviceName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public IVizService get() { + // TODO Auto-generated method stub + return null; + } + + } + +} diff --git a/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorDialogTester.java b/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorDialogTester.java new file mode 100644 index 000000000..a8a53a998 --- /dev/null +++ b/tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorDialogTester.java @@ -0,0 +1,27 @@ +package org.eclipse.ice.viz.service.test; + +import static org.junit.Assert.*; + +import org.eclipse.swtbot.swt.finder.SWTBot; +import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(SWTBotJunit4ClassRunner.class) +public class PlotEditorDialogTester { + private static SWTBot bot; + + @BeforeClass + public static void beforeClass() throws Exception { + bot = new SWTBot(); + } + + @Test + public void checkCombo() { + bot.comboBox().setSelection("ice-plot"); + assertEquals("ice-plot",bot.comboBox().selection()); + bot.button().click(); + } + +} -- GitLab From dac877c430619dd9f4194ef6eb653f8767b1c129 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Wed, 24 Jun 2015 11:37:09 -0400 Subject: [PATCH 2/3] Add test for PlotEditor Adds a SWTBot test case for the plot editor. --- .../ice/client/widgets/mesh/MeshAppState.java | 4 +- .../reactoreditor/ToolItemMenuListener.java | 2 +- .../ice/client/common/CoreConnectDialog.java | 2 +- .../client/common/wizards/NewItemWizard.java | 2 +- .../data/userMatDB.xml | 376 +- .../org/eclipse/ice/nek5000/NekWriter.java | 100 +- src/org.eclipse.ice.viz.service/plugin.xml | 76 +- .../schema/org.eclipse.ui.perspectives.exsd | 84 + .../eclipse/ice/viz/service/.metadata/.lock | 0 .../eclipse/ice/viz/service/.metadata/.log | 64 + .../.metadata/.mylyn/repositories.xml.zip | Bin 0 -> 442 bytes .../.plugins/org.eclipse.cdt.core/.log | 1 + .../org.eclipse.cdt.make.core/specs.c | 1 + .../org.eclipse.cdt.make.core/specs.cpp | 1 + .../.indexes/properties.index | Bin 0 -> 80 bytes .../GitProjectData.properties | 3 + .../.root/.indexes/history.version | 1 + .../.root/.indexes/properties.index | Bin 0 -> 151 bytes .../.root/.indexes/properties.version | 1 + .../org.eclipse.core.resources/.root/1.tree | Bin 0 -> 485 bytes .../.safetable/org.eclipse.core.resources | Bin 0 -> 991 bytes .../.settings/org.eclipse.cdt.ui.prefs | 4 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.debug.ui.prefs | 2 + .../.settings/org.eclipse.egit.core.prefs | 2 + .../.settings/org.eclipse.jdt.ui.prefs | 15 + .../.settings/org.eclipse.m2e.discovery.prefs | 2 + .../org.eclipse.mylyn.context.core.prefs | 2 + .../org.eclipse.mylyn.monitor.ui.prefs | 2 + .../org.eclipse.mylyn.tasks.ui.prefs | 3 + .../.settings/org.eclipse.rse.core.prefs | 2 + .../.settings/org.eclipse.rse.ui.prefs | 2 + .../.settings/org.eclipse.team.cvs.ui.prefs | 2 + .../.settings/org.eclipse.team.ui.prefs | 2 + .../.settings/org.eclipse.ui.ide.prefs | 5 + .../.settings/org.eclipse.ui.workbench.prefs | 4 + .../org.eclipse.e4.workbench/workbench.xmi | 3349 +++++++++++++++++ .../org.eclipse.jdt.core/invalidArchivesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 0 -> 4 bytes .../variablesAndContainers.dat | Bin 0 -> 129 bytes .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 + .../QualifiedTypeNameHistory.xml | 2 + .../org.eclipse.jdt.ui/dialog_settings.xml | 5 + .../org.eclipse.mylyn.github.ui/avatars.ser | Bin 0 -> 175 bytes .../photran70vpg-log.txt | 0 .../photran70vpg.new | 0 .../.plugins/org.eclipse.rse.core/.log | 0 ...al.core.RSELocalConnectionInitializer.mark | 0 .../FP.local.files_0/node.properties | 57 + .../node.properties | 15 + .../H.local_16/node.properties | 32 + .../PRF.ultrafluffy_1056/node.properties | 8 + .../.plugins/org.eclipse.rse.ui/.log | 0 .../org.eclipse.ui.ide/dialog_settings.xml | 146 + .../dialog_settings.xml | 28 + .../ice/viz/service/.metadata/version.ini | 1 + .../eclipse/ice/viz/service/PlotEditor.java | 16 +- .../ice/viz/service/PlotEditorDialog.java | 4 +- .../ice/viz/service/PlotEditorInput.java | 2 - .../service/RemoteSystemsTempFiles/.project | 12 + .../service/RemoteSystemsTempFiles/fib8.csv | 10 + .../RemoteSystemsTempFiles/fib8bad.csv | 10 + .../internal/VizServiceFactoryHolder.java | 2 +- .../.classpath | 14 +- .../META-INF/MANIFEST.MF | 12 +- .../service/test/PlotEditorDialogTester.java | 95 +- .../service/test/PlotEditorInputTester.java | 84 + .../viz/service/test/PlotEditorTester.java | 120 + utils/ICEDocCleaner/bin/.gitignore | 1 - utils/ICEDocCleaner/bin/ICEDocCleaner.class | Bin 0 -> 3831 bytes 70 files changed, 4427 insertions(+), 369 deletions(-) create mode 100644 src/org.eclipse.ice.viz.service/schema/org.eclipse.ui.perspectives.exsd create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.lock create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.log create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.mylyn/repositories.xml.zip create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.core/.log create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.photran.core.vpg/photran70vpg-log.txt create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.photran.core.vpg/photran70vpg.new create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/.log create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.ultrafluffy_1056/FP.local.files_0/node.properties create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.ultrafluffy_1056/FP.org.eclipse.ptp.remote.rse.core._0/node.properties create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.ultrafluffy_1056/H.local_16/node.properties create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.ultrafluffy_1056/node.properties create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.rse.ui/.log create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/version.ini create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/RemoteSystemsTempFiles/.project create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/RemoteSystemsTempFiles/fib8.csv create mode 100644 src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/RemoteSystemsTempFiles/fib8bad.csv create mode 100644 tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorInputTester.java create mode 100644 tests/org.eclipse.ice.viz.service.test/src/org/eclipse/ice/viz/service/test/PlotEditorTester.java delete mode 100644 utils/ICEDocCleaner/bin/.gitignore create mode 100644 utils/ICEDocCleaner/bin/ICEDocCleaner.class diff --git a/src/org.eclipse.ice.client.widgets.rcp/src/org/eclipse/ice/client/widgets/mesh/MeshAppState.java b/src/org.eclipse.ice.client.widgets.rcp/src/org/eclipse/ice/client/widgets/mesh/MeshAppState.java index b575ae2bd..07885ed6e 100644 --- a/src/org.eclipse.ice.client.widgets.rcp/src/org/eclipse/ice/client/widgets/mesh/MeshAppState.java +++ b/src/org.eclipse.ice.client.widgets.rcp/src/org/eclipse/ice/client/widgets/mesh/MeshAppState.java @@ -1375,7 +1375,7 @@ public class MeshAppState extends ViewAppState implements vSize = vertexSize; vertexSize = (distance < 10f ? 0.0159f * distance + 0.0413f : 0.2f); - if (vSize != vertexSize) { + if (Math.abs(vSize - vertexSize) > 0.001f) { updateVertices = true; vSize = vertexSize; } @@ -1385,7 +1385,7 @@ public class MeshAppState extends ViewAppState implements // changed. eSize = edgeSize; edgeSize = (distance < 10f ? 0.1f * distance + 4f : 5f); - if (eSize != edgeSize) { + if (Math.abs(eSize - edgeSize) > 0.001f) { updateEdges = true; eSize = edgeSize; } diff --git a/src/org.eclipse.ice.client.widgets.reactoreditor/src/org/eclipse/ice/client/widgets/reactoreditor/ToolItemMenuListener.java b/src/org.eclipse.ice.client.widgets.reactoreditor/src/org/eclipse/ice/client/widgets/reactoreditor/ToolItemMenuListener.java index 650e8c405..9255319d0 100644 --- a/src/org.eclipse.ice.client.widgets.reactoreditor/src/org/eclipse/ice/client/widgets/reactoreditor/ToolItemMenuListener.java +++ b/src/org.eclipse.ice.client.widgets.reactoreditor/src/org/eclipse/ice/client/widgets/reactoreditor/ToolItemMenuListener.java @@ -66,7 +66,7 @@ public class ToolItemMenuListener implements Listener { // event.detail == SWT.ARROW means the arrow has been clicked. // event.detail == SWT.NONE means the button has been clicked. - if (event.detail == SWT.ARROW | event.detail == SWT.NONE) { + if (event.detail == SWT.ARROW || event.detail == SWT.NONE) { Rectangle r = toolItem.getBounds(); Point p = new Point(r.x, r.y + r.height); p = toolItem.getParent().toDisplay(p.x, p.y); diff --git a/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/CoreConnectDialog.java b/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/CoreConnectDialog.java index e91a70cbb..e2b91ce64 100644 --- a/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/CoreConnectDialog.java +++ b/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/CoreConnectDialog.java @@ -67,7 +67,7 @@ public class CoreConnectDialog extends Dialog { portLabel.setText("Port: "); // Create a new text box to input port - portField = new Text(comp, SWT.SINGLE | SWT.SINGLE); + portField = new Text(comp, SWT.SINGLE); data = new GridData(GridData.FILL_HORIZONTAL); portField.setLayoutData(data); diff --git a/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/wizards/NewItemWizard.java b/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/wizards/NewItemWizard.java index ee5710ec9..3cb0c6e83 100644 --- a/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/wizards/NewItemWizard.java +++ b/src/org.eclipse.ice.client/src/org/eclipse/ice/client/common/wizards/NewItemWizard.java @@ -111,7 +111,7 @@ public class NewItemWizard extends Wizard implements INewWizard { String selectedItem = page.getSelectedItem(); // Direct the client to create a new Item if a selection was made - if (selectedItem != null && selectedItem != null) { + if (selectedItem != null) { finished = client.createItem(selectedItem) > 0; } diff --git a/src/org.eclipse.ice.materials/data/userMatDB.xml b/src/org.eclipse.ice.materials/data/userMatDB.xml index f34df51c8..c36612a14 100644 --- a/src/org.eclipse.ice.materials/data/userMatDB.xml +++ b/src/org.eclipse.ice.materials/data/userMatDB.xml @@ -10906,6 +10906,44 @@ + + 34S + 1 + + + Inc xs + 0.0 + + + mmabs/l (Ã…-2) + 2.24E13 + + + M (amu) + 34.0 + + + Coh b + 3.48 + + + Dens (g/cm3) + 0.0 + + + Abs xs + 0.227 + + + Dens (at/nm3) + 0.0 + + + mminc (Ã…-1) + 0.0 + + + 195Pt 1 @@ -10945,7 +10983,7 @@ - 34S + 154Gd 1 @@ -10954,15 +10992,15 @@ mmabs/l (Ã…-2) - 2.24E13 + 1.85E15 M (amu) - 34.0 + 154.0 Coh b - 3.48 + 10.0 Dens (g/cm3) @@ -10970,7 +11008,7 @@ Abs xs - 0.227 + 85.0 Dens (at/nm3) @@ -11021,78 +11059,78 @@ - 154Gd + P 1 Inc xs - 0.0 + 0.005 mmabs/l (Ã…-2) - 1.85E15 + 1.86E13 M (amu) - 154.0 + 30.9738 Coh b - 10.0 + 5.13 Dens (g/cm3) - 0.0 + 2.3 Abs xs - 85.0 + 0.172 Dens (at/nm3) - 0.0 + 44.72 mminc (Ã…-1) - 0.0 + 9.72E11 - P + 67Zn 1 Inc xs - 0.005 + 0.28 mmabs/l (Ã…-2) - 1.86E13 + 3.4E14 M (amu) - 30.9738 + 67.0 Coh b - 5.13 + 7.56 Dens (g/cm3) - 2.3 + 0.0 Abs xs - 0.172 + 6.8 Dens (at/nm3) - 44.72 + 0.0 mminc (Ã…-1) - 9.72E11 + 2.52E13 @@ -11135,24 +11173,24 @@ - 67Zn + N 1 Inc xs - 0.28 + 0.5 mmabs/l (Ã…-2) - 3.4E14 + 4.54E14 M (amu) - 67.0 + 14.0067 Coh b - 7.56 + 9.36 Dens (g/cm3) @@ -11160,15 +11198,15 @@ Abs xs - 6.8 + 1.9 Dens (at/nm3) - 0.0 + 0.05 mminc (Ã…-1) - 2.52E13 + 2.15E14 @@ -11211,24 +11249,24 @@ - N + 120Te 1 Inc xs - 0.5 + 0.0 mmabs/l (Ã…-2) - 4.54E14 + 6.42E13 M (amu) - 14.0067 + 120.0 Coh b - 9.36 + 5.3 Dens (g/cm3) @@ -11236,20 +11274,20 @@ Abs xs - 1.9 + 2.3 Dens (at/nm3) - 0.05 + 0.0 mminc (Ã…-1) - 2.15E14 + 0.0 - 120Te + 152Sm 1 @@ -11258,15 +11296,15 @@ mmabs/l (Ã…-2) - 6.42E13 + 4.54E15 M (amu) - 120.0 + 152.0 Coh b - 5.3 + -5.0 Dens (g/cm3) @@ -11274,7 +11312,7 @@ Abs xs - 2.3 + 206.0 Dens (at/nm3) @@ -11325,40 +11363,40 @@ - 152Sm + K 1 Inc xs - 0.0 + 0.27 mmabs/l (Ã…-2) - 4.54E15 + 1.8E14 M (amu) - 152.0 + 39.0963 Coh b - -5.0 + 3.67 Dens (g/cm3) - 0.0 + 0.86 Abs xs - 206.0 + 2.1 Dens (at/nm3) - 0.0 + 13.25 mminc (Ã…-1) - 0.0 + 4.16E13 @@ -11401,40 +11439,40 @@ - K + 161Dy 1 Inc xs - 0.27 + 3.0 mmabs/l (Ã…-2) - 1.8E14 + 1.25E16 M (amu) - 39.0963 + 161.0 Coh b - 3.67 + 10.3 Dens (g/cm3) - 0.86 + 0.0 Abs xs - 2.1 + 600.0 Dens (at/nm3) - 13.25 + 0.0 mminc (Ã…-1) - 4.16E13 + 1.12E14 @@ -11477,24 +11515,24 @@ - 161Dy + 140Ce 1 Inc xs - 3.0 + 0.0 mmabs/l (Ã…-2) - 1.25E16 + 1.36E13 M (amu) - 161.0 + 140.0 Coh b - 10.3 + 4.84 Dens (g/cm3) @@ -11502,7 +11540,7 @@ Abs xs - 600.0 + 0.57 Dens (at/nm3) @@ -11510,7 +11548,7 @@ mminc (Ã…-1) - 1.12E14 + 0.0 @@ -11553,24 +11591,24 @@ - 140Ce + 61Ni 1 Inc xs - 0.0 + 1.9 mmabs/l (Ã…-2) - 1.36E13 + 1.37E14 M (amu) - 140.0 + 61.0 Coh b - 4.84 + 7.6 Dens (g/cm3) @@ -11578,7 +11616,7 @@ Abs xs - 0.57 + 2.5 Dens (at/nm3) @@ -11586,45 +11624,7 @@ mminc (Ã…-1) - 0.0 - - - - - H - 1 - - - Inc xs - 80.26 - - - mmabs/l (Ã…-2) - 1.1E15 - - - M (amu) - 1.0079 - - - Coh b - -3.739 - - - Dens (g/cm3) - 0.0 - - - Abs xs - 0.3326 - - - Dens (at/nm3) - 0.05 - - - mminc (Ã…-1) - 4.79E17 + 1.88E14 @@ -11667,24 +11667,24 @@ - 61Ni + H 1 Inc xs - 1.9 + 80.26 mmabs/l (Ã…-2) - 1.37E14 + 1.1E15 M (amu) - 61.0 + 1.0079 Coh b - 7.6 + -3.739 Dens (g/cm3) @@ -11692,15 +11692,15 @@ Abs xs - 2.5 + 0.3326 Dens (at/nm3) - 0.0 + 0.05 mminc (Ã…-1) - 1.88E14 + 4.79E17 @@ -11743,24 +11743,24 @@ - F + 115In 1 Inc xs - 8.0E-4 + 0.55 mmabs/l (Ã…-2) - 1.69E12 + 5.88E15 M (amu) - 18.9984 + 115.0 Coh b - 5.654 + 4.01 Dens (g/cm3) @@ -11768,37 +11768,37 @@ Abs xs - 0.0096 + 202.0 Dens (at/nm3) - 0.05 + 0.0 mminc (Ã…-1) - 2.53E11 + 2.88E13 - 115In + F 1 Inc xs - 0.55 + 8.0E-4 mmabs/l (Ã…-2) - 5.88E15 + 1.69E12 M (amu) - 115.0 + 18.9984 Coh b - 4.01 + 5.654 Dens (g/cm3) @@ -11806,15 +11806,15 @@ Abs xs - 202.0 + 0.0096 Dens (at/nm3) - 0.0 + 0.05 mminc (Ã…-1) - 2.88E13 + 2.53E11 @@ -12237,78 +12237,78 @@ - Hg + 142Nd 1 Inc xs - 6.6 + 0.0 mmabs/l (Ã…-2) - 6.21E15 + 4.41E14 M (amu) - 200.59 + 142.0 Coh b - 12.692 + 7.7 Dens (g/cm3) - 13.59 + 0.0 Abs xs - 372.3 + 18.7 Dens (at/nm3) - 40.81 + 0.0 mminc (Ã…-1) - 1.98E14 + 0.0 - 142Nd + Hg 1 Inc xs - 0.0 + 6.6 mmabs/l (Ã…-2) - 4.41E14 + 6.21E15 M (amu) - 142.0 + 200.59 Coh b - 7.7 + 12.692 Dens (g/cm3) - 0.0 + 13.59 Abs xs - 18.7 + 372.3 Dens (at/nm3) - 0.0 + 40.81 mminc (Ã…-1) - 0.0 + 1.98E14 @@ -12389,24 +12389,24 @@ - 32S + 149Sm 1 Inc xs - 0.0 + 137.0 mmabs/l (Ã…-2) - 5.65E13 + 9.46E17 M (amu) - 32.0 + 149.0 Coh b - 2.804 + -19.2 Dens (g/cm3) @@ -12414,7 +12414,7 @@ Abs xs - 0.54 + 42080.0 Dens (at/nm3) @@ -12422,29 +12422,29 @@ mminc (Ã…-1) - 0.0 + 5.54E15 - 149Sm + 32S 1 Inc xs - 137.0 + 0.0 mmabs/l (Ã…-2) - 9.46E17 + 5.65E13 M (amu) - 149.0 + 32.0 Coh b - -19.2 + 2.804 Dens (g/cm3) @@ -12452,7 +12452,7 @@ Abs xs - 42080.0 + 0.54 Dens (at/nm3) @@ -12460,7 +12460,7 @@ mminc (Ã…-1) - 5.54E15 + 0.0 @@ -12655,78 +12655,78 @@ - Ge + 117Sn 1 Inc xs - 0.18 + 0.3 mmabs/l (Ã…-2) - 1.01E14 + 6.58E13 M (amu) - 72.59 + 117.0 Coh b - 8.185 + 6.48 Dens (g/cm3) - 5.35 + 0.0 Abs xs - 2.2 + 2.3 Dens (at/nm3) - 44.38 + 0.0 mminc (Ã…-1) - 1.49E13 + 1.54E13 - 117Sn + Ge 1 Inc xs - 0.3 + 0.18 mmabs/l (Ã…-2) - 6.58E13 + 1.01E14 M (amu) - 117.0 + 72.59 Coh b - 6.48 + 8.185 Dens (g/cm3) - 0.0 + 5.35 Abs xs - 2.3 + 2.2 Dens (at/nm3) - 0.0 + 44.38 mminc (Ã…-1) - 1.54E13 + 1.49E13 diff --git a/src/org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekWriter.java b/src/org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekWriter.java index e1fbafc7c..a7f8c9f83 100644 --- a/src/org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekWriter.java +++ b/src/org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekWriter.java @@ -169,10 +169,10 @@ public class NekWriter implements IComponentVisitor { hostname = InetAddress.getLocalHost().getHostName(); String iceHeader = String.format( - "C *** Nek5000 reafile generated by ICE ***\n" - + "C (Eclipse Integrated Computational Environment)\n" - + "C\n" + "C Created: %-30s\n" - + "C User: %-30s\n" + "C Hostname: %-30s", + "C *** Nek5000 reafile generated by ICE ***%n" + + "C (Eclipse Integrated Computational Environment)%n" + + "C%n" + "C Created: %-30s%n" + + "C User: %-30s%n" + "C Hostname: %-30s", date, user, hostname); // Write to the output stream @@ -204,10 +204,10 @@ public class NekWriter implements IComponentVisitor { String currLine; // Construct the header - String paramHeader = String.format(" ****** PARAMETERS *****\n" - + " %9s NEKTON VERSION\n" - + " %d DIMENSIONAL RUN\n" - + " %3d PARAMETERS FOLLOW\n", + String paramHeader = String.format(" ****** PARAMETERS *****%n" + + " %9s NEKTON VERSION%n" + + " %d DIMENSIONAL RUN%n" + + " %3d PARAMETERS FOLLOW%n", properties.getNekVersion(), properties.getNumDimensions(), numEntries); @@ -223,7 +223,7 @@ public class NekWriter implements IComponentVisitor { currName = currEntry.getName(); currDesc = currEntry.getDescription(); currValue = currEntry.getValue(); - currLine = String.format(" %-14s %s %s\n", currValue, + currLine = String.format(" %-14s %s %s%n", currValue, currName, currDesc); // Write to the output stream @@ -256,7 +256,7 @@ public class NekWriter implements IComponentVisitor { // Construct the header String passiveScalarsHeader = String.format( " %3s Lines of passive scalar data follows" - + "2 CONDUCT; 2RHOCP\n", numEntries); + + "2 CONDUCT; 2RHOCP%n", numEntries); // Write the passive scalars header byte[] byteArray = passiveScalarsHeader.getBytes(); @@ -268,7 +268,7 @@ public class NekWriter implements IComponentVisitor { // Define the current passive scalar line currEntry = passiveScalars.retrieveAllEntries().get(i); currValue = currEntry.getValue(); - currLine = String.format(" %-10s\n", currValue); + currLine = String.format(" %-10s%n", currValue); // Write to the output stream byteArray = currLine.getBytes(); @@ -301,7 +301,7 @@ public class NekWriter implements IComponentVisitor { // Construct the header String switchesHeader = String.format( - " %3s LOGICAL SWITCHES FOLLOW\n", numEntries); + " %3s LOGICAL SWITCHES FOLLOW%n", numEntries); // Write the logical switches header byte[] byteArray = switchesHeader.getBytes(); @@ -318,7 +318,7 @@ public class NekWriter implements IComponentVisitor { // Construct the current line if (currName.contains("IFNAV") && currName.contains("IFADVC")) { - currLine = String.format(" %s IFNAV & IFADVC %s\n", // This + currLine = String.format(" %s IFNAV & IFADVC %s%n", // This // entry's // name // has @@ -329,10 +329,10 @@ public class NekWriter implements IComponentVisitor { // just write the } // name out here else if (currName.contains("IFTMSH")) { - currLine = String.format(" %s %s %s\n", currValue, currName, + currLine = String.format(" %s %s %s%n", currValue, currName, currDesc); } else { - currLine = String.format(" %s %s\n", currValue, currName); + currLine = String.format(" %s %s%n", currValue, currName); } // Write to the output stream byteArray = currLine.getBytes(); @@ -368,7 +368,7 @@ public class NekWriter implements IComponentVisitor { currEntry = preNekAxes.retrieveAllEntries().get(i); currValue = currEntry.getValue(); currName = currEntry.getName(); - currLine = String.format(" %s %s\n", currValue, currName); + currLine = String.format(" %s %s%n", currValue, currName); // Write to the output stream byteArray = currLine.getBytes(); @@ -423,7 +423,7 @@ public class NekWriter implements IComponentVisitor { currQuad = (Quad) mesh.getPolygons().get(i); currValue = String.format(" ELEMENT%6s [ %4s]" // FORMAT: // 18X,I6,4X,I3,A1,11x,i5 - + " GROUP %5s\n", (i + 1), currQuad + + " GROUP %5s%n", (i + 1), currQuad .getPolygonProperties().getMaterialId(), currQuad .getPolygonProperties().getGroupNum()); @@ -467,7 +467,7 @@ public class NekWriter implements IComponentVisitor { // Construct the proper string format currValue = String.format( - " %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n", + " %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n", currBC.getType().id, (i + 1), (j + 1), currBCValues.get(0), currBCValues.get(1), currBCValues.get(2), currBCValues.get(3), @@ -490,7 +490,7 @@ public class NekWriter implements IComponentVisitor { // Construct the proper string format currValue = String.format( - " %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n", + " %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n", currBC.getType().id, (i + 1), (j + 1), currBCValues.get(0), currBCValues.get(1), currBCValues.get(2), currBCValues.get(3), @@ -524,7 +524,7 @@ public class NekWriter implements IComponentVisitor { // Construct the proper string format currValue = String - .format(" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G\n", + .format(" %-3s%3d%3d%14.7G%14.7G%14.7G%14.7G%14.7G%n", currBC.getType().id, (i + 1), (j + 1), currBCValues.get(0), currBCValues.get(1), @@ -542,8 +542,8 @@ public class NekWriter implements IComponentVisitor { } // Write the coordinates to the buffer - currValue = String.format(" %9.6G %9.6G %9.6G %9.6G\n" - + " %9.6G %9.6G %9.6G %9.6G\n", xCoords.get(0), + currValue = String.format(" %9.6G %9.6G %9.6G %9.6G%n" + + " %9.6G %9.6G %9.6G %9.6G%n", xCoords.get(0), xCoords.get(1), xCoords.get(2), xCoords.get(3), yCoords.get(0), yCoords.get(1), yCoords.get(2), yCoords.get(3)); @@ -565,8 +565,8 @@ public class NekWriter implements IComponentVisitor { // Construct the header String meshHeader = String - .format(" *** MESH DATA ***\n" - + " %3d %3d %3d NEL,NDIM,NELV\n", + .format(" *** MESH DATA ***%n" + + " %3d %3d %3d NEL,NDIM,NELV%n", properties.getNumThermalElements(), properties.getNumDimensions(), properties.getNumFluidElements()); @@ -605,9 +605,9 @@ public class NekWriter implements IComponentVisitor { // Construct the header String curvedSidesHeader = String.format( - " ***** CURVED SIDE DATA *****\n" + " ***** CURVED SIDE DATA *****%n" + " %3s Curved sides follow " - + "IEDGE,IEL,CURVE(I),I=1,5, CCURVE\n", numEntries); + + "IEDGE,IEL,CURVE(I),I=1,5, CCURVE%n", numEntries); // Write the curved sides header byte[] byteArray = curvedSidesHeader.getBytes(); @@ -642,7 +642,7 @@ public class NekWriter implements IComponentVisitor { ArrayList> passiveScalarBCs) throws IOException { // Construct the header - String boundaryConditionHeader = " ***** BOUNDARY CONDITIONS *****\n"; + String boundaryConditionHeader = " ***** BOUNDARY CONDITIONS *****%n"; // Write the boundary conditions header byte[] byteArray = boundaryConditionHeader.getBytes(); @@ -651,7 +651,7 @@ public class NekWriter implements IComponentVisitor { // Check that there are fluid boundary conditions if (!fluidBCs.isEmpty()) { // Write the fluid boundary conditions header - String fluidHeader = " ***** FLUID BOUNDARY CONDITIONS *****\n"; + String fluidHeader = " ***** FLUID BOUNDARY CONDITIONS *****%n"; byteArray = fluidHeader.getBytes(); stream.write(byteArray); @@ -661,7 +661,7 @@ public class NekWriter implements IComponentVisitor { stream.write(byteArray); } } else { - String noFluidHeader = " ***** NO FLUID BOUNDARY CONDITIONS *****\n"; + String noFluidHeader = " ***** NO FLUID BOUNDARY CONDITIONS *****%n"; byteArray = noFluidHeader.getBytes(); stream.write(byteArray); } @@ -669,7 +669,7 @@ public class NekWriter implements IComponentVisitor { // Check that there are thermal boundary conditions if (!thermalBCs.isEmpty()) { // Write the thermal boundary conditions header - String thermalHeader = " ***** THERMAL BOUNDARY CONDITIONS *****\n"; + String thermalHeader = " ***** THERMAL BOUNDARY CONDITIONS *****%n"; byteArray = thermalHeader.getBytes(); stream.write(byteArray); @@ -679,7 +679,7 @@ public class NekWriter implements IComponentVisitor { stream.write(byteArray); } } else { - String noThermalHeader = " ***** NO THERMAL BOUNDARY CONDITIONS *****\n"; + String noThermalHeader = " ***** NO THERMAL BOUNDARY CONDITIONS *****%n"; byteArray = noThermalHeader.getBytes(); stream.write(byteArray); } @@ -697,7 +697,7 @@ public class NekWriter implements IComponentVisitor { // Write the passive scalar boundary conditions header String passiveScalarHeader = String - .format(" ***** PASSIVE SCALAR %3s BOUNDARY CONDITIONS *****\n", + .format(" ***** PASSIVE SCALAR %3s BOUNDARY CONDITIONS *****%n", (i + 1)); byteArray = passiveScalarHeader.getBytes(); stream.write(byteArray); @@ -736,7 +736,7 @@ public class NekWriter implements IComponentVisitor { // Construct the header String presolveRestartOptsHeader = String.format( - "%3s PRESOLVE/RESTART OPTIONS *****\n", numEntries); + "%3s PRESOLVE/RESTART OPTIONS *****%n", numEntries); // Write the presolve/restart options header byte[] byteArray = presolveRestartOptsHeader.getBytes(); @@ -746,7 +746,7 @@ public class NekWriter implements IComponentVisitor { // Define the current pre-solve/restart option currEntry = presolveRestartOpts.retrieveAllEntries().get(i); - currValue = currEntry.getValue() + "\n"; + currValue = currEntry.getValue() + "%n"; // Write to the output stream byteArray = currValue.getBytes(); @@ -776,7 +776,7 @@ public class NekWriter implements IComponentVisitor { // Construct the header String initialConditionsHeader = String.format( - "%3s INITIAL CONDITIONS *****\n", numEntries); + "%3s INITIAL CONDITIONS *****%n", numEntries); // Write the initial conditions header byte[] byteArray = initialConditionsHeader.getBytes(); @@ -786,7 +786,7 @@ public class NekWriter implements IComponentVisitor { // Define the current initial condition currEntry = initialConditions.retrieveAllEntries().get(i); - currValue = currEntry.getValue() + "\n"; + currValue = currEntry.getValue() + "%n"; // Write to the output stream byteArray = currValue.getBytes(); @@ -817,8 +817,8 @@ public class NekWriter implements IComponentVisitor { // Construct the header String driveForceDataHeader = String - .format(" ***** DRIVE FORCE DATA ***** BODY FORCE, FLOW, Q\n" - + " %3s Lines of Drive force data follow\n", + .format(" ***** DRIVE FORCE DATA ***** BODY FORCE, FLOW, Q%n" + + " %3s Lines of Drive force data follow%n", numEntries); // Write the drive force data header @@ -829,7 +829,7 @@ public class NekWriter implements IComponentVisitor { // Define the current drive force datum currEntry = driveForceData.retrieveAllEntries().get(i); - currValue = currEntry.getValue() + "\n"; + currValue = currEntry.getValue() + "%n"; // Write to the output stream byteArray = currValue.getBytes(); @@ -859,8 +859,8 @@ public class NekWriter implements IComponentVisitor { // Construct the header String varPropertyDataHeader = String.format( - " ***** Variable Property Data ***** Overrrides Parameter data.\n" - + "%3s Lines follow.\n", numEntries); + " ***** Variable Property Data ***** Overrrides Parameter data.%n" + + "%3s Lines follow.%n", numEntries); // Write the variable property data header byte[] byteArray = varPropertyDataHeader.getBytes(); @@ -870,7 +870,7 @@ public class NekWriter implements IComponentVisitor { // Define the current variable property datum currEntry = varPropertyData.retrieveAllEntries().get(i); - currValue = currEntry.getValue() + "\n"; + currValue = currEntry.getValue() + "%n"; // Write to the output stream byteArray = currValue.getBytes(); @@ -901,8 +901,8 @@ public class NekWriter implements IComponentVisitor { // Construct the header String historyIntegralDataHeader = String.format( - " ***** HISTORY AND INTEGRAL DATA *****\n" - + " %3s POINTS. Hcode, I,J,H,IEL\n", + " ***** HISTORY AND INTEGRAL DATA *****%n" + + " %3s POINTS. Hcode, I,J,H,IEL%n", numEntries); // Write the history and integral data header @@ -913,7 +913,7 @@ public class NekWriter implements IComponentVisitor { // Define the current history and integral datum currEntry = historyIntegralData.retrieveAllEntries().get(i); - currValue = currEntry.getValue() + "\n"; + currValue = currEntry.getValue() + "%n"; // Write to the output stream byteArray = currValue.getBytes(); @@ -946,8 +946,8 @@ public class NekWriter implements IComponentVisitor { // Construct the header String outputFieldSpecHeader = String.format( - " ***** OUTPUT FIELD SPECIFICATION *****\n" - + " %3s SPECIFICATIONS FOLLOW\n", numEntries); + " ***** OUTPUT FIELD SPECIFICATION *****%n" + + " %3s SPECIFICATIONS FOLLOW%n", numEntries); // Write the output field specification header byte[] byteArray = outputFieldSpecHeader.getBytes(); @@ -960,7 +960,7 @@ public class NekWriter implements IComponentVisitor { currName = currEntry.getName(); currValue = ("YES".equals(currEntry.getValue()) ? "T" : ("NO" .equals(currEntry.getValue()) ? "F" : currEntry.getValue())); - currLine = String.format(" %s %s\n", currValue, currName); + currLine = String.format(" %s %s%n", currValue, currName); // Write to the output stream byteArray = currLine.getBytes(); @@ -992,7 +992,7 @@ public class NekWriter implements IComponentVisitor { String currLine; // Construct the header - String objectSpecHeader = " ***** OBJECT SPECIFICATION *****\n"; + String objectSpecHeader = " ***** OBJECT SPECIFICATION *****%n"; // Write the object specification header byte[] byteArray = objectSpecHeader.getBytes(); @@ -1004,7 +1004,7 @@ public class NekWriter implements IComponentVisitor { currEntry = objectSpec.retrieveAllEntries().get(i); currValue = currEntry.getValue(); currName = currEntry.getName(); - currLine = String.format(" %3s %-7s Objects\n", currValue, + currLine = String.format(" %3s %-7s Objects%n", currValue, currName); // Write to the output stream diff --git a/src/org.eclipse.ice.viz.service/plugin.xml b/src/org.eclipse.ice.viz.service/plugin.xml index 1a3277a9c..f4f531ac0 100644 --- a/src/org.eclipse.ice.viz.service/plugin.xml +++ b/src/org.eclipse.ice.viz.service/plugin.xml @@ -16,10 +16,7 @@ - - - - + @@ -30,76 +27,5 @@ name="PlotEditor"> - - - - - - - - - - - - - diff --git a/src/org.eclipse.ice.viz.service/schema/org.eclipse.ui.perspectives.exsd b/src/org.eclipse.ice.viz.service/schema/org.eclipse.ui.perspectives.exsd new file mode 100644 index 000000000..296a3a60d --- /dev/null +++ b/src/org.eclipse.ice.viz.service/schema/org.eclipse.ui.perspectives.exsd @@ -0,0 +1,84 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.lock b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.lock new file mode 100644 index 000000000..e69de29bb diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.log b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.log new file mode 100644 index 000000000..bef7357ee --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.log @@ -0,0 +1,64 @@ +!SESSION 2015-06-23 11:57:53.010 ----------------------------------------------- +eclipse.buildId=unknown +java.version=1.8.0_31 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -application org.eclipse.ui.ide.workbench +Command-line arguments: -application org.eclipse.ui.ide.workbench -data C:\Users\r8s\workspace\ice\src\org.eclipse.ice.viz.service\src\org\eclipse\ice\viz\service -dev file:C:/Users/r8s/workspace/.metadata/.plugins/org.eclipse.pde.core/Test Recorder Basic Dialog/dev.properties -os win32 -ws win32 -arch x86_64 + +!ENTRY org.eclipse.e4.ui.workbench 1 0 2015-06-23 11:57:55.930 +!MESSAGE Nothing to merge for "platform:/plugin/org.eclipse.ice.materials.ui/materialsFragment.e4xmi" + +!ENTRY org.eclipse.jface 2 0 2015-06-23 11:57:57.089 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2015-06-23 11:57:57.090 +!MESSAGE A conflict occurred for ALT+SHIFT+X R: +Binding(ALT+SHIFT+X R, + ParameterizedCommand(Command(org.eclipse.rap.ui.launch.RAPLaunchShortcut.run,Run RAP Application, + Run RAP Application, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@44fdce3c, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+SHIFT+X R, + ParameterizedCommand(Command(org.eclipse.wst.server.launchShortcut.run,Run on Server, + Run the current selection on a server, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@712c5463, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2015-06-23 11:57:57.090 +!MESSAGE A conflict occurred for ALT+SHIFT+D R: +Binding(ALT+SHIFT+D R, + ParameterizedCommand(Command(org.eclipse.rap.ui.launch.RAPLaunchShortcut.debug,Debug RAP Application, + Debug RAP Application, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6d33a66e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(ALT+SHIFT+D R, + ParameterizedCommand(Command(org.eclipse.wst.server.launchShortcut.debug,Debug on Server, + Debug the current selection on a server, + Category(org.eclipse.debug.ui.category.run,Run/Debug,Run/Debug command category,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2f14b0f6, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2015-06-23 11:58:00.514 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-06-23 11:58:00.515 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\r8s'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.mylyn/repositories.xml.zip b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000000000000000000000000000000000000..48fcd7830508f243ccd1fec86cb47d90521d5ce5 GIT binary patch literal 442 zcmWIWW@Zs#;Nak3$cw-3#()F_fb62wg8bsllKi5~)MCAg+?=-|zTV7+0)Mp?%Qtr^ zDEW4?+je$^9h~e_zWnxun<^=jw%v};&)UBvG~?^5+!-lx_x61ESZ&OLt(cG8!?8&*gVLiQTx5zB1%Ik3G z67e`4*fVc^m(upgM9*W!TH>$Hx83<<5ib7Q#>Is9++0`P_0l}cS{}(Qf1j_{v-E_5 z^nqndudSN#bHc+Fhr}P9VmHqYOo)(5dZ)bR{FO^NGaOnz%-K_( znCtw}x#z@Ght)i5U*)F#pZw|ck~_LnZBA@HD!k{z@*97-cgY8MvvbUOHGx}$k%7U5 og@GZ!n~_O`0TIr~a-eWV1?Zt3;LXYgQo#s>c0f7}Xet8(0IdtHDF6Tf literal 0 HcmV?d00001 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.core/.log b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.core/.log new file mode 100644 index 000000000..a66b1ee00 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.core/.log @@ -0,0 +1 @@ +*** SESSION Jun 23, 2015 11:57:58.62 ------------------------------------------- diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.c @@ -0,0 +1 @@ + diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp @@ -0,0 +1 @@ + diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..1e099f3bff508a47e7cce4c8ace123e0c07a5306 GIT binary patch literal 80 zcmZQ%U|?VbVI~IA{GxQd)a0DZg5p%YlGMapz2y9&R0gi1)Pnrt%#!?~N(Mz_C8_C| TC153b?wKV4Mfqi!DXB#OWmFkc literal 0 HcmV?d00001 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties new file mode 100644 index 000000000..ca55f7100 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties @@ -0,0 +1,3 @@ +#GitProjectData +#Tue Jun 23 11:58:03 EDT 2015 +.gitdir=../../../../../../../../../.git diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 000000000..25cb955ba --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..6e187045ed8c7cef3c187a0814b56373c0eaccf9 GIT binary patch literal 151 zcmYj~u?_+u5CtDtTWGZLBk+(j#M<6QV~@B|jKF2t`+qN1SHGEg3V?#zW1+FD{4x~3 zX=r3(Wim{yjvT3B6>AYHat`rLR|!H;R!uUnolm!vsY%EKmbQ1t&i5zhJ7+aE^ZMs0 V{|BrmSm;jNQZ1J;KZv0Z{s(u9EQ$aC literal 0 HcmV?d00001 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 000000000..6b2aaa764 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree new file mode 100644 index 0000000000000000000000000000000000000000..7c7591d5498b33d9ae0db246b9915a8550caceeb GIT binary patch literal 485 zcmaKo!A`?442GSgut^iAA*3BRAkNJhUVs}MfEVZ-k9D-9io>Kn6P$S%o`VM7|F7fV=`4U>&j)E2i4^FXzalm}w}9+2`^YGLsoYS9OR z*~(XrLeA|Q9^)20=gJVIFaP=7A#jp(;3txq?vU~?rZ{TN literal 0 HcmV?d00001 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000000000000000000000000000000000000..78c43c10db77b58f85ecb175eb3f0ce33af0a0e6 GIT binary patch literal 991 zcmZ?R*xjhShe1S2b=vdAllRFf=Oz}Hq!uZZBqrsg@^UGMl%^_pmF6iJ87mkXSs55u znHng#x`Zeg85o-KawX@aCKkD*=9DDH=NF~xr6%WO78IxIrKBd6rt2l=7p2;k6qN#v z!K\r\n\r\n diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs new file mode 100644 index 000000000..3d707c440 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs @@ -0,0 +1,2 @@ +GitRepositoriesView.GitDirectories=C\:\\Users\\r8s\\workspace\\ice\\.git; +eclipse.preferences.version=1 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..29059e82d --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,15 @@ +content_assist_favorite_static_members=org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.*;org.hamcrest.Matchers.*;org.hamcrest.MatcherAssert.*;org.junit.Assert.*;org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.*;org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.*;org.eclipse.swtbot.swt.finder.SWTBotAssert.*;org.eclipse.swtbot.eclipse.finder.waits.Conditions.*;org.eclipse.swtbot.swt.finder.waits.Conditions.* +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +fontPropagated=true +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.ui.editor.tab.width= +org.eclipse.jdt.ui.formatterprofiles.version=12 +org.eclipse.jdt.ui.javadoclocations.migrated=true +org.eclipse.jface.textfont=1|Consolas|10.0|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Consolas; +proposalOrderMigrated=true +spelling_locale_initialized=true +tabWidthPropagated=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 000000000..c05c14ca0 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs new file mode 100644 index 000000000..e5a71f29e --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +mylyn.attention.migrated=true diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs new file mode 100644 index 000000000..e0b8c16e4 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..07d6ad69c --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.tasks.ui.filters.nonmatching=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs new file mode 100644 index 000000000..08f06e2b3 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.rse.systemtype.local.systemType.defaultUserId=r8s diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs new file mode 100644 index 000000000..93d9a7485 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.rse.preferences.order.connections=UltraFluffy.Local diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs new file mode 100644 index 000000000..56114a2bc --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +pref_first_startup=false diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs new file mode 100644 index 000000000..848e26387 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.team.ui.first_time=false diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 000000000..60dd1a442 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,5 @@ +TASKS_FILTERS_MIGRATE=true +eclipse.preferences.version=1 +platformState=1435074937031 +quickStart=false +tipsAndTricks=true diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 000000000..988883503 --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,4 @@ +//org.eclipse.ui.commands/state/org.eclipse.wst.xml.views.XPathView.processor.xpathprocessor/org.eclipse.ui.commands.radioState=xpath10 +ENABLED_DECORATORS=org.eclipse.m2e.core.mavenVersionDecorator\:false,org.eclipse.wst.server.ui.decorator\:false,org.eclipse.cdt.ui.indexedFiles\:false,org.eclipse.cdt.managedbuilder.ui.excludedFile\:true,org.eclipse.cdt.managedbuilder.ui.includeFolder\:true,org.eclipse.cdt.internal.ui.CustomBuildSettingsDecorator\:true,org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.m2e.core.maven2decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.pde.ui.binaryProjectDecorator\:false,org.eclipse.ptp.rdt.sync.ui.decorator\:true,org.eclipse.rse.core.virtualobject.decorator\:true,org.eclipse.rse.core.binary.executable.decorator\:true,org.eclipse.rse.core.script.executable.decorator\:true,org.eclipse.rse.core.java.executable.decorator\:true,org.eclipse.rse.core.library.decorator\:true,org.eclipse.rse.core.link.decorator\:true,org.eclipse.rse.subsystems.error.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.SymlinkDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:true,org.eclipse.wst.server.ui.navigatorDecorator\:true,oorg.eclipse.xtend.shared.ui.decorator\:true,org.eclipse.xtext.builder.nature.overlay\:true, +PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; +eclipse.preferences.version=1 diff --git a/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 000000000..49ea9caef --- /dev/null +++ b/src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,3349 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + ModelMigrationProcessor.001 + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ice.client.rcp.fileActionSet + persp.actionSet:org.eclipse.mylyn.context.ui.actionSet + persp.actionSet:org.eclipse.mylyn.doc.actionSet + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.ptp.debug.ui.debugActionSet + persp.actionSet:org.eclipse.rse.core.search.searchActionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.wb.core.ui.actionset + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.views.BookmarkView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.PropertySheet + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.views.TaskList + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.ant.ui.views.AntView + persp.perspSC:org.eclipse.cdt.ui.CPerspective + persp.showIn:org.eclipse.egit.ui.RepositoriesView + persp.perspSC:org.eclipse.jdt.ui.JavaPerspective + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks + persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task + persp.perspSC:org.eclipse.ptp.debug.ui.PTPDebugPerspective + persp.actionSet:org.eclipse.rephraserengine.ui.DebugActionSet + persp.perspSC:org.eclipse.team.cvs.ui.cvsPerspective + persp.perspSC:org.eclipse.team.ui.TeamSynchronizingPerspective + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.perspSC:org.eclipse.wst.jsdt.ui.JavaPerspective + persp.perspSC:org.eclipse.wst.xml.ui.perspective + + + + newtablook + org.eclipse.e4.primaryNavigationStack + active + + + + + + + newtablook + org.eclipse.e4.secondaryNavigationStack + + + + + + + + + newtablook + + + + + + + newtablook + org.eclipse.e4.secondaryDataStack + + + + + newtablook + + + + + + + + + + + + + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + newtablook + org.eclipse.e4.primaryDataStack + EditorStack + + + + + View + categoryTag:General + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:Ant + + + View + categoryTag:General + + + View + categoryTag:Mylyn + + + + View + categoryTag:Performance Analysis + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:Team + + + View + categoryTag:CVS + + + + toolbarSeparator + + + + Draggable + + + + + + + + + + + + + + + + toolbarSeparator + + + + Draggable + + + + + Draggable + + + + + + toolbarSeparator + + + + Draggable + + + + + + + + + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + + + stretch + + + glue + + + + glue + + + Draggable + + + + + stretch + + + + Draggable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + platform:win32 + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +