1 package org.testng.internal;
2 
3 import org.testng.ISuite;
4 import org.testng.TestNGException;
5 import org.testng.collections.Maps;
6 import org.testng.xml.XmlSuite;
7 
8 import java.util.Collection;
9 import java.util.Map;
10 
11 public class SuiteRunnerMap {
12 
13   private Map<String, ISuite> m_map = Maps.newHashMap();
14 
put(XmlSuite xmlSuite, ISuite suite)15   public void put(XmlSuite xmlSuite, ISuite suite) {
16     final String name = xmlSuite.getName();
17     if (m_map.containsKey(name)) {
18       throw new TestNGException("SuiteRunnerMap already have runner for suite " + name);
19     }
20     m_map.put(name, suite);
21   }
22 
get(XmlSuite xmlSuite)23   public ISuite get(XmlSuite xmlSuite) {
24     return m_map.get(xmlSuite.getName());
25   }
26 
values()27   public Collection<ISuite> values() {
28     return m_map.values();
29   }
30 }
31