Search in sources :

Example 16 with VersionRange

use of org.apache.aries.util.VersionRange in project aries by apache.

the class DeploymentContentImplTest method testDeploymentContent002.

@Test
public void testDeploymentContent002() throws Exception {
    DeploymentContentImpl dc = new DeploymentContentImpl("com.travel.reservation.business;deployed-version=2.0");
    assertEquals("2.0", dc.getAttribute("deployed-version"));
    VersionRange vi = dc.getVersion();
    assertTrue(vi.isExactVersion());
    assertEquals(new Version("2.0"), dc.getExactVersion());
    assertEquals("com.travel.reservation.business", dc.getContentName());
    assertEquals("{deployed-version=2.0}", dc.getNameValueMap().toString());
}
Also used : Version(org.osgi.framework.Version) VersionRange(org.apache.aries.util.VersionRange) Test(org.junit.Test)

Aggregations

VersionRange (org.apache.aries.util.VersionRange)16 Test (org.junit.Test)8 Version (org.osgi.framework.Version)6 HashMap (java.util.HashMap)4 Content (org.apache.aries.application.Content)4 InputStream (java.io.InputStream)2 ApplicationMetadata (org.apache.aries.application.ApplicationMetadata)2 ApplicationMetadataFactoryImpl (org.apache.aries.application.impl.ApplicationMetadataFactoryImpl)2 AriesApplication (org.apache.aries.application.management.AriesApplication)2 ResolveConstraint (org.apache.aries.application.management.ResolveConstraint)2 RepositoryGenerator (org.apache.aries.application.management.spi.repository.RepositoryGenerator)2 ImportedPackage (org.apache.aries.application.modelling.ImportedPackage)2 ModellingManager (org.apache.aries.application.modelling.ModellingManager)2 RepositoryAdmin (org.apache.felix.bundlerepository.RepositoryAdmin)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 InvalidAttributeException (org.apache.aries.application.InvalidAttributeException)1