Examples of SmooksResourceConfiguration


Examples of org.milyn.cdr.SmooksResourceConfiguration

      final String resourceName,
      final String fileName ,
      final String destinationDirectory ,
      final String listFileName )
  {
      SmooksResourceConfiguration config = new SmooksResourceConfiguration( "x", FileOutputStreamResource.class.getName() );
    config.setParameter( "resourceName", resourceName );
    config.setParameter( "fileNamePattern", fileName );
    config.setParameter( "destinationDirectoryPattern", destinationDirectory );
    config.setParameter( "listFileNamePattern", listFileName );
    return config;
  }
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

    @Test ( groups = "unit" )
  public void setJndiProviderUrl()
  {
    final String providerUrl = "jnp://localhost:1099";
      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
    setManadatoryProperties( config );
        config.setParameter( "jndiProviderUrl", providerUrl );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        assertEquals( "ProviderURL did not match the one set on the Router",
            providerUrl, router.getJndiProviderUrl() );
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

    @Test ( groups = "unit" )
  public void setJndiNamingFactoryUrl()
  {
    final String namingFactoryUrlPkgs = "org.jboss.naming:org.jnp.interfaces";

      SmooksResourceConfiguration config = new SmooksResourceConfiguration(selector, JMSRouter.class.getName());
    setManadatoryProperties( config );
        config.setParameter( "jndiNamingFactoryUrl", namingFactoryUrlPkgs );
        final JMSRouter router = new JMSRouter();
        Configurator.configure( router, config, new MockApplicationContext() );

        assertEquals( "NamingFactoryUrlPkg did not match the one set on the Router",
            namingFactoryUrlPkgs, router.getJndiNamingFactoryUrl() );
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

  }
 
  private BeanRouter createBeanRouter(String selector, String beanId, String endpointUri)
  {
    BeanRouter beanRouter = new BeanRouter();
    SmooksResourceConfiguration resourceConfig = new SmooksResourceConfiguration();
    if (selector != null)
    {
      resourceConfig.setSelector(selector);
    }
    resourceConfig.setParameter("beanId", beanId);
    resourceConfig.setParameter("toEndpoint", endpointUri);
   
    MockApplicationContext appContext = new MockApplicationContext();
    appContext.setAttribute(CamelContext.class, context);
    Configurator.configure(beanRouter, resourceConfig, appContext);
   
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

        this.executeBefore = executeBefore;
        return this;
    }

    public SmooksResourceConfiguration createConfiguration() {
        SmooksResourceConfiguration config = new SmooksResourceConfiguration();
        config.setParameter("executeBefore", Boolean.toString(executeBefore));
        return config;
    }
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

        this.executeBefore = executeBefore;
        return this;
    }

    public SmooksResourceConfiguration createConfiguration() {
        SmooksResourceConfiguration config = new SmooksResourceConfiguration();
        config.setParameter("executeBefore", Boolean.toString(executeBefore));
        return config;
    }
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

    Locale.setDefault(defaultLocale);
  }

    public void testConstructorConfigValidation() {
        SmooksResourceConfiguration config = new SmooksResourceConfiguration("x", BeanPopulator.class.getName());

        testConstructorConfigValidation(config, "Invalid Smooks bean configuration. 'beanClass' <param> not specified.");

        config.setParameter("beanId", "x");
        config.setParameter("beanClass", " ");

        testConstructorConfigValidation(config, "Invalid Smooks bean configuration. 'beanClass' <param> not specified.");
    }
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

*/
public class XslContentHandlerFactoryTest extends TestCase {

  public void testXslUnitTrans_filebased_replace() {
    Smooks smooks = new Smooks();
    SmooksResourceConfiguration res = new SmooksResourceConfiguration("p", "org/milyn/templating/xslt/xsltransunit.xsl");
    String transResult = null;

        System.setProperty("javax.xml.transform.TransformerFactory", org.apache.xalan.processor.TransformerFactoryImpl.class.getName());
    SmooksUtil.registerResource(res, smooks);

View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

    testXslUnitTrans_parambased("replace", "xsltransunit.expected5");
  }

  public void testXslUnitTrans_parambased(String action, String expectedFileName) {
    Smooks smooks = new Smooks();
    SmooksResourceConfiguration res = new SmooksResourceConfiguration("p", "<z id=\"{@id}\">Content from template!!</z>");
    String transResult = null;

    System.setProperty("javax.xml.transform.TransformerFactory", org.apache.xalan.processor.TransformerFactoryImpl.class.getName());

    res.setResourceType("xsl");
        res.setParameter(XslContentHandlerFactory.IS_XSLT_TEMPLATELET, "true");
    res.setParameter("action", action);
    SmooksUtil.registerResource(res, smooks);

    try {
      InputStream stream = getClass().getResourceAsStream("htmlpage.html");
            ExecutionContext context = smooks.createExecutionContext();
View Full Code Here

Examples of org.milyn.cdr.SmooksResourceConfiguration

   * Used by Smooks to retrieve the visitor configuration of this Value Configuration
   */
  public void addVisitors(VisitorConfigMap visitorMap) {

    ValueBinder binder = new ValueBinder(getBeanId());
    SmooksResourceConfiguration populatorConfig = new SmooksResourceConfiguration(dataSelector);

    SelectorPropertyResolver.resolveSelectorTokens(populatorConfig);

    binder.setDecoder(decoder);
    binder.setDefaultValue(defaultValue);
    binder.setValueAttributeName(populatorConfig.getStringParameter(BeanInstancePopulator.VALUE_ATTRIBUTE_NAME));

    visitorMap.addVisitor(binder, populatorConfig.getSelector(), targetNamespace, true);
  }
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.