Package org.jboss.soa.esb.helpers

Examples of org.jboss.soa.esb.helpers.ConfigTree


    assertEquals("Hello W", decodedRes);
  }
 
  public void test_Chars() throws ConfigurationException, MimeDecodeException {
    TextPlainMimeDecoder decoder = new TextPlainMimeDecoder();
    ConfigTree config = new ConfigTree("conf");
   
    config.setAttribute("decodeTo", "CHARS");
    decoder.setConfiguration(config);
   
    char[] decodedRes = (char[]) decoder.decode("Hello W".getBytes());
    assertEquals("Hello W", new String(decodedRes));
  }
View Full Code Here


    }
  } 
 
  private static ConfigTree createConfigTree()
  {
    ConfigTree configTree = new ConfigTree( "junitFtpImplTest" );
    try
    {
      configTree.setAttribute( FileEpr.URL_TAG, ftpServer.getURL().toString() ) ;
    }
    catch ( MalformedURLException e )
    {
      log.error);
      fail ( e.getMessage() );
    }
    configTree.setAttribute( RemoteFileSystem.PARMS_FTP_SERVER, ftpServer .getHost() );
    configTree.setAttribute( RemoteFileSystem.PARMS_USER, ftpServer .getUserName() );
    configTree.setAttribute( RemoteFileSystem.PARMS_PASSWD, ftpServer .getPassword() );
    configTree.setAttribute( RemoteFileSystem.PARMS_REMOTE_DIR, remoteInputDirName );
    configTree.setAttribute( RemoteFileSystem.PARMS_PORT, Integer .toString( ftpServer.getPort() ) );
    configTree.setAttribute( RemoteFileSystem.PARMS_LOCAL_DIR, ftpServer .getRootDir() );
    configTree.setAttribute( RemoteFileSystem.PARMS_ASCII, Boolean .toString( false ) );
    configTree.setAttribute( RemoteFileSystem.PARMS_PASSIVE, Boolean .toString( false ) );
    configTree.setAttribute( RemoteFileSystem.PARMS_RENAME_RETRY, Integer .toString(10) );
    configTree.setAttribute( RemoteFileSystem.PARMS_TIMEOUT_DEFAULT, Integer .toString(0) );
    configTree.setAttribute( RemoteFileSystem.PARMS_TIMEOUT_DATA, Integer .toString(0) );
    configTree.setAttribute( RemoteFileSystem.PARMS_TIMEOUT_SO, Integer .toString(0) );
    configTree.setAttribute( RemoteFileSystem.PARMS_CONTROL_CHANNEL_ENCODING, "UTF-8" );

    return configTree;
  }
View Full Code Here

        return new SecurityContext(subject, 5000l);
    }

    private SecurityConfig getSecurityConfig()
    {
        ConfigTree securityFragment = SecurityConfigTestUtil.createSecurityFragment("adminRole", null, "SuccessfulLogin");
        return SecurityConfigUtil.createSecurityConfig(securityFragment);
    }
View Full Code Here

        initaliseServices();
    }

    private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException, IOException, SAXException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
        ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
        ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
        ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
        ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");

        splitter = new StaticRouter(splitterConfig);
        splitter.initialise();
        service1 = new StaticRouter(service1Config);
        service1.initialise();
View Full Code Here

        initaliseServices();
    }

    private void initaliseServices() throws ConfigurationException, RegistryException, ActionLifecycleException, IOException, SAXException {
        ESBConfigUtil esbConfig = new ESBConfigUtil(getClass().getResourceAsStream("action-configs-01.xml"));
        ConfigTree splitterConfig = esbConfig.getActionConfig("null-listener", "splitter1-action");
        ConfigTree service1Config = esbConfig.getActionConfig("null-listener", "service1-config");
        ConfigTree service2Config = esbConfig.getActionConfig("null-listener", "service2-config");
        ConfigTree aggregatorConfig = esbConfig.getActionConfig("null-listener", "aggregator-config");

        splitter = new StaticRouter(splitterConfig);
        splitter.initialise();
        service1 = new StaticRouter(service1Config);
        service1.initialise();
View Full Code Here

* @since Version 4.0
*/
public class SmooksTransformerUnitTest extends TestCase {

    public void test_bad_config() {
        ConfigTree properties = new ConfigTree("name");

        properties.setAttribute(SmooksTransformer.RESOURCE_CONFIG, "classpath:/smooks-conf-01.xml");
        // Should get exceptions where message type configs are specified but empty...
        properties.setAttribute(SmooksTransformer.FROM_TYPE, " ");
        assertConfigException(properties, "Empty '" + SmooksTransformer.FROM_TYPE + "' config attribute supplied.");
        properties.setAttribute(SmooksTransformer.FROM_TYPE, "x");
        properties.setAttribute(SmooksTransformer.TO_TYPE, " ");
        assertConfigException(properties, "Empty '" + SmooksTransformer.TO_TYPE + "' config attribute supplied.");
    }
View Full Code Here

      AssertArgument.isNotNull(config, "config");
     
    setBean(bean);
    List<KeyValuePair> pairs = config.attributesAsList();
   
    ConfigTree parent = config.getParent();
    if (parent != null)  {
        List<KeyValuePair> parentAttributes = parent.attributesAsList();
        for (KeyValuePair attr : parentAttributes)  {
            String newKeyName = optionalFields.get(attr.getKey());
            if (newKeyName != null) {
                pairs.add(new KeyValuePair(newKeyName, attr.getValue()));
            }
View Full Code Here

   *
   * @return String
   */
  protected String getFileName(Message message) throws NotificationException {
    if (fileName == null) {
      ConfigTree ftpConfig = getFtpConfig();
      fileName = ftpConfig.getAttribute(ATTR_FILENAME);
      if (StringUtils.isEmpty(fileName)) {
        throw new NotificationException("NotifyFTP: Filename attribute is required.");
      }
      fileName = PropertySubstituter.replaceArguments(fileName, message);
    }
View Full Code Here

   *
   * @return FTPEpr
   */
  protected FTPEpr getFtpEpr() throws NotificationException {
    if (epr == null) {
      ConfigTree ftpConfig = getFtpConfig();
      String url = ftpConfig.getAttribute(FTPEpr.URL_TAG);
      try {
          epr = (FTPEpr) ListenerUtil.fileEprFromElement(ftpConfig);
      }
      catch (final ConfigurationException ex)
      {
View Full Code Here

      if (inFile != null)
    msg.getProperties().setProperty(
      Environment.ORIGINAL_FILE_NAME_MSG_PROP,
      inFile.getName());

      ConfigTree config = (ConfigTree) params
        .get(Environment.GATEWAY_CONFIG);

      if (config != null)
      {
    try
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.helpers.ConfigTree

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.