Examples of TestConfiguration


Examples of com.sun.grid.TestConfiguration

    public AuthUserWrapperTest(String testName) {
        super(testName);
    }

    protected void setUp() throws Exception {
        TestConfiguration config = TestConfiguration.getInstance();
        File utilbin = new File(config.getSgeRoot(), "utilbin");
        File utilbinArch = new File(utilbin, SGEUtil.getArch(config.getSgeRoot()));
        if(SGEUtil.isWindows()) {
            authuser = new File(utilbinArch, "authuser.exe");
        } else {
            authuser = new File(utilbinArch, "authuser");
        }
View Full Code Here

Examples of com.sun.grid.TestConfiguration

    protected void tearDown() throws Exception {
    }
   
    public void testSystem() throws Exception {
       
        TestConfiguration config = TestConfiguration.getInstance();
        AuthUserWrapper wrapper = AuthUserWrapper.newInstance(authuser.getAbsolutePath());
       
        Set principals = wrapper.authenticate(config.getTestUser(), config.getTestUserPassword());

        assertNotNull("no principals found", principals);
       
        Iterator iter = principals.iterator();
        while(iter.hasNext()) {
            LOGGER.log(Level.FINE,"user {0} has principal {1}", new Object [] { config.getTestUser(), iter.next() });
        }
       
        try {
            principals =  wrapper.authenticate(config.getTestUser(), new char[0]);
            assertNull("login which empty password successeded", principals);
        } catch(Exception e) {
            // ignore
        }
    }
View Full Code Here

Examples of com.sun.grid.TestConfiguration

    }
   
    public void testPam() throws Exception {
       
        if(!SGEUtil.isWindows()) {
            TestConfiguration config = TestConfiguration.getInstance();

            AuthUserWrapper wrapper = AuthUserWrapper.newInstanceForPam(authuser.getAbsolutePath(), config.getPamService());

            Set principals = wrapper.authenticate(config.getTestUser(), config.getTestUserPassword());

            assertNotNull("no principals found", principals);

            Iterator iter = principals.iterator();
            while(iter.hasNext()) {
                LOGGER.log(Level.FINE,"user {0} has principal {1}", new Object [] { config.getTestUser(), iter.next() });
            }

            principals =  wrapper.authenticate(config.getTestUser(), new char[0]);
            assertNull("login which empty password successeded", principals);
        }
    }
View Full Code Here

Examples of de.metalcon.socialgraph.TestConfiguration

      transaction.finish();
    }
  }

  public static void setUp() {
    final TestConfiguration config = new TestConfiguration();

    // delete existing test database
    final File databaseDir = new File(config.getDatabasePath());
    NeoUtils.deleteFile(databaseDir);

    // load the database from the test location
    DATABASE = NeoUtils.getSocialGraphDatabase(config);
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

        }
       
        assertFalse("getURL is supported!", JDBC.vmSupportsJSR169());
        assertTrue("getURL is supported!", JDBC.vmSupportsJDBC3());

        TestConfiguration config = getTestConfiguration();
        String expectedURL = config.getJDBCUrl();

        // DERBY-4886: Embedded returns the URL without connection attributes,
        // client returns the URL with connection attributes.
        if (usingDerbyNetClient()) {
            String[] urlComponents = url.split(";");

            // Only compare whatever comes before the first semi-colon with
            // the expected URL. Check connection attributes separately.
            url = urlComponents[0];

            // Put each actual connection attribute in a HashSet for easy
            // comparison.
            HashSet attrs = new HashSet();
            for (int i = 1; i < urlComponents.length; i++) {
                attrs.add(urlComponents[i]);
            }

            // Put each expected connection attribute in a HashSet.
            HashSet expectedAttrs = new HashSet();
            Properties ca = config.getConnectionAttributes();
            Enumeration e = ca.propertyNames();
            while (e.hasMoreElements()) {
                String key = (String) e.nextElement();
                expectedAttrs.add(key + '=' + ca.getProperty(key));
            }
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

    private boolean setSecurityMechanism(String derby_security_mechanism)
    throws Exception {
        try {
            // getting a networkservercontrol to shutdown the currently running
            // server, before setting the next security mechanism
            final TestConfiguration config = TestConfiguration.getCurrent();
            NetworkServerControl server = new NetworkServerControl(
                InetAddress.getByName(config.getHostName()),
                config.getPort(),
                config.getUserName(),
                config.getUserPassword());

            // shut down the server
            server.shutdown();
        } catch (Exception e) {
            if (!(e.getMessage().substring(0,17).equals("DRDA_InvalidValue")))
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

        cs.close();
    }

    private void verifyNewLocations(int noOfObjects)
            throws SQLException {
        TestConfiguration tc = TestConfiguration.getCurrent();
        String dbPath = tc.getPhysicalDatabaseName(tc.getDefaultDatabaseName());
        String jarDirName =
            "system" + File.separator + dbPath + File.separator + "jar";
        File jarDir = new File(jarDirName);

        assertTrue(jarDir.isDirectory());
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

    }

    private void    connectToServer()
        throws Exception
    {
        final TestConfiguration config = getTestConfiguration();
        String  url
            = ( "jdbc:derby://localhost:" + config.getPort()
                + "/" + "wombat;create=true"
                + ";user=" + config.getUserName()
                + ";password=" + config.getUserPassword() );

        println( "XXX in connectToServer(). url = " + url );

        // just try to get a connection
        Class.forName( "org.apache.derby.jdbc.ClientDriver" );
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

        }
       
        assertFalse("getURL is supported!", JDBC.vmSupportsJSR169());
        assertTrue("getURL is supported!", JDBC.vmSupportsJDBC3());

        TestConfiguration config = getTestConfiguration();
        String expectedURL = config.getJDBCUrl();

        // DERBY-4886: Embedded returns the URL without connection attributes,
        // client returns the URL with connection attributes.
        if (usingDerbyNetClient()) {
            String[] urlComponents = url.split(";");

            // Only compare whatever comes before the first semi-colon with
            // the expected URL. Check connection attributes separately.
            url = urlComponents[0];

            // Put each actual connection attribute in a HashSet for easy
            // comparison.
            HashSet attrs = new HashSet();
            for (int i = 1; i < urlComponents.length; i++) {
                attrs.add(urlComponents[i]);
            }

            // Put each expected connection attribute in a HashSet.
            HashSet expectedAttrs = new HashSet();
            Properties ca = config.getConnectionAttributes();
            Enumeration e = ca.propertyNames();
            while (e.hasMoreElements()) {
                String key = (String) e.nextElement();
                expectedAttrs.add(key + '=' + ca.getProperty(key));
            }
View Full Code Here

Examples of org.apache.derbyTesting.junit.TestConfiguration

     * @throws UnknownHostException if the server host cannot be resolved
     */
    private Socket createSocket()
            throws IOException, UnknownHostException {
        Socket socket = null;
        final TestConfiguration cfg = getTestConfiguration();
        try {
            socket = AccessController.doPrivileged (
                new java.security.PrivilegedExceptionAction<Socket>() {
                    public Socket run()
                            throws IOException, UnknownHostException {
                        return new Socket(cfg.getHostName(), cfg.getPort());
                    }
                }
            );
        } catch (PrivilegedActionException pae) {
            if (pae.getCause() instanceof IOException) {
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.