diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-28 15:16:48 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:04 +0200 |
commit | ebd44e44b7a7e43fcf0a120fbdeeb2b4873065bb (patch) | |
tree | b4a895090fcea358224815f4b10118cfe88bb1d7 /framework | |
parent | 745d361b49c3733631caa5bee4e2ed9cec09347b (diff) |
Java5 update - convert Vector to ArrayList
Change-Id: I5eff951d5c5caa47e7dabc41f8d856663a4efbd4
Diffstat (limited to 'framework')
3 files changed, 62 insertions, 64 deletions
diff --git a/framework/qa/complex/api_internal/CheckAPI.java b/framework/qa/complex/api_internal/CheckAPI.java index b49de67b41d0..b3934460898e 100644 --- a/framework/qa/complex/api_internal/CheckAPI.java +++ b/framework/qa/complex/api_internal/CheckAPI.java @@ -19,29 +19,30 @@ package complex.api_internal; // imports +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import helper.OfficeProvider; import helper.ProcessHandler; -import com.sun.star.task.XJob; -import com.sun.star.beans.XPropertyAccess; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.beans.PropertyValue; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.beans.NamedValue; -import java.util.Vector; +import java.util.ArrayList; import java.util.StringTokenizer; +import java.util.Vector; - -// ---------- junit imports ----------------- import lib.TestParameters; -import org.junit.After; + import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.openoffice.test.OfficeConnection; -import static org.junit.Assert.*; -// ------------------------------------------ + +import com.sun.star.beans.NamedValue; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.XPropertyAccess; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.task.XJob; +import com.sun.star.uno.UnoRuntime; /** * This test executes the API tests internally in StarOffice. Prerequiste is @@ -93,7 +94,7 @@ public class CheckAPI { // get the parameters for the internal test String paramList = (String)param.get("ParamList"); - Vector p = new Vector(); + ArrayList p = new ArrayList(); StringTokenizer paramTokens = new StringTokenizer(paramList, " "); while(paramTokens.hasMoreTokens()) { @@ -122,7 +123,7 @@ public class CheckAPI { } else { int index=1; - p = new Vector(); + p = new ArrayList(); while ( param.get("job"+index) != null ) { p.add(param.get("job"+index)); index++; diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java index a0f63e991ed3..ba6d8250555c 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java @@ -18,28 +18,16 @@ package complex.loadAllDocuments; -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.FrameSearchFlag; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XFrame; -import com.sun.star.frame.XStorable; -import com.sun.star.io.XInputStream; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.XCloseable; -import com.sun.star.ucb.XSimpleFileAccess; - - +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; import helper.URLHelper; import java.io.File; import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; -import java.util.Enumeration; -import java.util.Vector; - -// ---------- junit imports ----------------- import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -47,8 +35,18 @@ import org.junit.BeforeClass; import org.junit.Test; import org.openoffice.test.OfficeConnection; import org.openoffice.test.OfficeFileUrl; -import static org.junit.Assert.*; -// ------------------------------------------ + +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.FrameSearchFlag; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XFrame; +import com.sun.star.frame.XStorable; +import com.sun.star.io.XInputStream; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.ucb.XSimpleFileAccess; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XCloseable; //----------------------------------------------- /** @short Check the interface method XComponentLoader.loadComponentFromURL() @@ -116,7 +114,7 @@ public class CheckXComponentLoader private String m_sTestDocPath = null; /** files of m_sTestDocPath to test. */ - private static Vector m_lTestFiles = null; + private static ArrayList m_lTestFiles = null; //------------------------------------------- // test environment @@ -189,18 +187,18 @@ public class CheckXComponentLoader // get all files from the given directory // TODO URLHelper should ignore directories! - m_lTestFiles = new Vector(); + m_lTestFiles = new ArrayList(); final String sTestDocURL = OfficeFileUrl.getAbsolute(new File("testdocuments")); m_sTestDocPath = graphical.FileHelper.getSystemPathFromFileURL(sTestDocURL); try { File aBaseDir = new File(m_sTestDocPath); - Vector lDirContent = URLHelper.getSystemFilesFromDir(aBaseDir.getPath()); - Enumeration lList = lDirContent.elements(); + List lDirContent = URLHelper.getSystemFilesFromDir(aBaseDir.getPath()); + Iterator lList = lDirContent.iterator(); int nBasePathLength = m_sTestDocPath.length(); - while(lList.hasMoreElements()) + while(lList.hasNext()) { - File aFile = (File)lList.nextElement(); + File aFile = (File)lList.next(); // ignore broken links and directories at all if ( @@ -268,10 +266,10 @@ public class CheckXComponentLoader lProps[2].Name = "StatusIndicator"; lProps[2].Value = xIndicator; - Enumeration aSnapshot = m_lTestFiles.elements(); - while (aSnapshot.hasMoreElements()) + Iterator aSnapshot = m_lTestFiles.iterator(); + while (aSnapshot.hasNext()) { - File aSysFile = new File(m_sTestDocPath, (String)aSnapshot.nextElement()); + File aSysFile = new File(m_sTestDocPath, (String)aSnapshot.next()); String sURL = URLHelper.getFileURLFromSystemPath(aSysFile); if (/*! (sURL.endsWith(".jpg") || @@ -426,11 +424,11 @@ public class CheckXComponentLoader // get a file name as byte array - Enumeration aSnapshot = m_lTestFiles.elements(); + Iterator aSnapshot = m_lTestFiles.iterator(); byte[] baURL = null; - while (aSnapshot.hasMoreElements()) { - File aFile = new File(m_sTestDocPath, (String)aSnapshot.nextElement()); + while (aSnapshot.hasNext()) { + File aFile = new File(m_sTestDocPath, (String)aSnapshot.next()); String sFile = URLHelper.getFileURLFromSystemPath(aFile); // take the first sxw file as stream @@ -593,10 +591,10 @@ public class CheckXComponentLoader lProps[1] = new PropertyValue(); lProps[1].Name = "InputStream"; - Enumeration aSnapshot = m_lTestFiles.elements(); - while (aSnapshot.hasMoreElements()) + Iterator aSnapshot = m_lTestFiles.iterator(); + while (aSnapshot.hasNext()) { - File aFile = new File(m_sTestDocPath, (String) aSnapshot.nextElement()); + File aFile = new File(m_sTestDocPath, (String) aSnapshot.next()); String sURL = URLHelper.getFileURLFromSystemPath(aFile); // if (sURL.indexOf("CVS") > -1) diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java index e7c83d01110a..ece31d236509 100644 --- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java +++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java @@ -17,21 +17,20 @@ */ package complex.path_substitution; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.XStringSubstitution; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; -import java.util.Vector; +import java.util.ArrayList; -// ---------- junit imports ----------------- -import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.openoffice.test.OfficeConnection; -import static org.junit.Assert.*; -// ------------------------------------------ + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XStringSubstitution; /** * @@ -227,17 +226,17 @@ public class PathSubstitutionTest private class VariableContainer { - public Vector varName; - public Vector varValue; - public Vector substAtBegin; - public Vector resubst; + public ArrayList varName; + public ArrayList varValue; + public ArrayList substAtBegin; + public ArrayList resubst; public VariableContainer() { - varName = new Vector(); - varValue = new Vector(); - substAtBegin = new Vector(); - resubst = new Vector(); + varName = new ArrayList(); + varValue = new ArrayList(); + substAtBegin = new ArrayList(); + resubst = new ArrayList(); } public void add(String var) |