Examples of Expect


Examples of com.insightfullogic.lambdabehave.expectations.Expect

        }
    }

    private SpecificationReport checkBehaviour() {
        try {
            Expect expect = new Expect();
            specification.specifyBehaviour(expect);
            return success(description);
        } catch (final AssertionError cause) {
            return failure(description, cause);
        } catch (final Throwable cause) {
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

        config.validate();
        this.config = config;
    }
 
    protected Expect createProcess() {
        Expect ret = new Expect();
        ret.command().add(config.getSgeCaScript().getAbsolutePath());
        ret.command().add("-catop");
        ret.command().add(config.getCaTop().getAbsolutePath());
        ret.command().add("-calocaltop");
        ret.command().add(config.getCaLocalTop().getAbsolutePath());
        ret.command().add("-cahost");
        ret.command().add(config.getCaHost());
        ret.command().add("-adminuser");
        ret.command().add(config.getAdminUser());
        ret.command().add("-nosge");
        ret.command().add("-days");
        ret.command().add(Integer.toString(config.getDaysValid()));
        return ret;
    }
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

            } catch(IOException ioe) {
                throw RB.newGridCAException(ioe, "gridCAImpl.error.autoFile",
                                            ioe.getLocalizedMessage());
            }
           
            Expect pb = createProcess();
            pb.command().add("-auto");
            pb.command().add(autoFile.getAbsolutePath());
            pb.command().add("-init");
           
            execute(pb, false);
           
            LOGGER.log(Level.FINE, "gridCAImpl.initSuccess");
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

     @param email     email address of the user
     *  @throws GridCAException if the creation of the private key or the certificate fails
     */
    public void createUser(String username, String email) throws GridCAException {
        LOGGER.entering("GridCAImpl", "createUser");
        Expect pb = createProcess();
        pb.command().add("-user");
        pb.command().add(username + ":" + username + ":" + email);

        execute(pb);
        LOGGER.exiting("GridCAImpl", "createUser");
    }
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

     * @param email  email address of the process owner
     * @throws com.sun.grid.ca.GridCAException if the create of the daemon failed
     */
    public void createDaemon(String daemon, String user, String email) throws GridCAException {
        LOGGER.entering("GridCAImpl", "createDaemon");
        Expect pb = createProcess();
        pb.command().add("-sdm_daemon");
        pb.command().add(user + ":" + daemon + ":" + email);

        execute(pb);
       
        LOGGER.exiting("GridCAImpl", "createDaemon");
    }
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

     @throws GridCAException if the certificate can not be renewed
     */
    public X509Certificate renewCertificate(String username, int days) throws GridCAException {
        LOGGER.entering("GridCAImpl", "renewCertificate");
       
        Expect pb = createProcess();
        pb.command().add("-renew");
        pb.command().add(username);
        pb.command().add("-days");
        pb.command().add(Integer.toString(days));

        execute(pb);
       
        X509Certificate ret = getCertificate(username);
        LOGGER.exiting("GridCAImpl", "renewCertificate");
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

     @return the renewed certificate
     *  @throws GridCAException if the certificate can not be renewed
     */
    public X509Certificate renewDaemonCertificate(String daemon, int days) throws GridCAException {
        LOGGER.entering("GridCAImpl", "renewDaemonCertificate");
        Expect pb = createProcess();
        pb.command().add("-renew_sdm");
        pb.command().add(daemon);
        pb.command().add("-days");
        pb.command().add(Integer.toString(days));

        execute(pb);

        X509Certificate ret = getDaemonCertificate(daemon);
        LOGGER.exiting("GridCAImpl", "renewDaemonCertificate");
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

        return ret;
    }
   
    public void renewCaCertificate(int days) throws GridCAException {
        LOGGER.entering("GridCAImpl", "renewCaCertificate");
        Expect pb = createProcess();
        pb.command().add("-renew_ca");
        pb.command().add("-days");
        pb.command().add(Integer.toString(days));

        execute(pb);

        LOGGER.exiting("GridCAImpl", "renewCaCertificate");
    }
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

                    pw.close();
                } catch(IOException ex) {
                    throw RB.newGridCAException(ex, "gridCAImpl.error.io",ex.getLocalizedMessage());
                }

                Expect pb = createProcess();

                if(type.equals("user")) {
                    pb.command().add("-pkcs12");
                } else if (type.equals("sdm_daemon")) {
                    pb.command().add("-sdm_pkcs12");
                } else if (type.equals("sge_daemon")) {
                    pb.command().add("-sys_pkcs12");
                }
                pb.command().add(username);
                pb.command().add("-pkcs12pwf");
                pb.command().add(passwordFile.getAbsolutePath());
                pb.command().add("-pkcs12dir");
                pb.command().add(config.getTmpDir().getAbsolutePath());
               
                execute(pb);

            } finally {
                if(userFile != null) {
View Full Code Here

Examples of com.sun.grid.util.expect.Expect

        String ret = (String)archMap.get(sgeRoot);
        if(ret == null) {
            if(isWindows()) {
                ret = "win32-x86";
            } else {
                Expect expect = new Expect();

                expect.env().add("SGE_ROOT=" + sgeRoot.getAbsolutePath());
                expect.command().add( sgeRoot.getAbsolutePath() + File.separatorChar + "util" + File.separatorChar + "arch");

                ArchExpectHandler archHandler = new ArchExpectHandler();
                expect.add(archHandler);
                try {
                    int res = expect.exec(10000);
                    if(res != 0) {
                       throw new IOException("arch script exited with status (" + ret +")");
                    }

                    ret = archHandler.getArch();
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.