package jUnitXmlReporter;

import java.util.ArrayList;

public class TestSuite
{
	private String name;
	private ArrayList<TestCase> testCaseList;
	
	public TestSuite(String name)
	{
		this.setName(name);
		this.testCaseList = new ArrayList<>();
	}
	
	public void addTestCase(TestCase tc)
	{
		testCaseList.add(tc);
	}

	public ArrayList<TestCase> getTestCaseList()
	{
		return testCaseList;
	}

	public void setTestCaseList(ArrayList<TestCase> testCaseList)
	{
		this.testCaseList = testCaseList;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}
}

@@ -47,16 +47,65 @@
 rayList;
+%0Aimport java.util.HashMap;%0Aimport java.util.List;
 %0A%0Apublic
@@ -154,26 +154,32 @@
 private 
-ArrayList%3C
+HashMap%3CString, 
 TestCase
@@ -188,20 +188,19 @@
 testCase
-List
+Map
 ;%0A%09%0A%09pub
@@ -270,28 +270,25 @@
 Case
-List
+Map
  = new 
-ArrayList
+HashMap
 %3C%3E()
@@ -341,60 +341,307 @@
 %7B%0A%09%09
-testCaseList.add(tc
+if(containsTestCase(tc))%0A%09%09%7B%0A%09%09%09String oldMessage = testCaseMap.get(tc.getName()).getMessage();%0A%09%09%09String newMessage = oldMessage + %22%5Cn%22 + tc.getMessage();%0A%09%09%09testCaseMap.get(tc.getName()).setMessage(newMessage
 );%0A
+%09
 %09%7D%0A
-%0A%09public ArrayList%3C
+%09%09else%0A%09%09%09testCaseMap.put(tc.getName(), tc);%0A%09%7D%0A%0A%09private boolean contains
 TestCase
 %3E ge
@@ -640,21 +640,17 @@
 Case
-%3E get
+(
 TestCase
 List
@@ -645,21 +645,19 @@
 TestCase
-List(
+ tc
 )%0A%09%7B%0A%09%09r
@@ -674,52 +674,120 @@
 Case
-List;%0A%09%7D%0A%0A%09public void setTestCaseList(Array
+Map.containsKey(tc.getName()) &&%0A%09%09%09%09testCaseMap.get(tc.getName()).getType().equals(tc.getType());%0A%09%7D%0A%09%0A%09public 
 List
@@ -793,25 +793,28 @@
 t%3CTestCase%3E 
-t
+getT
 estCaseList)
@@ -816,47 +816,68 @@
 List
+(
 )%0A%09%7B%0A%09%09
-this.testCaseList = testCaseList
+return new ArrayList%3CTestCase%3E(testCaseMap.values())
 ;%0A%09%7D

append message to already existing testcase in a testsuite