Skip to main content
summaryrefslogtreecommitdiffstats
blob: c9ee4556b173d01726e96387b2c7273b63f2ec02 (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
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.prov.tests.engine;

import junit.framework.TestCase;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.prov.engine.*;
import org.eclipse.equinox.prov.metadata.InstallableUnit;
import org.eclipse.equinox.prov.metadata.ResolvedInstallableUnit;

/**
 * Simple test of the engine API.
 */
public class PhaseSetTest extends TestCase {
	public PhaseSetTest(String name) {
		super(name);
	}

	public PhaseSetTest() {
		super("");
	}

	public void testNullPhases() {
		try {
			new PhaseSet(null) {
				// empty PhaseSet
			};
		} catch (IllegalArgumentException exepcted) {
			return;
		}
		fail();
	}

	public void testEmptyPhases() {
		Profile profile = new Profile("test");
		PhaseSet phaseSet = new PhaseSet(new Phase[] {}) {
			// empty PhaseSet
		};
		Operand op = new Operand(new ResolvedInstallableUnit(new InstallableUnit()), null);
		Operand[] operands = new Operand[] {op};

		IStatus result = phaseSet.perform(new EngineSession(), profile, operands, new NullProgressMonitor());
		assertTrue(result.isOK());
	}
}

Back to the top