/*
 * This file is covered by the terms of the Common Public License v1.0.
 *
 * Copyright (c) SZEDER Gábor
 *
 * Parts of this software were developed within the JEOPARD research
 * project, which received funding from the European Union's Seventh
 * Framework Programme under grant agreement No. 216682.
 */

package de.fzi.cjunit.runners.model;

import java.lang.reflect.Method;

import org.junit.runners.model.FrameworkMethod;

import de.fzi.cjunit.ConcurrentTest;
import de.fzi.cjunit.ConcurrentTest.None;

public class ConcurrentFrameworkMethod extends FrameworkMethod {

	public ConcurrentFrameworkMethod(Method method) {
		super(method);
	}

	public Class<? extends Throwable> getExpected() {
		Class<? extends Throwable> expected
			= getAnnotation(ConcurrentTest.class).expected();
		if (expected == None.class) {
			return null;
		} else {
			return expected;
		}
	}

	public int getThreadCount() {
		return getAnnotation(ConcurrentTest.class).threadCount();
	}

	public int getThreadGroup() {
		return getAnnotation(ConcurrentTest.class).threadGroup();
	}
}

@@ -370,24 +370,75 @@
 lect.Method;
+%0Aimport java.util.ArrayList;%0Aimport java.util.List;
 %0A%0Aimport org
@@ -622,16 +622,70 @@
 thod %7B%0A%0A
+%09List%3CConcurrentFrameworkMethod%3E threadGroupMembers;%0A%0A
 %09public 
@@ -744,16 +744,83 @@
 ethod);%0A
+%09%09threadGroupMembers = new ArrayList%3CConcurrentFrameworkMethod%3E();%0A
 %09%7D%0A%0A%09pub
@@ -1166,24 +1166,24 @@
 adGroup() %7B%0A
-
 %09%09return get
@@ -1232,11 +1232,212 @@
 up();%0A%09%7D
+%0A%0A%09public void addThreadGroupMember(ConcurrentFrameworkMethod cfm) %7B%0A%09%09threadGroupMembers.add(cfm);%0A%09%7D%0A%0A%09public List%3CConcurrentFrameworkMethod%3E getThreadGroupMembers() %7B%0A%09%09return threadGroupMembers;%0A%09%7D
 %0A%7D%0A

add methods to store members of a threadGroup