Package java.io

Examples of java.io.StringBufferInputStream


                {
                    throw new ServiceAccessException(service,e);
                }
                return new ByteArrayInputStream(out.toByteArray());
        }
        return new StringBufferInputStream("");
   }
View Full Code Here


                log.append("   Match using CharacterArrayCharacterIterator\n");
                if (!tryMatchUsingCI(new CharacterArrayCharacterIterator(toMatch.toCharArray(), 0, toMatch.length())))
                    return;

                log.append("   Match using StreamCharacterIterator\n");
                if (!tryMatchUsingCI(new StreamCharacterIterator(new StringBufferInputStream(toMatch))))
                    return;

                log.append("   Match using ReaderCharacterIterator\n");
                if (!tryMatchUsingCI(new ReaderCharacterIterator(new StringReader(toMatch))))
                    return;
View Full Code Here

            if (st.contains("<arg0>99</arg0>")) {
                throw new ProtocolException("I don't like the value 99");
            }
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - 1);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
           
            messagecontext.put("AddNumbersLogicalHandlerInboundAppScopedProperty", "blargval");
            messagecontext.setScope("AddNumbersLogicalHandlerInboundAppScopedProperty",
                                    Scope.APPLICATION);
            messagecontext.put("AddNumbersLogicalHandlerInboundHandlerScopedProperty",
                               "blargval");
           
            // Check for the presences of the attachment property
            String propKey = MessageContext.INBOUND_MESSAGE_ATTACHMENTS;
            Map map = (Map) messagecontext.get(propKey);
            if (map == null) {
                throw new RuntimeException("Property " + propKey + " was null");
            }
            if (!(map instanceof AttachmentsAdapter)) {
                throw new RuntimeException("Expected AttachmentAddapter for Property " +
                                           propKey);
            }

        } else { // outbound response if we're on the server
            LogicalMessage msg = messagecontext.getMessage();
            String st = getStringFromSourcePayload(msg.getPayload());
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - deduction);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
           
            // Check for the presences of the attachment property
            String propKey = MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS;
            Map map = (Map) messagecontext.get(propKey);
            if (map == null) {
View Full Code Here

            LogicalMessage msg = messagecontext.getMessage();
            Source payload = msg.getPayload();
            String st = getStringFromSourcePayload(payload);
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) * 2);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
        }
        return true;
    }
View Full Code Here

            }
            LogicalMessage msg = messagecontext.getMessage();
            String st = getStringFromSourcePayload(msg.getPayload());
            String txt = String.valueOf(Integer.valueOf(getFirstArg(st)) - 1);
            st = replaceFirstArg(st, txt);
            msg.setPayload(new StreamSource(new StringBufferInputStream(st)));
        }
        else {
            LogicalMessage msg = messagecontext.getMessage();
           
            Source s = msg.getPayload();
View Full Code Here

  /**
   * Sets up the fixture, for example, open a network connection. This method
   * is called before a test is executed.
   */
  protected void setUp() {
    sbis = new StringBufferInputStream("Hello World");
  }
View Full Code Here

  /**
   * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
   */
  @SuppressWarnings("deprecation")
    public void test_ConstructorLjava_io_InputStream() throws IOException {
    st = new StreamTokenizer(new StringBufferInputStream(
        "/comments\n d 8 'h'"));

    assertEquals("the next token returned should be the letter d",
           StreamTokenizer.TT_WORD, st.nextToken());
    assertEquals("the next token returned should be the letter d",
View Full Code Here

  }

  public InputStream getInputStream()
    throws ProcessingException, IOException
  {
    return new StringBufferInputStream(stringBuffer.toString());
  }
View Full Code Here

        args.add(arg);
    }
    args.add("-");
    args.addAll(extra);
    new DataFileWriteTool().run(
        new StringBufferInputStream(jsonData),
        new PrintStream(out), // stdout
        null, // stderr
        args);
    out.close();
    fout.close();
View Full Code Here

  public void testFailureOnWritingPartialJSONValues() throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PrintStream out = new PrintStream(baos);
    try {
      new DataFileWriteTool().run(
          new StringBufferInputStream("{"),
          new PrintStream(out), // stdout
          null, // stderr         
          Arrays.asList("-schema", "{ \"type\":\"record\", \"fields\":" +
                        "[{\"name\":\"foo\", \"type\":\"string\"}], " +
                        "\"name\":\"boring\" }", "-"));
View Full Code Here

TOP

Related Classes of java.io.StringBufferInputStream

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.