Package net.sf.swtbot.wait

Examples of net.sf.swtbot.wait.DefaultCondition


        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "ou=users",
            "cn=Wolfgang K\u00f6lbel" );

        // export LDIF
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "LDIF Export..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "LDIF Export" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'LDIF Export'";
            }
        } );
        bot.button( "Next >" ).click();
        bot.comboBoxWithLabel( "LDIF File:" ).setText( file );
        bot.button( "Finish" ).click();

        // verify that exported LDIF starts with the Base64 encoded DN
        String content = FileUtils.readFileToString( new File( file ) );
        assertTrue( "LDIF must start with Base64 encoded DN.", content
            .startsWith( "dn:: Y249V29sZmdhbmcgS8O2bGJlbCxvdT11c2VycyxvdT1zeXN0ZW0=" ) );

        // delete entry
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "Delete Entry" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "Delete Entry" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'New Entry'";
            }
        } );
        SWTBotUtils.asyncClick( bot, bot.button( "OK" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "ou=users" );
            }


            public String getFailureMessage()
            {
                return "Could not select 'ou=system'";
            }
        } );

        // import LDIF
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "LDIF Import..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "LDIF Import" ) != null;
            }
View Full Code Here


        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "ou=users",
            "cn=Wolfgang K\u00f6lbel" );
        bot.sleep( 2000 );

        // export DSML
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "DSML Export..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "DSML Export" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'DSML Export'";
            }
        } );
        bot.button( "Next >" ).click();
        bot.comboBoxWithLabel( "DSML File:" ).setText( file );
        bot.radio( "DSML Request" ).click();
        bot.button( "Finish" ).click();

        // verify that exported DSML contains the Base64 encoded DN
        String content = FileUtils.readFileToString( new File( file ) );
        assertTrue( "DSML must contain DN with umlaut.", content
            .contains( "dn=\"cn=Wolfgang Kölbel,ou=users,ou=system\"" ) );

        // delete entry
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "Delete Entry" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "Delete Entry" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'New Entry'";
            }
        } );
        SWTBotUtils.asyncClick( bot, bot.button( "OK" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "ou=users" );
            }


            public String getFailureMessage()
            {
                return "Could not select 'ou=system'";
            }
        } );

        // import DSML
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "DSML Import..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "DSML Import" ) != null;
            }
View Full Code Here

TOP

Related Classes of net.sf.swtbot.wait.DefaultCondition

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.