-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#360 - Create stress/load test which should cover all APIs with mocke…
…d OP
- Loading branch information
Showing
11 changed files
with
136 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
oxd-server/src/test/java/org/gluu/oxd/mock/SetUpMockServerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.gluu.oxd.mock; | ||
|
||
import io.dropwizard.testing.DropwizardTestSupport; | ||
import org.gluu.oxd.mock.guice.MockAppModule; | ||
import org.gluu.oxd.server.OxdServerConfiguration; | ||
import org.gluu.oxd.server.ServerLauncher; | ||
import org.gluu.oxd.server.SetUpTest; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.testng.annotations.AfterSuite; | ||
import org.testng.annotations.BeforeSuite; | ||
import org.testng.annotations.Parameters; | ||
|
||
public class SetUpMockServerTest { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(org.gluu.oxd.mock.SetUpMockServerTest.class); | ||
|
||
public static DropwizardTestSupport<OxdServerConfiguration> SUPPORT = null; | ||
|
||
|
||
@Parameters({"host", "opHost", "redirectUrls"}) | ||
@BeforeSuite | ||
public static void beforeSuite(String host, String opHost, String redirectUrls) { | ||
try { | ||
LOG.debug("Running beforeSuite of Mock server..."); | ||
ServerLauncher.setInjector(new MockAppModule()); | ||
SetUpTest.beforeSuite(host, opHost, redirectUrls); | ||
LOG.debug("Finished beforeSuite of Mock server!"); | ||
} catch (Exception e) { | ||
LOG.error("Failed to start suite of Mock server.", e); | ||
throw new AssertionError("Failed to start suite of Mock server."); | ||
} | ||
} | ||
|
||
@AfterSuite | ||
public static void afterSuite() { | ||
try { | ||
LOG.debug("Running afterSuite ..."); | ||
SetUpTest.afterSuite(); | ||
LOG.debug("HTTP server is successfully stopped."); | ||
} catch (Exception e) { | ||
LOG.error("Failed to stop HTTP server.", e); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
oxd-server/src/test/java/org/gluu/oxd/mock/listener/EnableMocksListener.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
|
||
<suite name="oxD Suite" parallel="false"> | ||
|
||
<parameter name="host" value="http://localhost"/> | ||
<parameter name="opHost" value="https://${test.server.name}"/> | ||
<parameter name="opDiscoveryPath" value=""/> | ||
<parameter name="redirectUrls" value="https://client.example.com/cb/home1 https://client.example.com/cb/home2"/> | ||
<parameter name="paramRedirectUrl" value="https://client.example.com/cb/home2"/> | ||
<parameter name="postLogoutRedirectUrl" value="https://client.example.com/cb/logout"/> | ||
<parameter name="postLogoutRedirectUrls" value="https://client.example.com/cb/logout/page1 https://client.example.com/cb/logout/page2"/> | ||
<parameter name="logoutUrl" value="https://client.example.com/logout"/> | ||
<parameter name="state" value="custom_state_for_testing"/> | ||
<parameter name="userId" value="${auth.user.uid}"/> | ||
<parameter name="userSecret" value="${auth.user.password}"/> | ||
<parameter name="clientId" value="${auth.client.id}"/> | ||
<parameter name="clientSecret" value="${auth.client.secret}"/> | ||
<parameter name="rsProtect" | ||
value="{'resources':[{'path':'/ws/phone','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/view'],'ticketScopes':['http://photoz.example.com/dev/actions/view']},{'httpMethods':['PUT', 'POST'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add'],'ticketScopes':['http://photoz.example.com/dev/actions/add']},{'httpMethods':['DELETE'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/remove'],'ticketScopes':['http://photoz.example.com/dev/actions/remove']}]}]}"/> | ||
<parameter name="rsProtectScopeExpression" | ||
value="{'resources':[{'path':'/ws/phone','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/view'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add','http://photoz.example.com/dev/actions/view']}},{'httpMethods':['PUT','POST'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/add','http://photoz.example.com/dev/actions/view']},'ticketScopes':['http://photoz.example.com/dev/actions/add']},{'httpMethods':['DELETE'],'scopes':['http://photoz.example.com/dev/actions/all','http://photoz.example.com/dev/actions/remove'],'ticketScopes':['http://photoz.example.com/dev/actions/remove']}]}]}"/> | ||
<parameter name="rsProtectScopeExpressionSecond" | ||
value="{'resources':[{'path':'/GetAll','conditions':[{'httpMethods':['GET'],'scopes':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3'],'ticketScopes':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3'],'scope_expression':{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3']}}]}]}"/> | ||
<parameter name="correctScopeExpression" | ||
value="{'rule':{'and':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3']}"/> | ||
<parameter name="incorrectScopeExpression" | ||
value="{'rule':{'not':[{'or':[{'var':0},{'var':1}]},{'var':2}]},'data':['http://photoz.example.com/dev/actions/a1','http://photoz.example.com/dev/actions/a2','http://photoz.example.com/dev/actions/a3']}"/> | ||
<parameter name="clientJwksUri" value="${clientJwksUri}"/> | ||
<parameter name="accessTokenSigningAlg" value="${accessTokenSigningAlg}"/> | ||
|
||
|
||
<!-- main class to set up and tear down suite --> | ||
<test name="SetUp" enabled="true"> | ||
<classes> | ||
<class name="org.gluu.oxd.mock.SetUpMockServerTest"/> | ||
</classes> | ||
</test> | ||
|
||
<!-- Mock tests--> | ||
<test name="Authorization Code Flow Test" enabled="true"> | ||
<classes> | ||
<class name="org.gluu.oxd.mock.AuthorizationCodeFlowTest"/> | ||
</classes> | ||
</test> | ||
<test name="UMA - Mock Full Flow Test" enabled="true"> | ||
<classes> | ||
<class name="org.gluu.oxd.mock.UmaFullTest"/> | ||
</classes> | ||
</test> | ||
</suite> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +0,0 @@ | ||
test.server.name=ce-dev5.gluu.org | ||
swd.resource=acct:test_user@ce-dev5.gluu.org | ||
|
||
auth.user.uid=test_user | ||
auth.user.password=test_user_password | ||
auth.user.inum=B1F3-AEAE-B798 | ||
auth.user.email=test_user@test.org | ||
|
||
auth.client.id=FF81-2D39 | ||
auth.client.secret=n8d2Vx7cLIHX | ||
|
||
uma.user.uid=test_user | ||
uma.user.password=test_user_password | ||
uma.pat.client.id=AB77-1A2B | ||
uma.pat.client.secret=kreFfiq2thys | ||
|
||
sector.identifier.id=a55ede29-8f5a-461d-b06e-76caee8d40b5 | ||
sector.identifier.id.bad=840ef58d-a7d0-4986-af7b-71ed0089ce61 | ||
|
||
clientKeyStoreFile=profiles/ce-dev5.gluu.org/client_keystore.jks | ||
clientKeyStoreSecret=secret | ||