gluu
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 限定公開メンバ関数 | 全メンバ一覧
org.gluu.oxtrust.service.test.PostLogoutRedirectUriTest クラス
org.gluu.oxtrust.service.test.PostLogoutRedirectUriTest の継承関係図
Inheritance graph
org.gluu.oxtrust.service.test.PostLogoutRedirectUriTest 連携図
Collaboration graph

公開メンバ関数

void testAddPostLogoutRedirectUri () throws Exception
 
void initTestSuite (ITestContext context) throws FileNotFoundException, IOException
 

静的公開メンバ関数

static Archive<?> createDeployment ()
 

静的公開変数類

static FileConfiguration testData
 

限定公開メンバ関数

void loginAndCheckLoggedIn (String userPropsKey)
 
void checkLoggedIn (final boolean loggedIn)
 
void checkLoginUser (final String user, final String password)
 
void logoutUser () throws Exception
 

詳解

関数詳解

◆ checkLoggedIn()

void org.gluu.oxtrust.action.test.AbstractAuthenticationTest.checkLoggedIn ( final boolean  loggedIn)
inlineprotectedinherited

Check if user logged in

引数
loggedInCurrent user logged in state
49  {
50  assertEquals(identity.isLoggedIn(), loggedIn);
51  }
Identity identity
Definition: AbstractAuthenticationTest.java:26

◆ checkLoginUser()

void org.gluu.oxtrust.action.test.AbstractAuthenticationTest.checkLoginUser ( final String  user,
final String  password 
)
inlineprotectedinherited

Login using specified user credentials

引数
userUser login name
passwordUser login password
59  {
62 
63  assertTrue(identity.isLoggedIn());
64  }
OauthData getOauthData()
Definition: Identity.java:31
boolean authenticate()
Definition: Authenticator.java:124
void setUserUid(String userUid)
Definition: OauthData.java:42
Authenticator authenticator
Definition: AbstractAuthenticationTest.java:29
Identity identity
Definition: AbstractAuthenticationTest.java:26

◆ createDeployment()

static Archive<?> org.gluu.oxtrust.action.test.ConfigurableTest.createDeployment ( )
inlinestaticinherited
41  {
42  return Deployments.createDeployment();
43  }

◆ initTestSuite()

void org.gluu.oxtrust.action.test.ConfigurableTest.initTestSuite ( ITestContext  context) throws FileNotFoundException, IOException
inlineinherited
46  {
47  Reporter.log("Invoked init test suite method", true);
48 
49  String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile");
50  if (StringHelper.isEmpty(propertiesFile)) {
51  propertiesFile = "target/test-classes/testng.properties";
52  }
53 
54  // Load test parameters
55  FileInputStream conf = new FileInputStream(propertiesFile);
56  Properties prop;
57  try {
58  prop = new Properties();
59  prop.load(conf);
60  } finally {
61  IOUtils.closeQuietly(conf);
62  }
63 
64  Map<String, String> parameters = new HashMap<String, String>();
65  for (Entry<Object, Object> entry : prop.entrySet()) {
66  Object key = entry.getKey();
67  Object value = entry.getValue();
68 
69  if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) {
70  continue;
71  }
72  parameters.put(key.toString(), value.toString());
73  }
74 
75  // Override test parameters
76  context.getSuite().getXmlSuite().setParameters(parameters);
77  }

◆ loginAndCheckLoggedIn()

void org.gluu.oxtrust.action.test.AbstractAuthenticationTest.loginAndCheckLoggedIn ( String  userPropsKey)
inlineprotectedinherited

Make attempt to login using specified userPropsKey. For this method we must define in properties file 2 key/value pairs: userPropsKey.uid and userPropsKey.password.

引数
userPropsKeyPrefix of the key in properties file
38  {
39  checkLoggedIn(false);
40  checkLoginUser(testData.getString(userPropsKey + ".uid"), testData.getString(userPropsKey + ".password"));
41  checkLoggedIn(true);
42  }
void checkLoggedIn(final boolean loggedIn)
Definition: AbstractAuthenticationTest.java:49
static FileConfiguration testData
Definition: ConfigurableTest.java:38
void checkLoginUser(final String user, final String password)
Definition: AbstractAuthenticationTest.java:59

◆ logoutUser()

void org.gluu.oxtrust.action.test.AbstractAuthenticationTest.logoutUser ( ) throws Exception
inlineprotectedinherited

Process user logout

69  {
71 
72  assertFalse(identity.isLoggedIn());
73  }
String postLogout()
Definition: Authenticator.java:205
Authenticator authenticator
Definition: AbstractAuthenticationTest.java:29
Identity identity
Definition: AbstractAuthenticationTest.java:26

◆ testAddPostLogoutRedirectUri()

void org.gluu.oxtrust.service.test.PostLogoutRedirectUriTest.testAddPostLogoutRedirectUri ( ) throws Exception
inline
20  {
21 // loginAndCheckLoggedInFacesRequest("test.login.user.admin");
22 
23  final Map<String, Object> data = new HashMap<String, Object>(6);
24 // TrustService trustService = (TrustService) getInstance("trustService");
25 // List<GluuSAMLTrustRelationship> trs = trustService.getAllTrustRelationships();
26 // int trСount = trs.size();
27 // assert (trСount > 1) : "Not enough Trust Relationships were found at test server(at least 2 required). Cannot continue the test";
28 //
29 // GluuSAMLTrustRelationship tr1 = trs.get(random(trСount-1));
30 // GluuSAMLTrustRelationship tr2 = trs.get(random(trСount-1));
31 // while(tr2.equals(tr1)){
32 // tr2 = trs.get(random(trСount-1));
33 // }
34 //
35 // ClientService clientService = (ClientService) getInstance("clientService");
36 // configurationFactory configurationFactory = (configurationFactory) getInstance("configurationFactory");
37 // appConfiguration appConfiguration = configurationFactory.getappConfiguration();
38 // OxAuthClient client = clientService.getClientByInum(appConfiguration.getOxAuthClientId());
39 // String randomUrl1 = random(1)>0?"http":"https" + "://"+ StringHelper.getRandomString(random(10)+1) + "." + StringHelper.getRandomString(random(3)+1);
40 // String randomUrl2 = random(1)>0?"http":"https" + "://"+ StringHelper.getRandomString(random(10)+1) + "." + StringHelper.getRandomString(random(3)+1);
41 // data.put("tr1Inum", tr1.getInum());
42 // data.put("tr2Inum", tr2.getInum());
43 // data.put("clientInum", client.getInum());
44 // data.put("tr1Logout", tr1.getSpLogoutURL());
45 // data.put("tr2Logout", tr2.getSpLogoutURL());
46 // data.put("randomUrl1", randomUrl1);
47 // data.put("randomUrl2", randomUrl2);
48 // data.put("clientLogout", client.getPostLogoutRedirectUris());
49 
50 // new FacesRequest("/trustmanager/update/" + (String) data.get("tr1Inum")) {
51 //
52 // @Override
53 // protected void processValidations() throws Exception {
54 // System.out.println("#{_trustRelationship.displayName} resulted in " + getValue("#{_trustRelationship.displayName}"));
55 // validateValue("#{_trustRelationship.spLogoutURL}", (String) data.get("randomUrl1"));
56 // assert !isValidationFailure();
57 // }
58 //
59 // @Override
60 // protected void updateModelValues() throws Exception {
61 // setValue("#{_trustRelationship.spLogoutURL}", (String) data.get("randomUrl1"));
62 // }
63 //
64 // @Override
65 // protected void invokeApplication(){
66 // System.out.println("#{updateTrustRelationshipAction.save} resulted in " + invokeMethod("#{updateTrustRelationshipAction.save}"));
67 // }
68 
69 // }.run();
70 
71 // logoutUserFacesRequest();
72  }

メンバ詳解

◆ testData

FileConfiguration org.gluu.oxtrust.action.test.ConfigurableTest.testData
staticinherited

このクラス詳解は次のファイルから抽出されました: