1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.cts.verifier.p2p.testcase;
18 
19 import java.util.ArrayList;
20 
21 import android.content.Context;
22 
23 public class ServReqTestSuite {
24 
25     private static ArrayList<ReqTestCase> sTestSuite = null;
26 
getTestSuite(Context context)27     public static ArrayList<ReqTestCase> getTestSuite(Context context) {
28         initialize(context);
29         return sTestSuite;
30     }
31 
getTestCase(Context context, String testId)32     public static ReqTestCase getTestCase(Context context,
33             String testId) {
34         initialize(context);
35 
36         for (ReqTestCase test: sTestSuite) {
37             if (test.getTestId().equals(testId)) {
38                 return test;
39             }
40         }
41         return null;
42     }
43 
initialize(Context context)44     private static void initialize(Context context) {
45         if (sTestSuite != null) {
46             return;
47         }
48 
49         sTestSuite = new ArrayList<ReqTestCase>();
50         sTestSuite.add(new ServReqAllTestCase01(context));
51         sTestSuite.add(new ServReqAllTestCase02(context));
52         sTestSuite.add(new ServReqAllTestCase03(context));
53         sTestSuite.add(new ServReqDnsPtrTestCase(context));
54         sTestSuite.add(new ServReqDnsTxtTestCase(context));
55         sTestSuite.add(new ServReqUpnpAllTestCase(context));
56         sTestSuite.add(new ServReqUpnpRootDeviceTestCase(context));
57         sTestSuite.add(new ServReqRemoveRequestTestCase(context));
58         sTestSuite.add(new ServReqClearRequestTestCase(context));
59         sTestSuite.add(new ServReqMultiClientTestCase01(context));
60         sTestSuite.add(new ServReqMultiClientTestCase02(context));
61         sTestSuite.add(new ServReqMultiClientTestCase03(context));
62     }
63 }
64