Package speculoos.config.xml

Examples of speculoos.config.xml.XMLConfigurator


  private XMLConfigurator xc;

  protected void setUp() throws Exception {
    super.setUp();
    xc = new XMLConfigurator();
    manager = new MapperManager();
    xc.setValidating(true);
  }
View Full Code Here


    };
  }

  public void test01GlobalValid() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-valid1.xml"));
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), validationRules(1));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), validationRules(3));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

   * @throws IOException
   * @throws MapperConfigurationException
   */
  public void test02SourceValid() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-valid2.xml"));
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), validationRules(2));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), validationRules(4));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource1"), validationRules(0));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail2"), validationRules(2));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail2"),
        eq("ldifsource1"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

   * @throws MapperConfigurationException
   * @throws XMLConfiguratorException
   */
  public void test03MapperValid() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-valid3.xml"));
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), validationRules(0));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), validationRules(4));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource1"), validationRules(0));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail2"), validationRules(4));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail2"),
        eq("ldifsource1"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

   * @throws MapperConfigurationException
   * @throws XMLConfiguratorException
   */
  public void test04MapsValid() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    Map def = new HashMap();
    def.put("id","12");
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-valid4.xml"));
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), validationRules(0));
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), validationRules(3));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource1"), validationRules(0));
    mockconfigure.expects(once()).method("addMapper").with(eq("telAndMail2"),
        checkDefaults(def));
    mockconfigure.expects(once()).method("link").with(eq("telAndMail2"),
        eq("ldifsource1"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

   * @throws MapperConfigurationException
   * @throws XMLConfiguratorException
   */
  public void test01Base() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.setValidating(true);
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample.xml"));
    // expects
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), ANYTHING);
    mockconfigure.expects(once()).method("addSource").with(
        eq("pooledsource"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(eq("emps"),ANYTHING);
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(eq("emps"),
        eq("ldifsource"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());

  }
View Full Code Here

   * @throws MapperConfigurationException
   *
   */
  public void test02Reset() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample.xml"));
    // expects
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), ANYTHING);
    mockconfigure.expects(once()).method("addSource").with(
        eq("pooledsource"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("telAndMail"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(eq("emps"),
        ANYTHING);
    mockconfigure.expects(once()).method("link").with(eq("telAndMail"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(eq("emps"),
        eq("ldifsource"));
    // reset and reconfigure
    xc.resetConfig();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample.xml"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

  }

  public void test04ModifyOperations() throws MapperConfigurationException,
      XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample-modify.xml"));
    // expects
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("addEmpToBoss"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("delEmpFromBoss"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("changeBossOfEmp"), ANYTHING);
    mockconfigure.expects(once()).method("link").with(eq("addEmpToBoss"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(eq("delEmpFromBoss"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(
        eq("changeBossOfEmp"), eq("ldifsource"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

    xc.configure((Configure) mockconfigure.proxy());
  }

  public void test05RenameAndCompareOperations()
      throws MapperConfigurationException, XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample-rename-compare.xml"));
    // expects
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(eq("moveEmp"),
        ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(
        eq("compareEmp"), ANYTHING);
    mockconfigure.expects(once()).method("link").with(eq("moveEmp"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(eq("compareEmp"),
        eq("ldifsource"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

    xc.configure((Configure) mockconfigure.proxy());
  }

  public void test06AddAndDeleteOperations()
      throws MapperConfigurationException, XMLConfiguratorException {
    XMLConfigurator xc = new XMLConfigurator();
    xc.parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("jndi-sample-add-delete.xml"));
    // expects
    mockconfigure.expects(once()).method("addParameter").with(
        eq("ldifsource"), eq("canam.ldif"));
    mockconfigure.expects(once()).method("addSource").with(
        eq("ldifsource"), ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(eq("addEmp"),
        ANYTHING);
    mockconfigure.expects(once()).method("addMapper").with(eq("delEmp"),
        ANYTHING);
    mockconfigure.expects(once()).method("link").with(eq("addEmp"),
        eq("ldifsource"));
    mockconfigure.expects(once()).method("link").with(eq("delEmp"),
        eq("ldifsource"));
    // configure
    xc.configure((Configure) mockconfigure.proxy());
  }
View Full Code Here

TOP

Related Classes of speculoos.config.xml.XMLConfigurator

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.