Package com.sun.grid

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


    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

    }
   
    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

TOP

Related Classes of com.sun.grid.TestConfiguration

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.