Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.sun.ejte.ccl.reporter; |
| 18 | |
| 19 | /** |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 20 | @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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | |
| 28 | import java.util.Hashtable; |
| 29 | import java.util.Vector; |
| 30 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 31 | public class TestSuite |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 32 | { |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 33 | private String id; |
| 34 | private String name; |
| 35 | private String description; |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 36 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 37 | Hashtable testHash; |
| 38 | Vector testIdVector; |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 39 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 40 | 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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 48 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 49 | 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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 57 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 58 | 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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 66 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 67 | public String getId( ) |
| 68 | { |
| 69 | return id; |
| 70 | } |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 71 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 72 | public String getName( ) |
| 73 | { |
| 74 | return name; |
| 75 | } |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 76 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 77 | public String getDescription( ) |
| 78 | { |
| 79 | return description; |
| 80 | } |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 81 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 82 | public Vector getTestIdVector( ) |
| 83 | { |
| 84 | return testIdVector; |
| 85 | } |
| 86 | public void setTestIdVector( Vector tidVector) |
| 87 | { |
| 88 | testIdVector= tidVector; |
| 89 | } |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 90 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 91 | public Hashtable getTestHash( ) |
| 92 | { |
| 93 | return testHash; |
| 94 | } |
| 95 | public void setTestHash( Hashtable testHash ) |
| 96 | { |
| 97 | this.testHash= testHash; |
| 98 | } |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 99 | |
David Matějček | f4dc06a | 2021-05-17 12:10:57 +0200 | [diff] [blame^] | 100 | 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 Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 109 | |
| 110 | } |