blob: 4249dccdfdbfb4990ef6c8bc8970c1d6a40a86d2 [file] [log] [blame]
Vinay Vishal57171472018-09-18 20:22:00 +05301/*
2 * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v. 2.0, which is available at
6 * http://www.eclipse.org/legal/epl-2.0.
7 *
8 * This Source Code may also be made available under the following Secondary
9 * Licenses when the conditions for such availability set forth in the
10 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 * version 2 with the GNU Classpath Exception, which is available at
12 * https://www.gnu.org/software/classpath/license.html.
13 *
14 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 */
16
17package com.sun.ejte.ccl.reporter;
18
19/**
David Matějčekf4dc06a2021-05-17 12:10:57 +020020 @Class: TestSuite
21 @Description: Class holding One TestSuite info.
22 @Author : Ramesh Mandava
23 @Last Modified : By Ramesh on 10/24/2001
24 @Last Modified : By Ramesh on 1/20/2002 , For preserving order of entry of tests used a separate testIdVector
Vinay Vishal57171472018-09-18 20:22:00 +053025*/
26
27
28import java.util.Hashtable;
29import java.util.Vector;
30
David Matějčekf4dc06a2021-05-17 12:10:57 +020031public class TestSuite
Vinay Vishal57171472018-09-18 20:22:00 +053032{
David Matějčekf4dc06a2021-05-17 12:10:57 +020033 private String id;
34 private String name;
35 private String description;
Vinay Vishal57171472018-09-18 20:22:00 +053036
David Matějčekf4dc06a2021-05-17 12:10:57 +020037 Hashtable testHash;
38 Vector testIdVector;
Vinay Vishal57171472018-09-18 20:22:00 +053039
David Matějčekf4dc06a2021-05-17 12:10:57 +020040 public TestSuite( String id, String name, String description )
41 {
42 this.id = id;
43 this.name= name;
44 this.description = description;
45 testHash = new Hashtable();
46 testIdVector = new Vector();
47 }
Vinay Vishal57171472018-09-18 20:22:00 +053048
David Matějčekf4dc06a2021-05-17 12:10:57 +020049 public TestSuite (String id, String name )
50 {
51 this.id = id;
52 this.name = name;
53 this.description=ReporterConstants.NA;
54 testHash = new Hashtable();
55 testIdVector = new Vector();
56 }
Vinay Vishal57171472018-09-18 20:22:00 +053057
David Matějčekf4dc06a2021-05-17 12:10:57 +020058 public TestSuite (String id )
59 {
60 this.id = id;
61 this.name = ReporterConstants.NA;
62 this.description=ReporterConstants.NA;
63 testHash = new Hashtable();
64 testIdVector = new Vector();
65 }
Vinay Vishal57171472018-09-18 20:22:00 +053066
David Matějčekf4dc06a2021-05-17 12:10:57 +020067 public String getId( )
68 {
69 return id;
70 }
Vinay Vishal57171472018-09-18 20:22:00 +053071
David Matějčekf4dc06a2021-05-17 12:10:57 +020072 public String getName( )
73 {
74 return name;
75 }
Vinay Vishal57171472018-09-18 20:22:00 +053076
David Matějčekf4dc06a2021-05-17 12:10:57 +020077 public String getDescription( )
78 {
79 return description;
80 }
Vinay Vishal57171472018-09-18 20:22:00 +053081
David Matějčekf4dc06a2021-05-17 12:10:57 +020082 public Vector getTestIdVector( )
83 {
84 return testIdVector;
85 }
86 public void setTestIdVector( Vector tidVector)
87 {
88 testIdVector= tidVector;
89 }
Vinay Vishal57171472018-09-18 20:22:00 +053090
David Matějčekf4dc06a2021-05-17 12:10:57 +020091 public Hashtable getTestHash( )
92 {
93 return testHash;
94 }
95 public void setTestHash( Hashtable testHash )
96 {
97 this.testHash= testHash;
98 }
Vinay Vishal57171472018-09-18 20:22:00 +053099
David Matějčekf4dc06a2021-05-17 12:10:57 +0200100 public void addTest( Test myTest )
101 {
102 if ( testHash.put( myTest.getId().trim(), myTest) != null )
103 {
104 System.err.println("Error : Test was added before only. Still allowing. Old value of the test will be overridden" );
105 }
106
107 testIdVector.addElement( myTest.getId().trim() );
108 }
Vinay Vishal57171472018-09-18 20:22:00 +0530109
110}