Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SWEN90006-A1-2019
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Li Congran
SWEN90006-A1-2019
Commits
624e7006
Commit
624e7006
authored
Sep 5, 2019
by
CONGRANLI
Browse files
Options
Downloads
Patches
Plain Diff
another
parent
139b8121
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5901
passed
Sep 5, 2019
Stage: check_elig
Stage: validate_tests
Stage: validate_progs
Stage: submit
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Boundary/swen90006/passbook/BoundaryTests.java
+24
-26
24 additions, 26 deletions
tests/Boundary/swen90006/passbook/BoundaryTests.java
tests/Partitioning/swen90006/passbook/PartitioningTests.java
+57
-3
57 additions, 3 deletions
tests/Partitioning/swen90006/passbook/PartitioningTests.java
with
81 additions
and
29 deletions
tests/Boundary/swen90006/passbook/BoundaryTests.java
+
24
−
26
View file @
624e7006
...
...
@@ -15,11 +15,10 @@ public class BoundaryTests
extends
PartitioningTests
{
//Test on point 7
@Test
public
void
WeakPassphraseException
()
throws
DuplicateUserException
{
@Test
public
void
ascLowerCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"
123Abcd
"
;
String
passbookphrase
=
"
'{A11234
"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
...
...
@@ -28,23 +27,22 @@ public class BoundaryTests
assertTrue
(
WeakPassphraseException
);
}
//Test on point 8
@Test
public
void
WeakPassphraseException2
()
throws
DuplicateUserException
{
@Test
public
void
ascUpperCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"
1234ABCd
"
;
String
passbookphrase
=
"
@[abc234
"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
}
assert
Fals
e
(
WeakPassphraseException
);
assert
Tru
e
(
WeakPassphraseException
);
}
@Test
public
void
Contains3
()
throws
DuplicateUserException
{
@Test
public
void
ascNumCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"
'{@[/:Cd
"
;
String
passbookphrase
=
"
:/Abcdef
"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
tests/Partitioning/swen90006/passbook/PartitioningTests.java
+
57
−
3
View file @
624e7006
...
...
@@ -59,7 +59,7 @@ public class PartitioningTests
@Test
public
void
WeakPassphraseException
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"Ab23"
;
String
passbookphrase
=
"Ab23
333
"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
...
...
@@ -96,7 +96,6 @@ public class PartitioningTests
}
assertFalse(WeakPassphraseException);
}
*/
// passphrase.length = 8 && passphrase only contain one kind factory in Lower, Upper and Number
...
...
@@ -227,6 +226,61 @@ public class PartitioningTests
}
assertFalse(WeakPassphraseException);
}
*/
//passphrase.length >=8 not containsLowerCase
@Test
public
void
NocontainLowerCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"ABCD1234"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
}
assertTrue
(
WeakPassphraseException
);
}
//passphrase.length >=8 not containsUpperCase
@Test
public
void
NocontainUpperCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"abcd1234"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
}
assertTrue
(
WeakPassphraseException
);
}
//passphrase.length >=8 not containsNumCase
@Test
public
void
NocontainNumCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"abcdABCD"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
}
assertTrue
(
WeakPassphraseException
);
}
//passphrase.length >=8 containsNumCase
@Test
public
void
containNumCase
()
throws
DuplicateUserException
{
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"abABCD12"
;
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
}
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
}
assertFalse
(
WeakPassphraseException
);
}
//------------------------------loginUser Test Cases-------------------------------------
...
...
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