1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir package base;
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir import basicrunner.BasicIfcTest;
31*cdf0e10cSrcweir import basicrunner.BasicTestCase;
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory;
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir import helper.APIDescGetter;
36*cdf0e10cSrcweir import helper.AppProvider;
37*cdf0e10cSrcweir import helper.OfficeProvider;
38*cdf0e10cSrcweir import helper.OfficeWatcher;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir import java.io.BufferedReader;
41*cdf0e10cSrcweir import java.io.FileReader;
42*cdf0e10cSrcweir import java.io.PrintWriter;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir import java.util.Vector;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir import lib.TestCase;
47*cdf0e10cSrcweir import lib.TestEnvironment;
48*cdf0e10cSrcweir import lib.TestParameters;
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir import share.DescEntry;
51*cdf0e10cSrcweir import share.DescGetter;
52*cdf0e10cSrcweir import share.LogWriter;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir import stats.OutProducerFactory;
55*cdf0e10cSrcweir import stats.Summarizer;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir import util.DynamicClassLoader;
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir /**
60*cdf0e10cSrcweir  * The testbase for executing basic tests.
61*cdf0e10cSrcweir  *  @see lib.TestBase
62*cdf0e10cSrcweir  */
63*cdf0e10cSrcweir public class basic_fat implements TestBase
64*cdf0e10cSrcweir {
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     public static boolean debug = false;
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir     /**
69*cdf0e10cSrcweir      *  Execute a test.
70*cdf0e10cSrcweir      *  @param param The test parameters.
71*cdf0e10cSrcweir      * @return True, if the test was executed.
72*cdf0e10cSrcweir      */
73*cdf0e10cSrcweir     public boolean executeTest(TestParameters param)
74*cdf0e10cSrcweir     {
75*cdf0e10cSrcweir         DescGetter dg = new APIDescGetter();
76*cdf0e10cSrcweir         String job = (String) param.get("TestJob");
77*cdf0e10cSrcweir         OfficeProvider office = null;
78*cdf0e10cSrcweir         debug = param.getBool("DebugIsActive");
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir         //get Job-Descriptions
82*cdf0e10cSrcweir         System.out.print("Getting Descriptions for Job: " + job + " from ");
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir         DescEntry[] entries = dg.getDescriptionFor(job,
85*cdf0e10cSrcweir                 (String) param.get(
86*cdf0e10cSrcweir                 "DescriptionPath"),
87*cdf0e10cSrcweir                 debug);
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir         if (entries == null)
90*cdf0e10cSrcweir         {
91*cdf0e10cSrcweir             System.out.println("Couldn't get Description for Job");
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir             return false;
94*cdf0e10cSrcweir         }
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir         String ExclusionFile = (String) param.get("ExclusionList");
97*cdf0e10cSrcweir         Vector exclusions = null;
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir         if (ExclusionFile != null)
100*cdf0e10cSrcweir         {
101*cdf0e10cSrcweir             exclusions = getExclusionList(ExclusionFile, debug);
102*cdf0e10cSrcweir         }
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir         String conStr = (String) param.get("ConnectionString");
105*cdf0e10cSrcweir         System.out.println("");
106*cdf0e10cSrcweir         System.out.print("> Connecting the Office ");
107*cdf0e10cSrcweir         System.out.println("With " + conStr);
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir         for (int l = 0; l < entries.length; l++)
110*cdf0e10cSrcweir         {
111*cdf0e10cSrcweir             if (entries[l].hasErrorMsg)
112*cdf0e10cSrcweir             {
113*cdf0e10cSrcweir                 System.out.println(entries[l].ErrorMsg);
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir                 continue;
116*cdf0e10cSrcweir             }
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir             office = new OfficeProvider();
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir             XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
121*cdf0e10cSrcweir                     param);
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir             if (msf == null)
124*cdf0e10cSrcweir             {
125*cdf0e10cSrcweir                 return false;
126*cdf0e10cSrcweir             }
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir             param.put("ServiceFactory", msf);
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir             DescEntry entry = entries[l];
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir             //get some helper classes
133*cdf0e10cSrcweir             Summarizer sumIt = new Summarizer();
134*cdf0e10cSrcweir             DynamicClassLoader dcl = new DynamicClassLoader();
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir             TestCase tCase = null;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir             tCase = (TestCase) new BasicTestCase(entry);
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir             if (tCase == null)
141*cdf0e10cSrcweir             {
142*cdf0e10cSrcweir                 sumIt.summarizeDown(entry, entry.ErrorMsg);
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir                 LogWriter sumObj = OutProducerFactory.createOutProducer(param);
145*cdf0e10cSrcweir                 sumObj.initialize(entry, true);
146*cdf0e10cSrcweir                 sumObj.summary(entry);
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir                 continue;
149*cdf0e10cSrcweir             }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir             System.out.println("Creating: " + tCase.getObjectName());
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir             LogWriter log = (LogWriter) dcl.getInstance(
154*cdf0e10cSrcweir                     (String) param.get("LogWriter"));
155*cdf0e10cSrcweir             log.initialize(entry, true);
156*cdf0e10cSrcweir             entry.UserDefinedParams = param;
157*cdf0e10cSrcweir             tCase.setLogWriter((PrintWriter) log);
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir             try
160*cdf0e10cSrcweir             {
161*cdf0e10cSrcweir                 tCase.initializeTestCase(param);
162*cdf0e10cSrcweir             }
163*cdf0e10cSrcweir             catch (RuntimeException e)
164*cdf0e10cSrcweir             {
165*cdf0e10cSrcweir                 helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
166*cdf0e10cSrcweir                         "AppProvider");
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir                 if (ph != null)
169*cdf0e10cSrcweir                 {
170*cdf0e10cSrcweir                     OfficeWatcher ow = (OfficeWatcher) param.get("Watcher");
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir                     if ((ow != null) && ow.isAlive())
173*cdf0e10cSrcweir                     {
174*cdf0e10cSrcweir                         ow.finish = true;
175*cdf0e10cSrcweir                     }
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir                     ph.kill();
178*cdf0e10cSrcweir                     shortWait(5000);
179*cdf0e10cSrcweir                 }
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir                 continue;
182*cdf0e10cSrcweir             }
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir             TestEnvironment tEnv = tCase.getTestEnvironment(param);
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir             if (tEnv == null)
187*cdf0e10cSrcweir             {
188*cdf0e10cSrcweir                 sumIt.summarizeDown(entry, "Unable to create testcase");
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir                 LogWriter sumObj = OutProducerFactory.createOutProducer(param);
191*cdf0e10cSrcweir                 sumObj.initialize(entry, true);
192*cdf0e10cSrcweir                 sumObj.summary(entry);
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir                 helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
195*cdf0e10cSrcweir                         "AppProvider");
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir                 if (ph != null)
198*cdf0e10cSrcweir                 {
199*cdf0e10cSrcweir                     OfficeWatcher ow = (OfficeWatcher) param.get("Watcher");
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir                     if ((ow != null) && ow.isAlive())
202*cdf0e10cSrcweir                     {
203*cdf0e10cSrcweir                         ow.finish = true;
204*cdf0e10cSrcweir                     }
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir                     ph.kill();
207*cdf0e10cSrcweir                     shortWait(5000);
208*cdf0e10cSrcweir                 }
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir                 continue;
211*cdf0e10cSrcweir             }
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir             System.out.println("created " + tCase.getObjectName());
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir             for (int j = 0; j < entry.SubEntryCount; j++)
216*cdf0e10cSrcweir             {
217*cdf0e10cSrcweir                 if (!entry.SubEntries[j].isToTest)
218*cdf0e10cSrcweir                 {
219*cdf0e10cSrcweir                     Summarizer.summarizeDown(entry.SubEntries[j],
220*cdf0e10cSrcweir                             "not part of the job");
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir                     continue;
223*cdf0e10cSrcweir                 }
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir                 if ((exclusions != null) &&
226*cdf0e10cSrcweir                         (exclusions.contains(entry.SubEntries[j].longName)))
227*cdf0e10cSrcweir                 {
228*cdf0e10cSrcweir                     Summarizer.summarizeDown(entry.SubEntries[j],
229*cdf0e10cSrcweir                             "known issue");
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir                     continue;
232*cdf0e10cSrcweir                 }
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir                 System.out.println("running: " +
235*cdf0e10cSrcweir                         entry.SubEntries[j].entryName);
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir                 LogWriter ifclog = (LogWriter) dcl.getInstance(
238*cdf0e10cSrcweir                         (String) param.get("LogWriter"));
239*cdf0e10cSrcweir                 ifclog.initialize(entry.SubEntries[j], true);
240*cdf0e10cSrcweir                 entry.SubEntries[j].UserDefinedParams = param;
241*cdf0e10cSrcweir                 entry.SubEntries[j].Logger = ifclog;
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir                 if ((tEnv == null) || tEnv.isDisposed())
244*cdf0e10cSrcweir                 {
245*cdf0e10cSrcweir                     helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
246*cdf0e10cSrcweir                             "AppProvider");
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir                     if (ph != null)
249*cdf0e10cSrcweir                     {
250*cdf0e10cSrcweir                         office.closeExistingOffice(param, true);
251*cdf0e10cSrcweir                         shortWait(5000);
252*cdf0e10cSrcweir                     }
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir                     tEnv = getEnv(entry, param);
255*cdf0e10cSrcweir                 }
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir                 BasicIfcTest ifc = null;
258*cdf0e10cSrcweir                 lib.TestResult res = null;
259*cdf0e10cSrcweir                 ifc = new BasicIfcTest(entry.SubEntries[j].longName);
260*cdf0e10cSrcweir                 res = ifc.run(entry.SubEntries[j], tEnv, param);
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir                 sumIt.summarizeUp(entry.SubEntries[j]);
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir                 LogWriter sumIfc = OutProducerFactory.createOutProducer(param);
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir                 sumIfc.initialize(entry.SubEntries[j], true);
267*cdf0e10cSrcweir                 sumIfc.summary(entry.SubEntries[j]);
268*cdf0e10cSrcweir             }
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir             try
271*cdf0e10cSrcweir             {
272*cdf0e10cSrcweir                 tCase.cleanupTestCase(param);
273*cdf0e10cSrcweir             }
274*cdf0e10cSrcweir             catch (Exception e)
275*cdf0e10cSrcweir             {
276*cdf0e10cSrcweir                 log.println("TestCase already gone");
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir                 helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
279*cdf0e10cSrcweir                         "AppProvider");
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir                 if (ph != null)
282*cdf0e10cSrcweir                 {
283*cdf0e10cSrcweir                     office.closeExistingOffice(param, true);
284*cdf0e10cSrcweir                     shortWait(5000);
285*cdf0e10cSrcweir                 }
286*cdf0e10cSrcweir             }
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir             sumIt.summarizeUp(entry);
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir             LogWriter sumObj = OutProducerFactory.createOutProducer(param);
291*cdf0e10cSrcweir             sumObj.initialize(entry, true);
292*cdf0e10cSrcweir             sumObj.summary(entry);
293*cdf0e10cSrcweir         }
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir         if (entries.length > 1)
296*cdf0e10cSrcweir         {
297*cdf0e10cSrcweir             System.out.println();
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir             int counter = 0;
300*cdf0e10cSrcweir             System.out.println(
301*cdf0e10cSrcweir                     "Failures that appeared during scenario execution:");
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir             for (int i = 0; i < entries.length; i++)
304*cdf0e10cSrcweir             {
305*cdf0e10cSrcweir                 if (!entries[i].State.endsWith("OK"))
306*cdf0e10cSrcweir                 {
307*cdf0e10cSrcweir                     System.out.println("\t " + entries[i].longName);
308*cdf0e10cSrcweir                     counter++;
309*cdf0e10cSrcweir                 }
310*cdf0e10cSrcweir             }
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir             System.out.println(counter + " of " + entries.length +
313*cdf0e10cSrcweir                     " tests failed");
314*cdf0e10cSrcweir         }
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir         helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
317*cdf0e10cSrcweir                 "AppProvider");
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir         if (ph != null)
320*cdf0e10cSrcweir         {
321*cdf0e10cSrcweir             office.closeExistingOffice(param, true);
322*cdf0e10cSrcweir         }
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir         return true;
325*cdf0e10cSrcweir     }
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir     protected TestEnvironment getEnv(DescEntry entry, TestParameters param)
328*cdf0e10cSrcweir     {
329*cdf0e10cSrcweir         DynamicClassLoader dcl = new DynamicClassLoader();
330*cdf0e10cSrcweir         String officeProviderName = (String) param.get("OfficeProvider");
331*cdf0e10cSrcweir         AppProvider office = (AppProvider) dcl.getInstance(officeProviderName);
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir         if (office == null)
334*cdf0e10cSrcweir         {
335*cdf0e10cSrcweir             System.out.println("ERROR: Wrong parameter 'OfficeProvider', " +
336*cdf0e10cSrcweir                     " it cannot be instantiated.");
337*cdf0e10cSrcweir             System.exit(-1);
338*cdf0e10cSrcweir         }
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir         XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
341*cdf0e10cSrcweir                 param);
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir         if (msf == null)
344*cdf0e10cSrcweir         {
345*cdf0e10cSrcweir             return null;
346*cdf0e10cSrcweir         }
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir         param.put("ServiceFactory", msf);
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir         TestCase tCase = (TestCase) new BasicTestCase(entry);
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir         System.out.println("Creating: " + tCase.getObjectName());
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir         LogWriter log = (LogWriter) dcl.getInstance(
355*cdf0e10cSrcweir                 (String) param.get("LogWriter"));
356*cdf0e10cSrcweir         log.initialize(entry, true);
357*cdf0e10cSrcweir         entry.UserDefinedParams = param;
358*cdf0e10cSrcweir         tCase.setLogWriter((PrintWriter) log);
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir         TestEnvironment tEnv = null;
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir         try
363*cdf0e10cSrcweir         {
364*cdf0e10cSrcweir             tCase.initializeTestCase(param);
365*cdf0e10cSrcweir             tEnv = tCase.getTestEnvironment(param);
366*cdf0e10cSrcweir         }
367*cdf0e10cSrcweir         catch (java.lang.RuntimeException e)
368*cdf0e10cSrcweir         {
369*cdf0e10cSrcweir             System.out.println(e.getMessage());
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir             helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
372*cdf0e10cSrcweir                     "AppProvider");
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir             if (ph != null)
375*cdf0e10cSrcweir             {
376*cdf0e10cSrcweir                 office.closeExistingOffice(param, true);
377*cdf0e10cSrcweir                 shortWait(5000);
378*cdf0e10cSrcweir             }
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir             entry.ErrorMsg = e.getMessage();
381*cdf0e10cSrcweir             entry.hasErrorMsg = true;
382*cdf0e10cSrcweir         }
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir         return tEnv;
385*cdf0e10cSrcweir     }
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir     protected void shortWait(int millis)
388*cdf0e10cSrcweir     {
389*cdf0e10cSrcweir         try
390*cdf0e10cSrcweir         {
391*cdf0e10cSrcweir             Thread.sleep(millis);
392*cdf0e10cSrcweir         }
393*cdf0e10cSrcweir         catch (java.lang.InterruptedException ie)
394*cdf0e10cSrcweir         {
395*cdf0e10cSrcweir         }
396*cdf0e10cSrcweir     }
397*cdf0e10cSrcweir 
398*cdf0e10cSrcweir     protected Vector getExclusionList(String url, boolean debug)
399*cdf0e10cSrcweir     {
400*cdf0e10cSrcweir         Vector entryList = new Vector();
401*cdf0e10cSrcweir         String line = "#";
402*cdf0e10cSrcweir         BufferedReader exclusion = null;
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir         try
405*cdf0e10cSrcweir         {
406*cdf0e10cSrcweir             exclusion = new BufferedReader(new FileReader(url));
407*cdf0e10cSrcweir         }
408*cdf0e10cSrcweir         catch (java.io.FileNotFoundException fnfe)
409*cdf0e10cSrcweir         {
410*cdf0e10cSrcweir             if (debug)
411*cdf0e10cSrcweir             {
412*cdf0e10cSrcweir                 System.out.println("Couldn't find file " + url);
413*cdf0e10cSrcweir             }
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir             return entryList;
416*cdf0e10cSrcweir         }
417*cdf0e10cSrcweir 
418*cdf0e10cSrcweir         while (line != null)
419*cdf0e10cSrcweir         {
420*cdf0e10cSrcweir             try
421*cdf0e10cSrcweir             {
422*cdf0e10cSrcweir                 if (!line.startsWith("#"))
423*cdf0e10cSrcweir                 {
424*cdf0e10cSrcweir                     entryList.add(line);
425*cdf0e10cSrcweir                 }
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir                 line = exclusion.readLine();
428*cdf0e10cSrcweir             }
429*cdf0e10cSrcweir             catch (java.io.IOException ioe)
430*cdf0e10cSrcweir             {
431*cdf0e10cSrcweir                 if (debug)
432*cdf0e10cSrcweir                 {
433*cdf0e10cSrcweir                     System.out.println(
434*cdf0e10cSrcweir                             "Exception while reading exclusion list");
435*cdf0e10cSrcweir                 }
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir                 return entryList;
438*cdf0e10cSrcweir             }
439*cdf0e10cSrcweir         }
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir         try
442*cdf0e10cSrcweir         {
443*cdf0e10cSrcweir             exclusion.close();
444*cdf0e10cSrcweir         }
445*cdf0e10cSrcweir         catch (java.io.IOException ioe)
446*cdf0e10cSrcweir         {
447*cdf0e10cSrcweir             if (debug)
448*cdf0e10cSrcweir             {
449*cdf0e10cSrcweir                 System.out.println("Couldn't close file " + url);
450*cdf0e10cSrcweir             }
451*cdf0e10cSrcweir 
452*cdf0e10cSrcweir             return entryList;
453*cdf0e10cSrcweir         }
454*cdf0e10cSrcweir 
455*cdf0e10cSrcweir         return entryList;
456*cdf0e10cSrcweir     }
457*cdf0e10cSrcweir }
458