Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
0b158699
Commit
0b158699
authored
15 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
minor: demo http invoker
SVN: 11572
parent
3822f2bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java
+72
-0
72 additions, 0 deletions
...a/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java
with
72 additions
and
0 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/OpenbisClientTest.java
0 → 100644
+
72
−
0
View file @
0b158699
package
ch.systemsx.cisd.openbis.generic
;
import
java.util.List
;
import
ch.systemsx.cisd.common.spring.HttpInvokerUtils
;
import
ch.systemsx.cisd.openbis.generic.shared.ICommonServer
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.TechId
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO
;
import
ch.systemsx.cisd.openbis.generic.shared.dto.Session
;
import
ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer
;
/*
* Copyright 2009 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Demo of the openBIS client which uses HTTPInvoker. This test is not run automatically.
*
* @author Tomasz Pylak
*/
public
class
OpenbisClientTest
{
public
static
void
main
(
String
[]
args
)
{
String
userId
=
"user"
;
String
userPassword
=
"password"
;
String
serverURL
=
"http://localhost:8888/openbis"
;
String
commonServerPath
=
"rmi-common"
;
// CommonServiceServer
ICommonServer
commonServer
=
HttpInvokerUtils
.
createServiceStub
(
ICommonServer
.
class
,
serverURL
+
"/"
+
commonServerPath
,
5
);
Session
sessionCommon
=
commonServer
.
tryToAuthenticate
(
userId
,
userPassword
);
List
<
PersonPE
>
persons
=
commonServer
.
listPersons
(
sessionCommon
.
getSessionToken
());
for
(
PersonPE
p
:
persons
)
{
System
.
out
.
println
(
p
.
getUserId
());
}
String
genericServerPath
=
"rmi-plugin-generic"
;
// GenericServiceServer
IGenericServer
genericServer
=
HttpInvokerUtils
.
createServiceStub
(
IGenericServer
.
class
,
serverURL
+
"/"
+
genericServerPath
,
5
);
Session
sessionGeneric
=
genericServer
.
tryToAuthenticate
(
userId
,
userPassword
);
SampleGenerationDTO
sampleInfo
=
genericServer
.
getSampleInfo
(
sessionGeneric
.
getSessionToken
(),
new
TechId
(
1L
));
System
.
out
.
println
(
sampleInfo
.
getGenerator
().
getCode
());
}
}
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