/**
   * Tests that a target definition based on the default target platform restricted to a subset of
   * bundles contains the right set. In this case empty, since the versions specified are bogus.
   *
   * @throws Exception
   */
  public void testMissingVersionRestrictedDefaultTargetPlatform() throws Exception {
    ITargetDefinition definition = getNewTarget();
    ITargetLocation container =
        getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(), null);
    NameVersionDescriptor[] restrictions =
        new NameVersionDescriptor[] {
          new NameVersionDescriptor("org.eclipse.jdt.launching", "xyz"),
          new NameVersionDescriptor("org.eclipse.jdt.debug", "abc")
        };
    definition.setTargetLocations(new ITargetLocation[] {container});
    definition.setIncluded(restrictions);
    definition.resolve(null);
    TargetBundle[] bundles = definition.getBundles();

    assertEquals("Wrong number of bundles", 2, bundles.length);
    for (int i = 0; i < bundles.length; i++) {
      TargetBundle rb = bundles[i];
      assertEquals(
          "Should be a missing bundle version",
          TargetBundle.STATUS_VERSION_DOES_NOT_EXIST,
          rb.getStatus().getCode());
      assertEquals("Should be an error", IStatus.ERROR, rb.getStatus().getSeverity());
    }
  }