diff options
Diffstat (limited to 'svl/qa/complex/passwordcontainer/Test03.java')
-rw-r--r-- | svl/qa/complex/passwordcontainer/Test03.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/svl/qa/complex/passwordcontainer/Test03.java b/svl/qa/complex/passwordcontainer/Test03.java index 9e38a55893e0..0ebb727b658b 100644 --- a/svl/qa/complex/passwordcontainer/Test03.java +++ b/svl/qa/complex/passwordcontainer/Test03.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,30 +42,30 @@ public class Test03 implements PasswordContainerTest { XMultiServiceFactory m_xMSF = null; XPasswordContainer m_xPasswordContainer = null; TestHelper m_aTestHelper = null; - + public Test03 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) { m_xMSF = xMSF; m_aTestHelper = new TestHelper (aLogWriter, "Test03: "); } - + public boolean test() { final String sURL = "http://www.openoffice.org"; final String sUserPre = "OOoUser"; final String sPwdPre = "Password"; - final int iPersistentUserNum = 10; + final int iPersistentUserNum = 10; final int iRuntimeUserNum = 5; - + UserRecord aInputUserList[] = new UserRecord[iPersistentUserNum+iRuntimeUserNum]; for(int i = 0; i < iPersistentUserNum; i++) { - String sTemp[] = {sPwdPre + "_1_" + i}; // currently one password for one user + String sTemp[] = {sPwdPre + "_1_" + i}; // currently one password for one user aInputUserList[i] = new UserRecord(sUserPre + "_1_" + i, sTemp); } for(int i = 0; i < iRuntimeUserNum; i++) { String sTemp[] = {sPwdPre + "_2_" + i}; aInputUserList[i+iPersistentUserNum] = 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); @@ -73,20 +73,20 @@ public class Test03 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 < iPersistentUserNum; i++) { xContainer.addPersistent(sURL, aInputUserList[i].UserName, aInputUserList[i].Passwords, aMHandler); } - - // add a set of users and passwords for the same URL for runtime + + // add a set of users and passwords for the same URL for runtime for(int i = 0; i < iRuntimeUserNum; i++) { xContainer.add(sURL, aInputUserList[i+iPersistentUserNum].UserName, aInputUserList[i+iPersistentUserNum].Passwords, aMHandler); } - + // get the result for the URL and check that it contains persistent and runtime passwords UrlRecord aRecord = xContainer.find(sURL, aMHandler); if(!aRecord.Url.equals(sURL)) { @@ -97,17 +97,17 @@ public class Test03 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 aRecord = xContainer.find(sURL, aMHandler); for(int i = 0; i < aRecord.UserList.length; i++) { xContainer.remove(sURL, aRecord.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); |