Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
21e06f2f
Commit
21e06f2f
authored
10 years ago
by
Federico Montesino Pouzols
Browse files
Options
Downloads
Patches
Plain Diff
remotejobmanager factory test seems done for now, re #11124
parent
a2f0f366
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp
+6
-4
6 additions, 4 deletions
Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp
Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h
+20
-10
20 additions, 10 deletions
Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h
with
26 additions
and
14 deletions
Code/Mantid/Framework/API/src/RemoteJobManagerFactory.cpp
+
6
−
4
View file @
21e06f2f
...
...
@@ -73,10 +73,12 @@ RemoteJobManagerFactoryImpl::create(const std::string baseURL,
try
{
jm
=
this
->
create
(
jobManagerType
);
}
catch
(
Kernel
::
Exception
::
NotFoundError
&
e
)
{
throw
std
::
runtime_error
(
"Failed to create a remote job manager of type (class) '"
+
jobManagerType
+
"' with base URL "
+
baseURL
+
". Error description: "
+
e
.
what
());
throw
Kernel
::
Exception
::
NotFoundError
(
"RemoteJobManagerFactory: failed to create a remote job manager of "
"type (class) '"
+
jobManagerType
+
"' with base URL "
+
baseURL
+
". Error description: "
+
e
.
what
(),
jobManagerType
);
}
return
jm
;
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/API/test/RemoteJobManagerFactoryTest.h
+
20
−
10
View file @
21e06f2f
...
...
@@ -87,9 +87,11 @@ public:
// minimal positive test
void
test_createTestJM
()
{
RemoteJobManagerFactory
::
Instance
().
subscribe
<
TestJM
>
(
"TestJM"
);
TS_ASSERT_THROWS_NOTHING
(
// throws not found cause it is not in facilities.xml, but otherwise fine
TS_ASSERT_THROWS
(
Mantid
::
Kernel
::
IRemoteJobManager_sptr
jobManager
=
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"TestJM"
));
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"TestJM"
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
}
// this must fail, resource not found in the current facility
...
...
@@ -99,15 +101,17 @@ public:
Mantid
::
Kernel
::
ConfigService
::
Instance
().
getFacility
();
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
"ISIS"
);
TS_ASSERT_THROWS
_NOTHING
(
TS_ASSERT_THROWS
(
Mantid
::
Kernel
::
IRemoteJobManager_sptr
jobManager
=
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"Fermi"
));
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"Fermi"
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
"SNS"
);
TS_ASSERT_THROWS
_NOTHING
(
TS_ASSERT_THROWS
(
Mantid
::
Kernel
::
IRemoteJobManager_sptr
jobManager
=
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"SCARF@LSF"
));
"SCARF@STFC"
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
// restore facility, always do this at the end
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
prevFac
.
name
());
...
...
@@ -120,15 +124,21 @@ public:
Mantid
::
Kernel
::
ConfigService
::
Instance
().
getFacility
();
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
"SNS"
);
TS_ASSERT_THROWS_NOTHING
(
// TODO: at the moemnt these two create throw a NotFoundError
// because the RemoteJobManager classes are missing and have not
// done a DECLARE_REMOTEJOBMANAGER. Change this test when that is
// done (ticket #11126 etc.)
TS_ASSERT_THROWS
(
Mantid
::
Kernel
::
IRemoteJobManager_sptr
jobManager
=
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"Fermi"
));
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"Fermi"
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
"ISIS"
);
TS_ASSERT_THROWS
_NOTHING
(
TS_ASSERT_THROWS
(
Mantid
::
Kernel
::
IRemoteJobManager_sptr
jobManager
=
Mantid
::
API
::
RemoteJobManagerFactory
::
Instance
().
create
(
"SCARF@LSF"
));
"SCARF@STFC"
),
Mantid
::
Kernel
::
Exception
::
NotFoundError
);
// restore facility, always do this at the end
Mantid
::
Kernel
::
ConfigService
::
Instance
().
setFacility
(
prevFac
.
name
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment