Skip to content
Snippets Groups Projects
Commit 624e7006 authored by CONGRANLI's avatar CONGRANLI
Browse files

another

parent 139b8121
Branches
No related tags found
No related merge requests found
Pipeline #5901 passed
......@@ -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;
}
assertFalse(WeakPassphraseException);
assertTrue(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) {
......
......@@ -59,7 +59,7 @@ public class PartitioningTests
@Test public void WeakPassphraseException() throws DuplicateUserException{
boolean WeakPassphraseException = false;
String passbookUsername = "AlexTina";
String passbookphrase = "Ab23";
String passbookphrase = "Ab23333";
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-------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment