Skip to content

Commit

Permalink
Refs #4055. Add test for grouping TableWorkspaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Whitley committed Nov 11, 2011
1 parent 679b2dc commit a2a92a1
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Code/Mantid/Framework/Algorithms/test/GroupWorkspacesTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class GroupWorkspacesTest : public CxxTest::TestSuite
TS_ASSERT_THROWS_NOTHING( result1 = boost::dynamic_pointer_cast<ITableWorkspace>(AnalysisDataService::Instance().retrieve("foundpeaks")) );
TS_ASSERT( finder.isExecuted() );

GroupWorkspaces grpwsalg;
GroupWorkspaces grpwsalg;
grpwsalg.initialize();
std::vector<std::string >input;
input.push_back("LOQ48094");
Expand All @@ -237,8 +237,38 @@ class GroupWorkspacesTest : public CxxTest::TestSuite
TS_ASSERT_THROWS_NOTHING( grpwsalg.setProperty("OutputWorkspace","NewGroup"));
TS_ASSERT_THROWS_NOTHING( grpwsalg.execute());
TS_ASSERT( !grpwsalg.isExecuted() );

AnalysisDataService::Instance().remove("LOQ48094");
AnalysisDataService::Instance().remove("foundpeaks");
AnalysisDataService::Instance().remove("LOQ49886");
}

void testExecGroupWithTableWorkspaces()
{
LoadRaw3 alg;
alg.initialize();
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("FileName","LOQ48094.raw"));
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace","LOQ48094"));
TS_ASSERT_THROWS_NOTHING( alg.execute());
TS_ASSERT( alg.isExecuted() );

boost::shared_ptr<Workspace>tw(new Mantid::DataObjects::TableWorkspace);
AnalysisDataService::Instance().add("table",tw);

GroupWorkspaces grpwsalg;
grpwsalg.initialize();
std::vector<std::string >input;
input.push_back("LOQ48094");
input.push_back("table");
TS_ASSERT_THROWS_NOTHING( grpwsalg.setProperty("InputWorkspaces",input));
TS_ASSERT_THROWS_NOTHING( grpwsalg.setProperty("OutputWorkspace","NewGroup"));
TS_ASSERT_THROWS_NOTHING( grpwsalg.execute());
TS_ASSERT( grpwsalg.isExecuted() );

AnalysisDataService::Instance().remove("LOQ48094");
AnalysisDataService::Instance().remove("table");
}

private:
//Mantid::Algorithms::GroupWorkspaces grpwsalg;

Expand Down

0 comments on commit a2a92a1

Please sign in to comment.