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
6c8eb9ec
Commit
6c8eb9ec
authored
Sep 5, 2019
by
CONGRANLI
Browse files
Options
Downloads
Patches
Plain Diff
add some feedback
parent
624e7006
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5992
passed
Sep 5, 2019
Stage: check_elig
Stage: validate_tests
Stage: validate_progs
Stage: submit
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Partitioning/swen90006/passbook/PartitioningTests.java
+45
-10
45 additions, 10 deletions
tests/Partitioning/swen90006/passbook/PartitioningTests.java
with
45 additions
and
10 deletions
tests/Partitioning/swen90006/passbook/PartitioningTests.java
+
45
−
10
View file @
6c8eb9ec
...
@@ -269,17 +269,23 @@ public class PartitioningTests
...
@@ -269,17 +269,23 @@ public class PartitioningTests
assertTrue
(
WeakPassphraseException
);
assertTrue
(
WeakPassphraseException
);
}
}
//passphrase.length >=8 containsNumCase
//passphrase.length >=8 containsNumCase
@Test
public
void
containNumCase
()
throws
DuplicateUserException
{
@Test
public
void
containNumCase
()
throws
DuplicateUserException
,
swen90006
.
passbook
.
AlreadyLoggedInException
,
swen90006
.
passbook
.
IncorrectPassphraseException
{
boolean
NoSuchUserException
=
false
;
boolean
WeakPassphraseException
=
false
;
boolean
WeakPassphraseException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"abABCD12"
;
String
passbookphrase
=
"abABCD12"
;
try
{
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
pb
.
loginUser
(
passbookUsername
,
passbookphrase
);
}
}
catch
(
WeakPassphraseException
e
)
{
catch
(
WeakPassphraseException
e
)
{
WeakPassphraseException
=
true
;
WeakPassphraseException
=
true
;
}
}
catch
(
NoSuchUserException
e
)
{
NoSuchUserException
=
true
;
}
assertFalse
(
WeakPassphraseException
);
assertFalse
(
WeakPassphraseException
);
assertFalse
(
NoSuchUserException
);
}
}
//------------------------------loginUser Test Cases-------------------------------------
//------------------------------loginUser Test Cases-------------------------------------
...
@@ -359,20 +365,27 @@ public class PartitioningTests
...
@@ -359,20 +365,27 @@ public class PartitioningTests
}
}
//passphrase is equale to the saved one
//passphrase is equale to the saved one
@Test
public
void
IncorrectPassphraseException2
()
throws
WeakPassphraseException
,
DuplicateUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
NoSuchUserException
{
@Test
public
void
IncorrectPassphraseException2
()
throws
WeakPassphraseException
,
DuplicateUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
NoSuchUserException
,
MalformedURLException
,
InvalidSessionIDException
{
boolean
IncorrectPassphraseException
=
false
;
boolean
IncorrectPassphraseException
=
false
;
boolean
InvalidSessionIDException
=
false
;
String
passbookUsername
=
"AlexTina"
;
String
passbookUsername
=
"AlexTina"
;
String
passbookphrase
=
"Abc234hg"
;
String
passbookphrase
=
"Abc234hg"
;
String
passbookUsername2
=
"AlexTina"
;
URL
url
=
new
URL
(
"http:AlexTinaAbc234hg"
);
String
passbookphrase2
=
"Abc234hg"
;
String
urlUsername
=
"AlexTina"
;
String
urlPassword
=
"Abc234hg"
;
try
{
try
{
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
pb
.
addUser
(
passbookUsername
,
passbookphrase
);
pb
.
loginUser
(
passbookUsername
2
,
passbookphrase
2
);
pb
.
updateDetails
(
pb
.
loginUser
(
passbookUsername
,
passbookphrase
),
url
,
urlUsername
,
urlPassword
);
}
}
catch
(
IncorrectPassphraseException
e
){
catch
(
IncorrectPassphraseException
e
){
IncorrectPassphraseException
=
true
;
IncorrectPassphraseException
=
true
;
}
}
catch
(
InvalidSessionIDException
e
)
{
InvalidSessionIDException
=
true
;
}
assertFalse
(
IncorrectPassphraseException
);
assertFalse
(
IncorrectPassphraseException
);
assertFalse
(
InvalidSessionIDException
);
}
}
...
@@ -448,6 +461,7 @@ public class PartitioningTests
...
@@ -448,6 +461,7 @@ public class PartitioningTests
//urlUsername != null && urlPassword !=null
//urlUsername != null && urlPassword !=null
@Test
public
void
checkRemove
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
@Test
public
void
checkRemove
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
boolean
InvalidSessionIDException
=
false
;
boolean
NoSuchUserException
=
false
;
boolean
NoSuchUserException
=
false
;
Integer
sessionID
;
Integer
sessionID
;
String
Username
=
"AlexTina"
;
String
Username
=
"AlexTina"
;
...
@@ -464,11 +478,16 @@ public class PartitioningTests
...
@@ -464,11 +478,16 @@ public class PartitioningTests
catch
(
NoSuchURLException
e
){
catch
(
NoSuchURLException
e
){
NoSuchUserException
=
true
;
NoSuchUserException
=
true
;
}
}
catch
(
InvalidSessionIDException
e
)
{
InvalidSessionIDException
=
true
;
}
assertFalse
(
NoSuchUserException
);
assertFalse
(
NoSuchUserException
);
assertFalse
(
InvalidSessionIDException
);
}
}
//urlUsername = null || urlPassword !=null
//urlUsername = null || urlPassword !=null
@Test
public
void
checkRemove2
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
@Test
public
void
checkRemove2
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
boolean
InvalidSessionIDException
=
false
;
boolean
NoSuchUserException
=
false
;
boolean
NoSuchUserException
=
false
;
Integer
sessionID
;
Integer
sessionID
;
String
Username
=
"AlexTina"
;
String
Username
=
"AlexTina"
;
...
@@ -485,10 +504,16 @@ public class PartitioningTests
...
@@ -485,10 +504,16 @@ public class PartitioningTests
catch
(
NoSuchURLException
e
){
catch
(
NoSuchURLException
e
){
NoSuchUserException
=
true
;
NoSuchUserException
=
true
;
}
}
catch
(
InvalidSessionIDException
e
)
{
InvalidSessionIDException
=
true
;
}
assertFalse
(
InvalidSessionIDException
);
assertTrue
(
NoSuchUserException
);
assertTrue
(
NoSuchUserException
);
}
}
//urlUsername != null || urlPassword =null
//urlUsername != null || urlPassword =null
@Test
public
void
checkRemove3
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
@Test
public
void
checkRemove3
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
boolean
InvalidSessionIDException
=
false
;
boolean
NoSuchUserException
=
false
;
boolean
NoSuchUserException
=
false
;
Integer
sessionID
;
Integer
sessionID
;
String
Username
=
"AlexTina"
;
String
Username
=
"AlexTina"
;
...
@@ -505,10 +530,16 @@ public class PartitioningTests
...
@@ -505,10 +530,16 @@ public class PartitioningTests
catch
(
NoSuchURLException
e
){
catch
(
NoSuchURLException
e
){
NoSuchUserException
=
true
;
NoSuchUserException
=
true
;
}
}
catch
(
InvalidSessionIDException
e
)
{
InvalidSessionIDException
=
true
;
}
assertFalse
(
InvalidSessionIDException
);
assertTrue
(
NoSuchUserException
);
assertTrue
(
NoSuchUserException
);
}
}
//urlUsername != null || urlPassword !=null
//urlUsername != null || urlPassword !=null
@Test
public
void
checkRemove4
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
@Test
public
void
checkRemove4
()
throws
WeakPassphraseException
,
DuplicateUserException
,
NoSuchUserException
,
AlreadyLoggedInException
,
IncorrectPassphraseException
,
InvalidSessionIDException
,
MalformedURLException
,
NoSuchURLException
{
boolean
InvalidSessionIDException
=
false
;
boolean
NoSuchUserException
=
false
;
boolean
NoSuchUserException
=
false
;
Integer
sessionID
;
Integer
sessionID
;
String
Username
=
"AlexTina"
;
String
Username
=
"AlexTina"
;
...
@@ -525,6 +556,10 @@ public class PartitioningTests
...
@@ -525,6 +556,10 @@ public class PartitioningTests
catch
(
NoSuchURLException
e
){
catch
(
NoSuchURLException
e
){
NoSuchUserException
=
true
;
NoSuchUserException
=
true
;
}
}
catch
(
InvalidSessionIDException
e
)
{
InvalidSessionIDException
=
true
;
}
assertFalse
(
InvalidSessionIDException
);
assertTrue
(
NoSuchUserException
);
assertTrue
(
NoSuchUserException
);
}
}
...
...
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