Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dCache
cta
Commits
59ee2511
Commit
59ee2511
authored
20 years ago
by
Sebastien Ponce
Browse files
Options
Downloads
Patches
Plain Diff
New version of the test including updateObj and updateRep examples. Does not compile yet
parent
fca44aec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/castor/db/testdb.cpp
+44
-1
44 additions, 1 deletion
test/castor/db/testdb.cpp
with
44 additions
and
1 deletion
test/castor/db/testdb.cpp
+
44
−
1
View file @
59ee2511
...
...
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* @(#)$RCSfile: testdb.cpp,v $ $Revision: 1.
3
$ $Release$ $Date: 2004/05/
19 16:47:47
$ $Author: sponcec3 $
* @(#)$RCSfile: testdb.cpp,v $ $Revision: 1.
4
$ $Release$ $Date: 2004/05/
25 15:31:35
$ $Author: sponcec3 $
*
*
*
...
...
@@ -98,6 +98,49 @@ int main (int argc, char** argv) {
std
::
cout
<<
"Finally :"
<<
std
::
endl
;
fr2
->
print
(
std
::
cout
,
""
,
alreadyPrinted2
);
// Now modify the first object
fr
->
removeFiles
(
f2
);
castor
::
rh
::
File
*
f3
=
new
castor
::
rh
::
File
();
f3
->
setName
(
"3rd test File"
);
fr
->
addFiles
(
f3
);
f3
->
setRequest
(
fr
);
// update the database
try
{
svcs
->
updateRep
(
&
ad
,
fr
);
}
catch
(
castor
::
exception
::
Exception
e
)
{
std
::
cout
<<
"Error caught in updateRep : "
<<
sstrerror
(
e
.
code
())
<<
std
::
endl
<<
e
.
getMessage
().
str
()
<<
std
::
endl
;
delete
svcs
;
delete
fr
;
delete
fr2
;
return
1
;
}
std
::
cout
<<
"UpdateRep ok"
<<
std
::
endl
;
// And update the second representation of the object
try
{
svcs
->
updateObj
(
&
ad
,
fr2
);
}
catch
(
castor
::
exception
::
Exception
e
)
{
std
::
cout
<<
"Error caught in updateObj : "
<<
sstrerror
(
e
.
code
())
<<
std
::
endl
<<
e
.
getMessage
().
str
()
<<
std
::
endl
;
delete
svcs
;
delete
fr
;
delete
fr2
;
return
1
;
}
// Finally display the two modified objects to check
std
::
cout
<<
"Originally modified :"
<<
std
::
endl
;
castor
::
ObjectSet
alreadyPrinted3
;
fr
->
print
(
std
::
cout
,
""
,
alreadyPrinted3
);
castor
::
ObjectSet
alreadyPrinted4
;
std
::
cout
<<
"Finally modified :"
<<
std
::
endl
;
fr2
->
print
(
std
::
cout
,
""
,
alreadyPrinted4
);
delete
svcs
;
delete
fr
;
delete
fr2
;
...
...
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