You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2022/04/11 04:33:01 UTC
[directory-fortress-commander] branch wicket9 updated: + test3 use case
This is an automated email from the ASF dual-hosted git repository.
smckinney pushed a commit to branch wicket9
in repository https://gitbox.apache.org/repos/asf/directory-fortress-commander.git
The following commit(s) were added to refs/heads/wicket9 by this push:
new eaa4509 + test3 use case
eaa4509 is described below
commit eaa45095e80896cf8b184d3b7ab850ad995bfc5f
Author: Shawn McKinney <sm...@symas.com>
AuthorDate: Sun Apr 10 23:32:54 2022 -0500
+ test3 use case
---
.../web/integration/FortressWebSeleniumITCase.java | 41 ++++++++++++++--------
.../directory/fortress/web/integration/TUtils.java | 32 +++--------------
2 files changed, 30 insertions(+), 43 deletions(-)
diff --git a/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java b/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
index abbe40d..8bd5153 100644
--- a/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
+++ b/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
@@ -165,7 +165,6 @@ public class FortressWebSeleniumITCase
ouusers();
ouperms();
}
-
if ( !skipSecondHalf )
{
admrles();
@@ -173,16 +172,11 @@ public class FortressWebSeleniumITCase
admperms();
groups();
}
-
- // test can't do these:
+ // can't do these:
doNegativeLinkTest( PLCYS, "PwPolicyPage", userId );
doNegativeLinkTest( BINDS, "AuditBindPage", userId );
doNegativeLinkTest( AUTHZ, "AuditAuthzPage", userId );
doNegativeLinkTest( MODS, "AuditModPage", userId );
-
- /*****
- * LOGOUT
- */
driver.findElement( By.linkText( "LOGOUT" ) ).click();
LOG.info( "End FortressWebSeleniumITCase" );
}
@@ -211,9 +205,10 @@ public class FortressWebSeleniumITCase
doNegativeLinkTest( BINDS, "AuditBindPage", userId );
doNegativeLinkTest( AUTHZ, "AuditAuthzPage", userId );
doNegativeLinkTest( MODS, "AuditModPage", userId );
-
- // test can do:
+ // test 1 can do:
doPositiveLinkTest( USERS, userId);
+ driver.findElement( By.linkText( "LOGOUT" ) ).click();
+ LOG.info( "End FortressWebSeleniumITCase 1" );
}
@Test
@@ -232,7 +227,6 @@ public class FortressWebSeleniumITCase
// mods requires that: is.arbac02=true
mods();
}
-
// can do all of these:
doPositiveLinkTest( USERS, userId);
doPositiveLinkTest( ROLES, userId);
@@ -245,9 +239,20 @@ public class FortressWebSeleniumITCase
doPositiveLinkTest( OUPRMS, userId);
doPositiveLinkTest( ADMRLES, userId);
doPositiveLinkTest( ADMOBJS, userId);
+ driver.findElement( By.linkText( "LOGOUT" ) ).click();
+ LOG.info( "End FortressWebSeleniumITCase 2" );
+ }
- // test3 can't do these:
-/*
+ @Test
+ public void testUser3() throws Exception
+ {
+ String userId = "test3";
+ LOG.info( "Begin FortressWebSeleniumITCase 3, userId:" + userId );
+ driver.get( baseUrl + FORTRESS_WEB );
+ login( userId, "password" );
+ TUtils.sleep( 1 );
+ // test3 can't do:
+ doNegativeLinkTest( USERS, "UserPage", userId );
doNegativeLinkTest( ROLES, "RolePage", userId );
doNegativeLinkTest( POBJS, "ObjectPage", userId );
doNegativeLinkTest( PERMS, "PermPage", userId );
@@ -257,7 +262,13 @@ public class FortressWebSeleniumITCase
doNegativeLinkTest( OUPRMS, "OuPermPage", userId );
doNegativeLinkTest( ADMRLES, "RoleAdminPage", userId );
doNegativeLinkTest( ADMOBJS, "ObjectAdminPage", userId );
-*/
+ doNegativeLinkTest( BINDS, "AuditBindPage", userId );
+ doNegativeLinkTest( AUTHZ, "AuditAuthzPage", userId );
+ doNegativeLinkTest( MODS, "AuditModPage", userId );
+ // test 3 can do:
+ doPositiveLinkTest( GROUPS, userId);
+ driver.findElement( By.linkText( "LOGOUT" ) ).click();
+ LOG.info( "End FortressWebSeleniumITCase 3" );
}
private void login( String userId, String password )
@@ -932,12 +943,12 @@ public class FortressWebSeleniumITCase
if(is403())
{
// pass
- TUtils.sleep( 1 );
+ TUtils.sleepMillies( 500 );
driver.navigate().back();
}
else
{
- String msg = "Spring Security Test Failed URL: " + unauthorizedUrl + "." + GlobalIds.ADD;
+ String msg = "Spring Security Test Failed URL: " + unauthorizedUrl;
LOG.info( msg );
fail( msg );
}
diff --git a/src/test/java/org/apache/directory/fortress/web/integration/TUtils.java b/src/test/java/org/apache/directory/fortress/web/integration/TUtils.java
index 9de8c8e..9d65a15 100644
--- a/src/test/java/org/apache/directory/fortress/web/integration/TUtils.java
+++ b/src/test/java/org/apache/directory/fortress/web/integration/TUtils.java
@@ -74,24 +74,6 @@ public class TUtils extends TestCase
}
- /**
- *
- * @param len
- */
- public static void sleep( String len )
- {
- try
- {
- Integer iSleep = ( Integer.parseInt( len ) * 1000 );
- Thread.currentThread().sleep( iSleep );
- }
- catch ( InterruptedException ie )
- {
- LOG.warn( TUtils.class.getName() + ".sleep caught InterruptedException=" + ie.getMessage(), ie );
- }
- }
-
-
/**
*
* @param len
@@ -109,21 +91,15 @@ public class TUtils extends TestCase
}
}
-
- /**
- *
- * @param len
- */
- public static void sleep( long len )
+ public static void sleepMillies( int len )
{
try
{
- long iSleep = len * 1000;
- Thread.currentThread().sleep( iSleep );
+ Thread.currentThread().sleep( len );
}
catch ( InterruptedException ie )
{
- LOG.warn( TUtils.class.getName() + ".sleep caught InterruptedException=" + ie.getMessage(), ie );
+ LOG.warn( TUtils.class.getName() + ".sleepmillies caught InterruptedException=" + ie.getMessage(), ie );
}
}
-}
\ No newline at end of file
+}