01: /*
02:
03: Derby - Class org.apache.derbyTesting.functionTests.harness.SkipTest
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to You under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: package org.apache.derbyTesting.functionTests.harness;
23:
24: import java.util.Properties;
25: import java.io.BufferedReader;
26: import java.io.InputStream;
27: import java.io.InputStreamReader;
28:
29: /**
30: Determine if the named test is one which should not be
31: run in a particular framework (defined by the propFileName).
32: For instance, there could be a nowl.properties for a list of
33: tests which do not currently work under the WebLogic framework.
34: */
35: public class SkipTest {
36:
37: private SkipTest() {
38: }
39:
40: public static boolean skipIt(String listFileName, String testName)
41: throws Exception {
42: boolean answer = false;
43: InputStream is = RunTest.loadTestResource("suites" + '/'
44: + listFileName);
45: if (is == null) {
46: System.out.println("File not found: " + listFileName);
47: answer = false;
48: return answer;
49: }
50:
51: // Create a BufferedReader to read the list of tests to skip
52: BufferedReader listFile = new BufferedReader(
53: new InputStreamReader(is, "UTF-8"));
54: String str = "";
55: // Read the list of tests to skip, compare to testName
56: while ((str = listFile.readLine()) != null) {
57: if ((testName.equals(str)))
58: answer = true;
59: }
60: return answer;
61: }
62: }
|