diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java new file mode 100644 index 000000000..c9ee4556b --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/prov/tests/engine/PhaseSetTest.java @@ -0,0 +1,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()); + } +} |