Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
ecfbfc9c
Commit
ecfbfc9c
authored
12 years ago
by
Joël Krähemann
Browse files
Options
Downloads
Patches
Plain Diff
OO-356: replace SecureRandom with Random because of portability problems.
parent
6f0ff57d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/org/olat/course/FunctionalCourseTest.java
+9
-7
9 additions, 7 deletions
src/test/java/org/olat/course/FunctionalCourseTest.java
with
9 additions
and
7 deletions
src/test/java/org/olat/course/FunctionalCourseTest.java
+
9
−
7
View file @
ecfbfc9c
...
...
@@ -31,6 +31,7 @@ import java.security.NoSuchAlgorithmException;
import
java.security.NoSuchProviderException
;
import
java.security.SecureRandom
;
import
java.util.List
;
import
java.util.Random
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.io.IOUtils
;
...
...
@@ -82,9 +83,9 @@ public class FunctionalCourseTest {
public
final
static
String
EDITOR_COURSE_OVERVIEW_FILE
=
"/org/olat/course/overview_comprehensive_guide_to_c_programming.html"
;
public
final
static
int
LARGE_COURSE_FILE_COUNT
=
20
;
public
final
static
long
LARGE_COURSE_FILE_SIZE
=
50000
;
public
final
static
int
LARGE_COURSE_TEST_COUNT
=
20
0
;
public
final
static
int
LARGE_COURSE_GROUP_COUNT
=
15
0
;
public
final
static
long
LARGE_COURSE_FILE_SIZE
=
50000
00
;
public
final
static
int
LARGE_COURSE_TEST_COUNT
=
20
;
public
final
static
int
LARGE_COURSE_GROUP_COUNT
=
15
;
public
final
static
String
LARGE_COURSE_IQ_TEST_SHORT_TITLE
=
"QTI"
;
public
final
static
String
LARGE_COURSE_IQ_TEST_LONG_TITLE
=
"generated test No. "
;
public
final
static
String
LARGE_COURSE_IQ_TEST_DESCRIPTION_0
=
"generated within a loop: test#"
;
...
...
@@ -127,7 +128,6 @@ public class FunctionalCourseTest {
}
}
@Ignore
@Test
@RunAsClient
public
void
checkCreateUsingWizard
(){
...
...
@@ -156,7 +156,6 @@ public class FunctionalCourseTest {
functionalUtil
.
logout
(
browser
);
}
@Ignore
@Test
@RunAsClient
public
void
checkCreateUsingEditor
()
throws
FileNotFoundException
,
IOException
,
URISyntaxException
{
...
...
@@ -239,6 +238,7 @@ public class FunctionalCourseTest {
@RunAsClient
public
void
checkCreateLargeCourse
()
throws
URISyntaxException
,
IOException
,
NoSuchAlgorithmException
,
NoSuchProviderException
{
File
[]
largeFile
=
new
File
[
LARGE_COURSE_FILE_COUNT
];
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
largeFile
.
length
;
i
++){
File
currentFile
=
...
...
@@ -257,7 +257,9 @@ public class FunctionalCourseTest {
ByteArrayOutputStream
dataOut
=
new
ByteArrayOutputStream
();
dataOut
.
write
(
new
String
(
"Line number #"
+
j
+
": "
).
getBytes
());
dataOut
.
write
(
Base64
.
encodeBase64
(
SecureRandom
.
getInstance
(
"SHA1PRNG"
,
"SUN"
).
generateSeed
(
512
),
false
));
byte
[]
chunck
=
new
byte
[
1024
];
random
.
nextBytes
(
chunck
);
dataOut
.
write
(
Base64
.
encodeBase64
(
chunck
,
false
));
dataOut
.
write
(
"\n"
.
getBytes
());
IOUtils
.
write
(
dataOut
.
toByteArray
(),
out
);
out
.
flush
();
...
...
@@ -302,7 +304,7 @@ public class FunctionalCourseTest {
/* create course node and assign qti test to it */
Assert
.
assertTrue
(
functionalCourseUtil
.
createCourseNode
(
browser
,
CourseNodeAlias
.
IQ_TEST
,
title
,
LARGE_COURSE_IQ_TEST_LONG_TITLE
,
description
,
title
,
LARGE_COURSE_IQ_TEST_LONG_TITLE
+
i
,
description
,
2
*
i
+
4
));
Assert
.
assertTrue
(
functionalCourseUtil
.
createQTITest
(
browser
,
title
,
description
));
}
...
...
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