Package java.io

Examples of java.io.StringReader


        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
 
  public void testActionVariableMVEL() {
    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        Reader source = new StringReader(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
            "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
            "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.actions\" package-name=\"org.drools\" version=\"1\" >\n" +
View Full Code Here


        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
 
    public void testActionNameConflict() {
      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        Reader source = new StringReader(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
            "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
            "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.actions1\" package-name=\"org.drools\" version=\"1\" >\n" +
            "\n" +
            "  <header>\n" +
      "    <globals>\n" +
      "      <global identifier=\"list\" type=\"java.util.List\" />\n" +
      "    </globals>\n" +
            "  </header>\n" +
            "\n" +
            "  <nodes>\n" +
            "    <start id=\"1\" name=\"Start\" />\n" +
      "    <actionNode id=\"2\" name=\"MyActionNode\" >\n" +
      "      <action type=\"expression\" dialect=\"java\" >list.add(\"Action1\");</action>\n" +
      "    </actionNode>\n" +
            "    <end id=\"3\" name=\"End\" />\n" +
            "  </nodes>\n" +
            "\n" +
            "  <connections>\n" +
            "    <connection from=\"1\" to=\"2\" />\n" +
            "    <connection from=\"2\" to=\"3\" />\n" +
            "  </connections>\n" +
            "\n" +
            "</process>");
        kbuilder.add(new ReaderResource(source), ResourceType.DRF);
        source = new StringReader(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
            "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
            "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.actions2\" package-name=\"org.drools\" version=\"1\" >\n" +
View Full Code Here

              errorMessage("unparseable date: " + m_Tokenizer.sval);
            }
            break;
          case Attribute.RELATIONAL:
            try {
              ArffReader arff = new ArffReader(new StringReader(m_Tokenizer.sval), m_Data.attribute(m_IndicesBuffer[numValues]).relation(), 0);
              Instances data = arff.getData();
              m_ValueBuffer[numValues] = m_Data.attribute(m_IndicesBuffer[numValues]).addRelation(data);
            }
            catch (Exception e) {
              throw new IOException(e.toString() + " of line " + getLineNo());
View Full Code Here

              errorMessage("unparseable date: " + m_Tokenizer.sval);
            }
            break;
          case Attribute.RELATIONAL:
            try {
              ArffReader arff = new ArffReader(new StringReader(m_Tokenizer.sval), m_Data.attribute(i).relation(), 0);
              Instances data = arff.getData();
              instance[i] = m_Data.attribute(i).addRelation(data);
            }
            catch (Exception e) {
              throw new IOException(e.toString() + " of line " + getLineNo());
View Full Code Here

public class ProcessStartTest extends JbpmTestCase {
   
  public void testStartConstraintTrigger() throws Exception {
    PackageBuilder builder = new PackageBuilder();
    Reader source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.start\" package-name=\"org.jbpm\" version=\"1\" >\n" +
View Full Code Here

        assertEquals("SomeString", myList.get(1));
  }
 
  public void testStartEventTrigger() throws Exception {
    PackageBuilder builder = new PackageBuilder();
    Reader source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.start\" package-name=\"org.drools\" version=\"1\" >\n" +
View Full Code Here

        public static String transform(String stylesheet,
                                       String srcXMLString,
                                       HashMap<String, String> params) throws Exception {
            StringWriter writer = new StringWriter();
            StreamResult result = new StreamResult( writer );
            Source src = new StreamSource( new StringReader( srcXMLString ) );
            transform( stylesheet,
                       src,
                       result,
                       params );
            return writer.toString();
View Full Code Here

            testConfig.addEntry(mapEntry.getKey(), mapEntry.getValue());
        }

        XMLStreamReader parser = null;
        if (contentString != null) {
            parser = StAXUtils.createXMLStreamReader(new StringReader(contentString));
        } else if (contentFile != null) {
            parser = StAXUtils.createXMLStreamReader(new FileInputStream(contentFile));
        }
       
        SOAPEnvelope envelope;
View Full Code Here

        String inputString = svg.getHeaders() + svg.generateSVGString();
       
        //SVGDocument svgDoc = svg.getRootActivity().getSVGDocument();
       
        //TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput = new TranscoderInput(stringReader);
       
        // Create the transcoder output.
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
View Full Code Here

        // Set the transcoding hints.
        jpegTranscoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(0.8));
        // Create the transcoder input.
        String inputString = svg.getHeaders() + svg.generateSVGString();
       
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
       
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
View Full Code Here

TOP

Related Classes of java.io.StringReader

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.