Example #1
0
 public void doTestBadReturnType(Transformer tran, Object src) throws Exception {
   tran.setReturnClass(InvalidSatsuma.class);
   try {
     tran.transform(src);
     fail("Should throw exception for bad return type");
   } catch (TransformerException e) {
     // expected
   }
 }
Example #2
0
  public Transformer getTransformer() throws Exception {
    Transformer trans = createObject(DomDocumentToXml.class);
    trans.setReturnClass(String.class);

    EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test", muleContext);
    builder.setEncoding("US-ASCII");
    ImmutableEndpoint endpoint =
        muleContext.getRegistry().lookupEndpointFactory().getInboundEndpoint(builder);

    trans.setEndpoint(endpoint);
    return trans;
  }