Commit f7341cb4 authored by Robert Smith's avatar Robert Smith

Merge remote-tracking branch 'origin/2.2.2' into next

parents d00cc09c e279aa4e
...@@ -49,7 +49,7 @@ public class VibeKVPairTester { ...@@ -49,7 +49,7 @@ public class VibeKVPairTester {
/** /**
* <p> * <p>
* This operation sets up the workspace. * This operation sets up the workspace.
* </p> * </p>
*/ */
@BeforeClass @BeforeClass
...@@ -70,7 +70,7 @@ public class VibeKVPairTester { ...@@ -70,7 +70,7 @@ public class VibeKVPairTester {
IPath projectPath = new Path(userDir + separator + ".project"); IPath projectPath = new Path(userDir + separator + ".project");
// Create the project description // Create the project description
IProjectDescription desc = ResourcesPlugin.getWorkspace() IProjectDescription desc = ResourcesPlugin.getWorkspace()
.loadProjectDescription(projectPath); .loadProjectDescription(projectPath);
// Get the project handle and create it // Get the project handle and create it
project = workspaceRoot.getProject(desc.getName()); project = workspaceRoot.getProject(desc.getName());
// Create the project if it doesn't exist // Create the project if it doesn't exist
...@@ -79,7 +79,7 @@ public class VibeKVPairTester { ...@@ -79,7 +79,7 @@ public class VibeKVPairTester {
} }
// Open the project if it is not already open // Open the project if it is not already open
if (project.exists() && !project.isOpen()) { if (project.exists() && !project.isOpen()) {
project.open(new NullProgressMonitor()); project.open(new NullProgressMonitor());
} }
// Refresh the workspace // Refresh the workspace
project.refreshLocal(IResource.DEPTH_INFINITE, null); project.refreshLocal(IResource.DEPTH_INFINITE, null);
...@@ -94,12 +94,10 @@ public class VibeKVPairTester { ...@@ -94,12 +94,10 @@ public class VibeKVPairTester {
return; return;
} }
/** /**
* Test the constructor and make sure that all of the information is * Test the constructor and make sure that all of the information is entered
* entered in correctly. * in correctly.
*/ */
@Test @Test
public void checkConstruction() { public void checkConstruction() {
...@@ -109,7 +107,8 @@ public class VibeKVPairTester { ...@@ -109,7 +107,8 @@ public class VibeKVPairTester {
// check to see if the form exists, and the item is setup correctly. // check to see if the form exists, and the item is setup correctly.
assertEquals("VIBE Key-Value Pair", vibeKVPair.getName()); assertEquals("VIBE Key-Value Pair", vibeKVPair.getName());
assertEquals("Generate input files for VIBE.",vibeKVPair.getDescription()); assertEquals("Generate input files for VIBE.",
vibeKVPair.getDescription());
// Try with project not as null // Try with project not as null
IProject project = projectSpace; IProject project = projectSpace;
...@@ -117,7 +116,8 @@ public class VibeKVPairTester { ...@@ -117,7 +116,8 @@ public class VibeKVPairTester {
// check to see if the form exists, and the item is setup correctly. // check to see if the form exists, and the item is setup correctly.
assertEquals("VIBE Key-Value Pair", vibeKVPair.getName()); assertEquals("VIBE Key-Value Pair", vibeKVPair.getName());
assertEquals("Generate input files for VIBE.", vibeKVPair.getDescription()); assertEquals("Generate input files for VIBE.",
vibeKVPair.getDescription());
} }
/** /**
...@@ -134,11 +134,12 @@ public class VibeKVPairTester { ...@@ -134,11 +134,12 @@ public class VibeKVPairTester {
// Check values stored on the form // Check values stored on the form
// Check to see if executable exists // Check to see if executable exists
assertEquals("VIBE Key-Value Pair", vibeKVPair.getName()); assertEquals("VIBE Key-Value Pair", vibeKVPair.getName());
assertEquals("Generate input files for VIBE.", vibeKVPair.getDescription()); assertEquals("Generate input files for VIBE.",
vibeKVPair.getDescription());
} }
/** /**
* Try processing the form with both valid and invalid * Try processing the form with both valid and invalid
*/ */
@Test @Test
public void checkProcessing() { public void checkProcessing() {
...@@ -151,7 +152,7 @@ public class VibeKVPairTester { ...@@ -151,7 +152,7 @@ public class VibeKVPairTester {
// Check default contents // Check default contents
form = vibeKVPair.getForm(); form = vibeKVPair.getForm();
assertNotNull(form.getComponents()); assertNotNull(form.getComponents());
assertEquals(1, form.getComponents().size()); assertEquals(2, form.getComponents().size());
// Since there are entries and DataComponents, lets run the test! // Since there are entries and DataComponents, lets run the test!
// Now try to pass it the wrong information into the process // Now try to pass it the wrong information into the process
...@@ -163,11 +164,14 @@ public class VibeKVPairTester { ...@@ -163,11 +164,14 @@ public class VibeKVPairTester {
vibeKVPair.process("Export to key-value pair output")); vibeKVPair.process("Export to key-value pair output"));
form = vibeKVPair.getForm(); form = vibeKVPair.getForm();
assertNotNull(form.getComponents()); assertNotNull(form.getComponents());
assertEquals(1, form.getComponents().size()); assertEquals(2, form.getComponents().size());
assertTrue(projectSpace.getFile( assertTrue(projectSpace
"VIBE_Key-Value_Pair_" + vibeKVPair.getId() + ".dat").exists()); .getFile("VIBE_Key-Value_Pair_" + vibeKVPair.getId() + ".dat")
.exists());
try { try {
projectSpace.getFile("VIBE_Key-Value_Pair_" + vibeKVPair.getId() + ".dat").delete(true, true, null); projectSpace.getFile(
"VIBE_Key-Value_Pair_" + vibeKVPair.getId() + ".dat")
.delete(true, true, null);
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
fail("Could not delete test output file."); fail("Could not delete test output file.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment