Skip to main content
summaryrefslogtreecommitdiffstats
blob: 646c2e03830652a79b75549372cc3cb0a8ea7b12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************************
 * Copyright (c) 2006, 2009 Steffen Pingel and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Steffen Pingel - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.trac.tests;

import junit.framework.Test;
import junit.framework.TestSuite;

import org.eclipse.mylyn.internal.trac.core.client.ITracClient.Version;
import org.eclipse.mylyn.tests.util.TestUtil;
import org.eclipse.mylyn.trac.tests.client.TracClientFactoryTest;
import org.eclipse.mylyn.trac.tests.client.TracClientProxyTest;
import org.eclipse.mylyn.trac.tests.client.TracClientTest;
import org.eclipse.mylyn.trac.tests.client.TracRepositoryInfoTest;
import org.eclipse.mylyn.trac.tests.client.TracSearchTest;
import org.eclipse.mylyn.trac.tests.client.TracTicketTest;
import org.eclipse.mylyn.trac.tests.client.TracXmlRpcClientTest;
import org.eclipse.mylyn.trac.tests.core.TracClientManagerTest;
import org.eclipse.mylyn.trac.tests.support.TracFixture;

/**
 * @author Steffen Pingel
 */
public class AllTracHeadlessStandaloneTests {

	public static Test suite() {
		return suite(TestUtil.runHeartbeatTestsOnly());
	}

	public static Test suite(boolean defaultOnly) {
		TestSuite suite = new TestSuite("Headless Standalone Tests for org.eclipse.mylyn.trac.tests");
		// client tests
		suite.addTestSuite(TracSearchTest.class);
		suite.addTestSuite(TracTicketTest.class);
		suite.addTestSuite(TracRepositoryInfoTest.class);
		suite.addTestSuite(TracClientProxyTest.class);
		// core tests
		suite.addTestSuite(TracClientManagerTest.class);
		if (defaultOnly) {
			addTests(suite, TracFixture.DEFAULT);
		} else {
			// network tests
			for (TracFixture fixture : TracFixture.ALL) {
				addTests(suite, fixture);
			}
			// validation tests
			for (TracFixture fixture : TracFixture.MISC) {
				fixture.createSuite(suite);
				fixture.add(TracClientFactoryTest.class);
				fixture.add(TracClientTest.class);
				fixture.done();
			}
		}
		return suite;
	}

	private static void addTests(TestSuite suite, TracFixture fixture) {
		fixture.createSuite(suite);
		fixture.add(TracClientFactoryTest.class);
		fixture.add(TracClientTest.class);
		if (fixture.getAccessMode() == Version.XML_RPC) {
			fixture.add(TracXmlRpcClientTest.class);
		}
		fixture.done();
	}

}

Back to the top