Search in sources :

Example 1 with FilterBuilder

use of aQute.bnd.osgi.resource.FilterBuilder in project bnd by bndtools.

the class FilterBuilderTest method testVersionRange.

public void testVersionRange() {
    assertEquals("(&(version>=1.0.0)(!(version>=2.0.0)))", fb.in("version", new VersionRange("[1,2)")).toString());
    fb = new FilterBuilder();
    assertEquals("(&(!(version<=1.0.0))(version<=2.0.0))", fb.in("version", new VersionRange("(1,2]")).toString());
}
Also used : FilterBuilder(aQute.bnd.osgi.resource.FilterBuilder) VersionRange(aQute.bnd.version.VersionRange)

Example 2 with FilterBuilder

use of aQute.bnd.osgi.resource.FilterBuilder in project bnd by bndtools.

the class FilterBuilderTest method testVersionRangeOSGi.

public void testVersionRangeOSGi() {
    assertEquals("(&(version>=1.0.0)(!(version>=2.0.0)))", fb.in("version", new org.osgi.framework.VersionRange("[1,2)")).toString());
    fb = new FilterBuilder();
    assertEquals("(&(!(version<=1.0.0))(version<=2.0.0))", fb.in("version", new org.osgi.framework.VersionRange("(1,2]")).toString());
}
Also used : FilterBuilder(aQute.bnd.osgi.resource.FilterBuilder)

Aggregations

FilterBuilder (aQute.bnd.osgi.resource.FilterBuilder)2 VersionRange (aQute.bnd.version.VersionRange)1