Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.PropertyChain


   * </ol>
   * Check the /ju-remote.properties file for the possible property keys.
   * @return Remote service locator
   */
  public static JndiServiceLocator createRemoteByConfigurationFiles() {
    PropertyChain pc = JuUtils.getJuPropertyChain();
   
    Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
    Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
   
    return buildRemote()
      .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset)
      .appName(pc.get("ju-util-ee.remote.appName", true))
      .moduleName(pc.get("ju-util-ee.remote.moduleName", true))
      .createServiceLocator();
  }
View Full Code Here


   * using the default JU Property chain.
   *
   * @return Remote service locator
   */
  public static JndiServiceLocator createRemoteByConfigurationFiles() {
    PropertyChain pc = JuUtils.getJuPropertyChain();
   
    Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
    Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
   
    return buildRemote()
      .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset)
      .appName(pc.get("ju-util-ee.remote.appName", true))
      .moduleName(pc.get("ju-util-ee.remote.moduleName", true))
      .createServiceLocator();
  }
View Full Code Here

     * using the default JU Property chain.
     *
     * @return Builder to adapt configuration
     */
    public RemoteServiceLocatorBuilder initByConfigurationFiles() {
      PropertyChain pc = JuUtils.getJuPropertyChain();

      Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
      Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);

      this.remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset);
      this.appName(pc.get("ju-util-ee.remote.appName", true));
      this.moduleName(pc.get("ju-util-ee.remote.moduleName", true));

      return this;
    }
View Full Code Here

   * </ol>
   * Check the /ju-remote.properties file for the possible property keys.
   * @return Remote service locator
   */
  public static JndiServiceLocator createRemoteByConfigurationFiles() {
    PropertyChain pc = JuUtils.getJuPropertyChain();
   
    Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true);
    Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true);
   
    return buildRemote()
      .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset)
      .appName(pc.get("ju-util-ee.remote.appName", true))
      .moduleName(pc.get("ju-util-ee.remote.moduleName", true))
      .createServiceLocator();
  }
View Full Code Here

            }
          }
        }
      }
     
      PropertyChain chain = chainBuilder.getPropertyChain();
      Set<String> keys = chain.listKeys();
     
      for (String key : keys) {
        if (this.isIncluded(key, this.chain.filter, true)) {
          PropertyInfo pi = chain.getInfo(key);
         
          this.project.getProperties().put(key, pi.getValue());
         
          boolean exportToSystemProperties = this.isIncluded(key, this.chain.exportToSystemProperty, false)
              || exportedProperty.contains(key);
View Full Code Here

     * </ul>
     * @param profileName
     * @return
     */
    public JuConnUtilBuilder profile(String profileName) {
      PropertyChain pc = JuUtils.getJuPropertyChain();
     
      return this.url(pc.get(String.format("ju-dbutil-test.%s.connectionUrl", profileName)))
        .user(pc.get(String.format("ju-dbutil-test.%s.user", profileName)))
        .password(pc.get(String.format("ju-dbutil-test.%s.password", profileName)));
    }
View Full Code Here

   * JU properties, e.g. <code>http://localhost:8080/web-app/page.jsf</code>
   * @param driver WebDriver to get page for
   * @param pageUrl Page URL
   */
  public static void getPage(WebDriver driver, String pageUrl) {
    PropertyChain pc = JuUtils.getJuPropertyChain();
   
    String host = pc.get("ju-testing-ee.web.host");
    Integer port = pc.get("ju-testing-ee.web.port", Integer.class) + pc.get("ju-util-ee.portOffset", Integer.class);
   
    String url = String.format("http://%s:%d/%s", host, port, pageUrl);
    logger.debug("Getting " + url);
   
    driver.get(url)
View Full Code Here

    List<AnnotationInfo<JuTestEnv>> testEnvAnnos = ReflectUtils.getAnnotationsWithInfo(method, JuTestEnv.class, false, true, true);
    Collections.reverse(testEnvAnnos);
    final SystemPropertyTempSetter tempSetter = DbTestAnnotationHandler.setTestEnvProperties(testEnvAnnos);
   
    try {
      PropertyChain pc = JuUtils.getJuPropertyChain();
     
      if (this.drivers.isEmpty()) {
        // Get from the properties which drivers we should use to run the tests
        String drivers[] = JuStringUtils.split(pc.get(PROP_DRIVER, true), ",", true);
        Assert.assertTrue(String.format("No drivers specified in property %s", DriverRule.PROP_DRIVER), drivers.length > 0);
       
        logger.debug("Initialize WebDrivers: " + Arrays.toString(drivers));
        for (String driverType : drivers) {
          WebDriver driver = null;
         
          logger.debug("Creating driver: " + driverType);
          if ("HtmlUnit".equals(driverType)) {
            boolean enableJavaScript = pc.get("ju-testing-ee.selenium.htmlUnit.enableJavascript", Boolean.class);
            driver = new HtmlUnitDriver(enableJavaScript);
          } else if ("Chrome".equals(driverType)) {
            System.setProperty("webdriver.chrome.driver", DriverRule.getChromeDriverExePath().toAbsolutePath().toString());
                driver = new ChromeDriver();
          } else {
View Full Code Here

    this.testClass = testClass;
  }
 
  @Override
  public Statement apply(final Statement base, Description description) {
    PropertyChain pc = JuUtils.getJuPropertyChain();
   
    if (this.drivers.isEmpty()) {
      // Get from the properties which drivers we should use to run the tests
      String drivers[] = JuStringUtils.split(pc.get(PROP_DRIVER, true), ",", true);
      Assert.assertTrue(String.format("No drivers specified in property %s", DriverRule.PROP_DRIVER), drivers.length > 0);
     
      logger.debug("Initialize WebDrivers: " + Arrays.toString(drivers));
      for (String driverType : drivers) {
        WebDriver driver = null;
       
        logger.debug("Creating driver: " + driverType);
        if ("HtmlUnit".equals(driverType)) {
          boolean enableJavaScript = pc.get("ju-testing-ee.selenium.htmlUnit.enableJavascript", Boolean.class);
          driver = new HtmlUnitDriver(enableJavaScript);
        } else if ("Chrome".equals(driverType)) {
          System.setProperty("webdriver.chrome.driver", DriverRule.getChromeDriverExePath().toAbsolutePath().toString());
              driver = new ChromeDriver();
        } else {
View Full Code Here

     * </ul>
     * @param profileName
     * @return
     */
    public JuConnUtilBuilder profile(String profileName) {
      PropertyChain pc = JuUtils.getJuPropertyChain();
     
      return this.url(pc.get(String.format("ju-dbutil-test.%s.connectionUrl", profileName)))
        .user(pc.get(String.format("ju-dbutil-test.%s.user", profileName)))
        .password(pc.get(String.format("ju-dbutil-test.%s.password", profileName)));
    }
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.PropertyChain

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.