Example #1
0
  // @Test  TODO. commented out. Can't get test to work without an application server.
  public void testCreateSql2oFromJndi() throws Exception {
    System.setProperty(
        Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");
    System.setProperty(Context.URL_PKG_PREFIXES, "org.apache.naming");

    InitialContext ic = new InitialContext();

    ic.createSubcontext("java:");
    ic.createSubcontext("java:comp");
    ic.createSubcontext("java:comp/env");

    JDBCDataSource datasource = new JDBCDataSource();
    datasource.setUrl(url);
    datasource.setUser(user);
    datasource.setPassword(pass);

    ic.bind("java:comp/env/Sql2o", datasource);

    System.out.println("Datasource initialized.");

    Sql2o jndiSql2o = new Sql2o("Sql2o");

    assertTrue(jndiSql2o != null);
  }
Example #2
0
File: LFT.java Project: qarocks/SPW
  @Before
  public void setUp() throws Exception {

    // System.setProperty("webdriver.chrome.driver","C:\\Users\\Sneha\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe");
    System.setProperty("webdriver.firefox.bin", "C:\\Mozilla Firefox\\firefox.exe");

    /*File profileDir = new File("C:\\Users\\Sneha\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\hl4nsrj3.no silveright");
        FirefoxProfile profile = new FirefoxProfile(profileDir);
        profile.setPreference("general.useragent.override", "same user agent string as above");


    driver = new FirefoxDriver(profile);
    */
    driver = new FirefoxDriver();
    // driver=new ChromeDriver();

    // WebDriver driver = new InternetExplorerDriver();

    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    selenium = new WebDriverBackedSelenium(driver, baseUrl);

    webDriver = new HtmlUnitDriver(true);
  }
Example #3
0
 public JWTStoreTest() {
   System.setProperty("jwt.hmacSharedSecret", "qrllxoyy2x2bnsp84yjoi5wujrnqun6y0lspeu28");
   this.store = JWTStore.getInstance();
 }