Package org.apache.aries.application

Examples of org.apache.aries.application.VersionRange


  }

  @Test
  public void testIntersectVersionRange_Valid3()
  {
    VersionRange v1 = new VersionRangeImpl("[2.0.0,2.0.0]");
    VersionRange v2 = new VersionRangeImpl("[1.0.0,3.0.0]");
    VersionRange result = v1.intersect(v2);
    assertNotNull(result);
    assertEquals("[2.0.0,2.0.0]", result.toString());
  }
View Full Code Here


  }
 
  @Test
  public void testIntersectVersionRange_Invalid1()
  {
    VersionRange v1 = new VersionRangeImpl("[1.0.0,2.0.0]");
    VersionRange v2 = new VersionRangeImpl("(2.0.0,3.0.0]");
    VersionRange result = v1.intersect(v2);
    assertNull(result);
  }
View Full Code Here

  }

  @Test
  public void testIntersectVersionRange_Invalid2()
  {
    VersionRange v1 = new VersionRangeImpl("[1.0.0,2.0.0)");
    VersionRange v2 = new VersionRangeImpl("[2.0.0,3.0.0]");
    VersionRange result = v1.intersect(v2);
    assertNull(result);
  }
View Full Code Here

  }

  @Test
  public void testIntersectVersionRange_Invalid3()
  {
    VersionRange v1 = new VersionRangeImpl("[1.0.0,1.0.0]");
    VersionRange v2 = new VersionRangeImpl("[2.0.0,2.0.0]");
    VersionRange result = v1.intersect(v2);
    assertNull(result);
  }
View Full Code Here

          || (Constants.BUNDLE_VERSION_ATTRIBUTE.equals(attribName))) {
        // version and bundle-version attrib requires special
        // conversion.
        realAttrib = true;

        VersionRange vr = ManifestHeaderProcessor
            .parseVersionRange(attrib.getValue());

        filter.append("(" + attribName + ">=" + vr.getMinimumVersion());

        if (vr.getMaximumVersion() != null) {
          filter.append(")(" + attribName + "<=");
          filter.append(vr.getMaximumVersion());
        }

        if (vr.getMaximumVersion() != null && vr.isMinimumExclusive()) {
          filter.append(")(!(" + attribName + "=");
          filter.append(vr.getMinimumVersion());
          filter.append(")");
        }

        if (vr.getMaximumVersion() != null && vr.isMaximumExclusive()) {
          filter.append(")(!(" + attribName + "=");
          filter.append(vr.getMaximumVersion());
          filter.append(")");
        }
        filter.append(")");

      } else if (NESTED_FILTER_ATTRIBUTE.equals(attribName)) {
View Full Code Here

  public void addDirective(String key, String value) {
    this.directives.put(key, value);
  }
 
  public VersionRange getVersion() {
    VersionRange vi = null;
    if (this.attributes.get(Constants.VERSION_ATTRIBUTE) != null
        && this.attributes.get(Constants.VERSION_ATTRIBUTE).length() > 0) {
      vi = ManifestHeaderProcessor.parseVersionRange(this.attributes.get(Constants.VERSION_ATTRIBUTE));
    } else {
      // what if version is not specified?  let's interpret it as 0.0.0
View Full Code Here

TOP

Related Classes of org.apache.aries.application.VersionRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.