Examples of Tmodel


Examples of org.uddi4j.datatype.tmodel.TModel

  {

    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
    }

    // If there is a tModel
    else
    {
      CategoryBag bag = tModel.getCategoryBag();

      try
      {
        if (!checkCategoryBag(this.validator.uddiProxy, bag))
        {
          // failed
          result = AssertionResult.RESULT_FAILED;
          failureDetailMessage =
            "The tModel key is: [" + tModel.getTModelKey() + "].";
        }
      }
      catch (IllegalStateException e)
      {
        result = AssertionResult.RESULT_FAILED;
View Full Code Here

Examples of org.uddi4j.datatype.tmodel.TModel

    KeyedReference claimKeyedRef = null;

    // check whether a UDDI conformance claim is being made...

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();
    try
    {
      if ((claimKeyedRef = conformanceClaimMade(tModel)) == null)
      {
        throw new AssertionResultException(
          AssertionResult.RESULT_NOT_APPLICABLE);
      }

      // we have a conformance claim, so check the keyedReference keyValue
      if (!claimKeyedRef
        .getKeyValue()
        .equals(WSIConstants.ATTRVAL_UDDI_CLAIM_KEYVALUE))
      {
        throw new AssertionResultException(
          AssertionResult.RESULT_FAILED,
          "The tModel key is: ["
            + tModel.getTModelKey()
            + "].\nThe categoryBag is: ["
            + tModel.getCategoryBag()
            + "].");
      }
    }
    catch (AssertionResultException e)
    {
View Full Code Here

Examples of org.uddi4j.datatype.tmodel.TModel

    throws WSIException
  {
    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage = "Could not locate a tModel.";
    }

    // If there is a tModel
    else
    {
      try
      {
        HashSet claimsFromUDDI = getConformanceClaimsFromUDDI(tModel);
        HashSet claimsFromWSDL = getConformanceClaimsFromWSDL(tModel);

        if (claimsFromUDDI.size() == 0)
        {
          result = AssertionResult.RESULT_PASSED;
        }
        else if (claimsFromUDDI.size() == claimsFromWSDL.size())
        {
          int counter = 0;
          for (Iterator iter = claimsFromWSDL.iterator(); iter.hasNext();)
          {
            String claim = (String) iter.next();

            for (Iterator iter2 = claimsFromUDDI.iterator();
              iter2.hasNext();
              )
            {
              String uddiClaim = (String) iter2.next();
              if (claim.equalsIgnoreCase(uddiClaim))
              {
                counter++;
                break;
              }
            }
          }

          if (counter != claimsFromWSDL.size())
          {
            // failed
            result = AssertionResult.RESULT_FAILED;
            failureDetailMessage =
              "The tModel key is: [" + tModel.getTModelKey() + "].";
          }
        }
        else
        {
          // failed
          result = AssertionResult.RESULT_FAILED;
          failureDetailMessage =
            "The tModel key is: [" + tModel.getTModelKey() + "].";
        }
      }
      catch (IllegalStateException e)
      {
        result = AssertionResult.RESULT_FAILED;
        failureDetailMessage =
          "The tModel key is: [" + tModel.getTModelKey() + "].";
      }

    }

    // Return assertion result
View Full Code Here

Examples of org.uddi4j.datatype.tmodel.TModel

    throws WSIException
  {
    result = AssertionResult.RESULT_PASSED;

    // Get the tModel from the entryContext
    TModel tModel = (TModel) entryContext.getEntry().getEntryDetail();

    // If the tModel does not exist, then fail
    if (tModel == null)
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage =
        "Could not locate a tModel with a categorization of 'wsdlSpec'.";
    }

    // If there is a tModel and it is not categorized as "wsdlSpec", then fail
    else if (!(UDDIUtils.isWsdlSpec(tModel)))
    {
      result = AssertionResult.RESULT_FAILED;
      failureDetailMessage =
        "The tModel key is: ["
          + tModel.getTModelKey()
          + "]\n"
          + "The categoryBag is: ["
          + this.validator.categoryBagToString(tModel.getCategoryBag())
          + "]";
    }

    // Return assertion result
    return validator.createAssertionResult(testAssertion, result, failureDetailMessage);
View Full Code Here

Examples of org.uddi4j.datatype.tmodel.TModel

  public void validateArtifact() throws WSIException
  {
    Entry entry = null;

    BindingTemplate bindingTemplate = null;
    TModel tModel = null;

    // it depricated after refactoring
    // now the inner classes moved out from validator
    //String classPrefix = this.getClass().getName() + "$";
    String classPrefix = this.getClass().getPackage().getName()+".";

    try
    {
      // Set up a reference to the UDDI registry
      uddiProxy = new UDDIProxy();

      //new Socket(new InetAddress(uddiReference.getInquiryURL()));
      uddiProxy.setInquiryURL(uddiReference.getInquiryURL());
      boolean wasEx = false;
      InputStream stream;
      try
      {
        URL url = StringUtils.getURL(null, uddiReference.getInquiryURL());
        stream = url.openStream();
        stream.close();
      }

      catch (UnknownHostException ex)
      {
        wasEx = true;
      }

      catch (IOException ex)
      {
      }

      if (!wasEx)
      {

        // If the UDDI reference is to a bindingTemplate then get it
        if (uddiReference.getKeyType().equals(UDDIReference.BINDING_KEY))
        {
          // Get binding detail which will contain the bindingTemplate
          BindingDetail bindingDetail =
            uddiProxy.get_bindingDetail(uddiReference.getKey());

          // Get bindingTemplate
          bindingTemplate =
            (BindingTemplate) bindingDetail
              .getBindingTemplateVector()
              .elementAt(
              0);

          if (verboseOption)
          {
            System.err.println(
              "    BindingTemplate - "
                + UDDIUtils.bindingTemplateToString(bindingTemplate));
          }

          // Get the wsdlSpec tModel
          tModel = UDDIUtils.findTModel(uddiProxy, bindingTemplate,
                  verboseOption);
        }

        // Else it has to be a tModel
        else
        {
          TModelDetail tModelDetail =
            uddiProxy.get_tModelDetail(uddiReference.getKey());
          tModel = (TModel) tModelDetail.getTModelVector().elementAt(0);
        }

        if (verboseOption)
        {
          System.err.println(
            "    TModel specified or found in bindingTemplate - "
              + UDDIUtils.tModelToString(tModel));
        }
      }

      if (bindingTemplate == null)
      {
        setMissingInput(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
      }

      // If there is a bindingTemplate, then process test assertions for it
      else
      {
        // Create entry
        entry = this.reporter.getReport().createEntry();
        entry.setEntryType(
          EntryType.getEntryType(TYPE_DISCOVERY_BINDINGTEMPLATE));
        entry.setReferenceID(bindingTemplate.getBindingKey());
        entry.setEntryDetail(bindingTemplate);

        // Process test assertions
        processAssertions(
          classPrefix,
          new EntryContext(entry, this.analyzerContext));
      }

      // NOTE: From this point forward, if a bindingTemplate does NOT have a wsdlSpec tModel,
      //       the tModel will be NULL.

      // Create entry
      entry = this.reporter.getReport().createEntry();
      entry.setEntryType(
        EntryType.getEntryType(TYPE_DISCOVERY_TMODEL));
      entry.setReferenceID(
        (tModel == null ? "[tModel]" : tModel.getTModelKey()));
      entry.setEntryDetail(tModel);

      // Process test assertions
      processAssertions(
        classPrefix,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.