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
40df26be
Commit
40df26be
authored
6 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
make SetSessionUserTest more robust
parent
8adb90a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SetSessionUserTest.java
+6
-13
6 additions, 13 deletions
.../systemsx/cisd/openbis/systemtest/SetSessionUserTest.java
screening/etc/service.properties
+1
-1
1 addition, 1 deletion
screening/etc/service.properties
with
7 additions
and
14 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SetSessionUserTest.java
+
6
−
13
View file @
40df26be
...
...
@@ -16,6 +16,7 @@
package
ch.systemsx.cisd.openbis.systemtest
;
import
static
ch
.
systemsx
.
cisd
.
common
.
test
.
AssertionUtil
.
assertContains
;
import
static
org
.
testng
.
AssertJUnit
.
assertEquals
;
import
static
org
.
testng
.
AssertJUnit
.
assertTrue
;
import
static
org
.
testng
.
AssertJUnit
.
fail
;
...
...
@@ -29,6 +30,7 @@ import org.testng.annotations.Test;
import
ch.systemsx.cisd.common.exceptions.AuthorizationFailureException
;
import
ch.systemsx.cisd.common.exceptions.UserFailureException
;
import
ch.systemsx.cisd.common.logging.BufferedAppender
;
import
ch.systemsx.cisd.common.test.AssertionUtil
;
import
ch.systemsx.cisd.openbis.generic.server.WhiteListBasedRemoteHostValidator
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType
;
...
...
@@ -118,22 +120,13 @@ public class SetSessionUserTest extends SystemTestCase
commonServer
.
setSessionUser
(
sessionToken
,
"observer"
);
String
logContentRaw
=
logRecorder
.
getLogContent
();
String
[]
logContent
=
logContentRaw
.
split
(
"\n"
);
assertEquals
(
logContentRaw
,
4
,
logContent
.
length
);
String
logLine
=
logContent
[
3
];
assertTrue
(
"Following log line does start as expected: "
+
logLine
,
logLine
.
startsWith
(
"[USER:'test' SPACE:'CISD' HOST:'localhost'"
));
assertTrue
(
"Following log line does end as expected: "
+
logLine
,
logLine
.
endsWith
(
"set_session_user USER('observer')"
));
assertContains
(
"[USER:'test' SPACE:'CISD' HOST:'localhost'"
,
logContentRaw
);
assertContains
(
"set_session_user USER('observer')"
,
logContentRaw
);
commonServer
.
logout
(
sessionToken
);
String
logContentRaw2
=
logRecorder
.
getLogContent
();
logContent
=
logContentRaw2
.
split
(
"\n"
);
assertEquals
(
"Log content: "
+
logContentRaw2
,
8
,
logContent
.
length
);
logLine
=
logContent
[
6
];
assertEquals
(
"Log content: "
+
logContentRaw2
,
"LOGOUT: Session '"
+
sessionToken
+
"' of user 'observer' has been closed."
,
logLine
);
assertContains
(
"LOGOUT: Session '"
+
sessionToken
+
"' of user 'observer' has been closed."
,
logContentRaw2
);
}
@Test
...
...
This diff is collapsed.
Click to expand it.
screening/etc/service.properties
+
1
−
1
View file @
40df26be
...
...
@@ -23,7 +23,7 @@ use-ssl = false
session-timeout
=
30
# Path to the keystore
keystore.path
=
dist/etc/openBIS.keystore
keystore.path
=
../datastore_server/
dist/etc/openBIS.keystore
# Password of the keystore
keystore.password
=
changeit
# Key password of the keystore
...
...
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