summaryrefslogtreecommitdiff
path: root/svl/qa/complex/passwordcontainer/Test02.java
diff options
context:
space:
mode:
Diffstat (limited to 'svl/qa/complex/passwordcontainer/Test02.java')
-rw-r--r--svl/qa/complex/passwordcontainer/Test02.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/svl/qa/complex/passwordcontainer/Test02.java b/svl/qa/complex/passwordcontainer/Test02.java
index b77b0fe9bf48..f06954aa606e 100644
--- a/svl/qa/complex/passwordcontainer/Test02.java
+++ b/svl/qa/complex/passwordcontainer/Test02.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,23 +42,23 @@ public class Test02 implements PasswordContainerTest {
XMultiServiceFactory m_xMSF = null;
XPasswordContainer m_xPasswordContainer = null;
TestHelper m_aTestHelper = null;
-
+
public Test02 ( XMultiServiceFactory xMSF, LogWriter aLogWriter )
{
m_xMSF = xMSF;
m_aTestHelper = new TestHelper (aLogWriter, "Test02: ");
}
-
+
public boolean test() {
final String sURL = "http://www.openoffice.org";
final String sUserPre = "OOoUser";
final String sPwdPre = "Password";
- final int iUserNum1 = 10;
+ final int iUserNum1 = 10;
final int iUserNum2 = 5;
-
+
UserRecord aInputUserList1[] = new UserRecord[iUserNum1];
for(int i = 0; i < iUserNum1; i++) {
- String sTemp[] = {sPwdPre + "_1_" + i}; // currently one password for one user
+ String sTemp[] = {sPwdPre + "_1_" + i}; // currently one password for one user
aInputUserList1[i] = new UserRecord(sUserPre + "_1_" + i, sTemp);
}
UserRecord aInputUserList2[] = new UserRecord[iUserNum2];
@@ -66,7 +66,7 @@ public class Test02 implements PasswordContainerTest {
String sTemp[] = {sPwdPre + "_2_" + i};
aInputUserList2[i] = new UserRecord(sUserPre + "_2_" + i, sTemp);
}
-
+
try {
Object oPasswordContainer = m_xMSF.createInstance("com.sun.star.task.PasswordContainer");
XPasswordContainer xContainer = (XPasswordContainer)UnoRuntime.queryInterface(XPasswordContainer.class, oPasswordContainer);
@@ -74,23 +74,23 @@ public class Test02 implements PasswordContainerTest {
XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(XInteractionHandler.class, oHandler);
MasterPasswdHandler aMHandler = new MasterPasswdHandler(xHandler);
XMasterPasswordHandling xMHandling = (XMasterPasswordHandling)UnoRuntime.queryInterface(XMasterPasswordHandling.class, oPasswordContainer);
-
- // allow the storing of the passwords
+
+ // allow the storing of the passwords
xMHandling.allowPersistentStoring(true);
-
- // add a set of users and passwords for the same URL persistently
+
+ // add a set of users and passwords for the same URL persistently
for(int i = 0; i < iUserNum1; ++i) {
xContainer.addPersistent(sURL, aInputUserList1[i].UserName, aInputUserList1[i].Passwords, aMHandler);
}
for(int i = 0; i < iUserNum2; ++i) {
xContainer.addPersistent(sURL, aInputUserList2[i].UserName, aInputUserList2[i].Passwords, aMHandler);
}
-
+
// remove some of the passwords
for(int i = 0; i < iUserNum1; ++i) {
xContainer.remove(sURL, aInputUserList1[i].UserName);
}
-
+
// get the result with find() and check it with the expected one
UrlRecord aRecord = xContainer.find(sURL, aMHandler);
if(!aRecord.Url.equals(sURL)) {
@@ -101,7 +101,7 @@ public class Test02 implements PasswordContainerTest {
m_aTestHelper.Error("User list is not the expected");
return false;
}
-
+
// get the result with getAllPersistent() and check
UrlRecord aRecords[] = xContainer.getAllPersistent(aMHandler);
if(!aRecords[0].Url.equals(sURL)) {
@@ -112,16 +112,16 @@ public class Test02 implements PasswordContainerTest {
m_aTestHelper.Error("User list is not the expected");
return false;
}
-
- // remove all the persistent passwords
+
+ // remove all the persistent passwords
xContainer.removeAllPersistent();
-
- // remove the runtime passwords
+
+ // remove the runtime passwords
for(int i = 0; i < aRecords[0].UserList.length; ++i) {
xContainer.remove(sURL, aRecords[0].UserList[i].UserName);
}
-
- // disallow the storing of the passwords
+
+ // disallow the storing of the passwords
xMHandling.allowPersistentStoring(false);
} catch(Exception e) {
m_aTestHelper.Error("Exception: " + e);