コード例 #1
0
  @Override
  public void resolve(ResolveContext<?> context) {
    super.resolve(context);

    if (targetTestCase == null) {
      if (context.hasThisModelItem(
          this, "Missing Test Case", getTestStepTitle() + "/" + stepConfig.getTargetTestCase()))
        return;
      context
          .addPathToResolve(
              this, "Missing Test Case", getTestStepTitle() + "/" + stepConfig.getTargetTestCase())
          .addResolvers(
              new RunTestCaseRemoveResolver(this),
              new ChooseAnotherTestCase(this),
              new CreateNewEmptyTestCase(this));
    } else {
      targetTestCase.resolve(context);
      if (context.hasThisModelItem(
          this, "Missing Test Case", getTestStepTitle() + "/" + stepConfig.getTargetTestCase())) {
        context
            .getPath(
                this,
                "Missing Test Case",
                getTestStepTitle() + "/" + stepConfig.getTargetTestCase())
            .setSolved(true);
      }
    }
  }
コード例 #2
0
ファイル: WsdlInterface.java プロジェクト: thamuz/soapui
  @SuppressWarnings("unchecked")
  @Override
  public void resolve(ResolveContext<?> context) {
    super.resolve(context);

    String definition = definitionProperty.expandUrl();
    if (!isCached() && definition.startsWith("file:")) {
      try {
        File file = new File(definition.substring(5));
        if (!file.exists()) {
          if (context.hasThisModelItem(this, "Missing WSDL file", definition)) return;
          context.addPathToResolve(
              this,
              "Missing WSDL file",
              definition,
              new ResolveContext.FileResolver(
                  "Select WSDL File", "wsdl", "WSDL Files (*.wsdl)", file.getParent()) {

                @Override
                public boolean apply(File newFile) {
                  try {
                    setDefinition(newFile.toURI().toURL().toString());
                    return true;
                  } catch (Exception e) {
                    log.error("Invalid URL for new Definition", e);
                    return false;
                  }
                }
              });
        } else {
          if (context.hasThisModelItem(this, "Missing WSDL file", definition))
            context.getPath(this, "Missing WSDL file", definition).setSolved(true);
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }