private LinkedList<Word> getShuffledWords() {
    if (CollectionUtils.isEmpty(this.shuffledWords)) {
      this.shuffledWords = new LinkedList<Word>(this.wordBook.getAllWords());

      Collections.shuffle(this.shuffledWords);
    }

    return shuffledWords;
  }
Esempio n. 2
0
  // TODO: Should also check SoapHeader/SoapHeaderFault
  public boolean checkR2205() {
    Collection<Binding> bindings = CastUtils.cast(def.getBindings().values());
    for (Binding binding : bindings) {

      if (!SOAPBindingUtil.isSOAPBinding(binding)) {
        System.err.println(
            "WSIBP Validator found <" + binding.getQName() + "> is NOT a SOAP binding");
        continue;
      }
      if (binding.getPortType() == null) {
        // will error later
        continue;
      }

      for (Iterator<?> ite2 = binding.getPortType().getOperations().iterator(); ite2.hasNext(); ) {
        Operation operation = (Operation) ite2.next();
        Collection<Fault> faults = CastUtils.cast(operation.getFaults().values());
        if (CollectionUtils.isEmpty(faults)) {
          continue;
        }

        for (Fault fault : faults) {
          Message message = fault.getMessage();
          Collection<Part> parts = CastUtils.cast(message.getParts().values());
          for (Part part : parts) {
            if (part.getElementName() == null) {
              addErrorMessage(
                  getErrorPrefix("WSI-BP-1.0 R2205")
                      + "In Message "
                      + message.getQName()
                      + ", part "
                      + part.getName()
                      + " must specify a 'element' attribute");
              return false;
            }
          }
        }
      }
    }
    return true;
  }