/*******************************************************************************
 * Copyright (c) 2008, 2011 Sonatype Inc. 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:
 *    Sonatype Inc. - initial API and implementation
 *******************************************************************************/
package TYCHO0367localRepositoryCrosstalk.bundle01;

import junit.framework.TestCase;

import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.eclipse.osgi.service.resolver.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceReference;

public class Eclipse34Test
    extends TestCase
{
    public void test()
        throws Exception
    {
        Bundle equinox = getBundle( "org.eclipse.osgi");

        assertEquals( 3, equinox.getVersion().getMajor() );
        assertEquals( 12, equinox.getVersion().getMinor() );
    }
    
    public Bundle getBundle( String id )
    {
        for ( Bundle bundle : Activator.context.getBundles() )
        {
            if ( id.equals( bundle.getSymbolicName() ) )
            {
                return bundle;
            }
        }

        throw new IllegalStateException();
    }
}
