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

公開メンバ関数

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
 

非公開変数類

Identity identity
 
Authenticator authenticator
 

詳解

Base class for all seam test which require authorization

著者
Yuriy Movchan

関数詳解

◆ checkLoggedIn()

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

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 
)
inlineprotected

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)
inlineprotected

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
inlineprotected

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

メンバ詳解

◆ authenticator

Authenticator org.gluu.oxtrust.action.test.AbstractAuthenticationTest.authenticator
private

◆ identity

Identity org.gluu.oxtrust.action.test.AbstractAuthenticationTest.identity
private

◆ testData

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

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