Suite Set Ups

Included page: .SuiteSetUp (edit)

Setup import and scripts

import
se.uu.ub.cora.fitnesseintegration
se.uu.ub.cora.fitnesseintegration.apptoken.script
se.uu.ub.cora.fitnesseintegration.authtoken.fixture
se.uu.ub.cora.fitnesseintegration.file
se.uu.ub.cora.fitnesseintegration.compare
se.uu.ub.cora.fitnesseintegration.script
se.uu.ub.cora.fitnesseintegration.waiter.fixture
se.uu.ub.cora.fitnesseintegration.server.compare.fixtures
se.uu.ub.cora.fitnesseintegration.binary
se.uu.ub.diva.cora.fitnesse

script SystemUrl
setUrl http://diva:8080/diva/
setAppTokenVerifierUrl http://login:8080/login/
setIdpLoginUrl http://idplogin:8080/idplogin/
setGatekeeperServerUrl http://gatekeeper:8080/gatekeeperserver/

script DependencyProvider
setHttpHandlerFactoryClassName se.uu.ub.cora.httphandler.HttpHandlerFactoryImp
setChildComparerUsingClassName se.uu.ub.cora.fitnesseintegration.ChildComparerImp
setComparerFactoryUsingClassName se.uu.ub.cora.fitnesseintegration.compare.ComparerFactoryImp


Import classes through pom.xml

Maven classpath [file: ./pom.xml, scope: test]:

  • Unable to parse POM file: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors: 1) No implementation for org.apache.maven.repository.RepositorySystem was bound. while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]] at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]] while locating org.apache.maven.execution.MavenExecutionRequestPopulator 1 error role: org.apache.maven.execution.MavenExecutionRequestPopulator roleHint:

Included page: .TheDiVATests.DivaTests.SuiteSetUp (edit)


Setup login


Login for admin


AppTokenEndpointFixture
userId appToken getAuthTokenForAppToken? getAuthToken? getStatusType?
coraUser:1299694997493014 f48a2fb3-814e-404a-a2dd-9860aff4e328 $adminAuthToken=

script AuthTokenHolder
setAdminAuthToken $adminAuthToken

Login for user


AppTokenEndpointFixture
userId appToken getAuthTokenForAppToken? getAuthToken? getStatusType?
121212 $userAuthToken= CREATED

script AuthTokenHolder
setUserAuthToken $userAuthToken

Login for DiVA example users

Hämta authTokens från idpLogin server


IdpLoginServletFixture
EPPN getAuthTokenForEPPN? getIdFromLogin? getResponseCode? getAuthToken? getValidForNoSeconds? getDeleteUrl?
fitnesseSystemAdmin@user.uu.se $systemAdminAuthToken=
fitnesseDomainAdminUU@user.uu.se $domainAdminUUAuthToken=
fitnesseDomainAdminKTH@user.kth.se $domainAdminKTHAuthToken=
userNotInDb@user.uu.se $guestToken=



Testing metacompleter and creator for metadataTextVariable

If text ids are not provided when creating a metadataTextVariable, the text ids are added and the texts are created in storage if they do not already exist.

Read texts to make sure they do not exist

Read fitnesseTestTextVarText and fitnesseTestTextVarDefText


RecordEndpointFixture
id type testReadRecord? getStatusType?
fitnesseTestTextVarText text NOT_FOUND
fitnesseTestTextVarDefText text NOT_FOUND

When a metadataTextVariable is created, two presentationVars are automatically created, one for input and one for output.

Read pVars to make sure they do not exist

Read fitnesseTestPVar and fitnesseTestOutputPVar


RecordEndpointFixture
id type testReadRecord? getStatusType?
fitnesseTestPVar presentation NOT_FOUND
fitnesseTestOutputPVar presentation NOT_FOUND

Create a new metadataTextVariable

Create a new metadataTextVariable (fitnesseTestTextVar)


RecordEndpointFixture
authToken type json testCreateRecord? getStatusType?
$adminAuthToken metadata {"children":[{"children":[{"name":"id","value":"fitnesseTestTextVar"},{"children":[{"name":"linkedRecordType","value":"system"},{"name":"linkedRecordId","value":"diva"}],"name":"dataDivider"},{"children":[{"name":"linkedRecordType","value":"validationType"},{"name":"linkedRecordId","value":"metadataTextVariable"}],"name":"validationType"}],"name":"recordInfo"},{"name":"nameInData","value":"fintnesseTest"},{"name":"regEx","value":"(^[0-9A-Za-z:-_]{2,50}$)"}],"name":"metadata","attributes":{"type":"textVariable"}} CREATED

Read fitnesseTestTextVar to see that links to texts have been added to the metadata

Read fitnesseTestTextVar


RecordEndpointFixture
id type testReadRecord? getStatusType?
fitnesseTestTextVar metadata =~/"name":"id","value":"fitnesseTestTextVar"/ OK

Read texts again to see that they have been created as DiVA texts including lang no


Read fitnesseTestTextVarText and fitnesseTestTextVarDefText


variable defined: expectedReadData=!- {"name":"text","children":[{"name":"recordInfo","children":[{"name":"dataDivider","children":[{"name":"linkedRecordType","value":"system"},{"name":"linkedRecordId","value":"diva"}]},{"name":"validationType","children":[{"name":"linkedRecordType","value":"validationType"},{"name":"linkedRecordId","value":"divaText"}]}]},{"name":"textPart","children":[{"name":"text","value":"Text för:fitnesseTestTextVarText"}],"attributes":{"type":"default","lang":"sv"}},{"name":"textPart","children":[{"name":"text","value":"Text for:fitnesseTestTextVarText"}],"attributes":{"type":"alternative","lang":"en"}}]} -!
variable defined: expectedCompareResult=OK
ChildComparerFixture
authToken type id testReadAndStoreRecord? children testCheckContainWithValues?
$adminAuthToken text fitnesseTestTextVarText {"name":"text","children":[{"name":"recordInfo","children":[{"name":"dataDivider","children":[{"name":"linkedRecordType","value":"system"},{"name":"linkedRecordId","value":"diva"}]},{"name":"validationType","children":[{"name":"linkedRecordType","value":"validationType"},{"name":"linkedRecordId","value":"divaText"}]}]},{"name":"textPart","children":[{"name":"text","value":"Text för:fitnesseTestTextVarText"}],"attributes":{"type":"default","lang":"sv"}},{"name":"textPart","children":[{"name":"text","value":"Text for:fitnesseTestTextVarText"}],"attributes":{"type":"alternative","lang":"en"}}]} OK

variable defined: expectedReadData=!- {"name":"text","children":[{"name":"recordInfo","children":[{"name":"dataDivider","children":[{"name":"linkedRecordType","value":"system"},{"name":"linkedRecordId","value":"diva"}]},{"name":"validationType","children":[{"name":"linkedRecordType","value":"validationType"},{"name":"linkedRecordId","value":"divaText"}]}]},{"name":"textPart","children":[{"name":"text","value":"Text för:fitnesseTestTextVarDefText"}],"attributes":{"type":"default","lang":"sv"}},{"name":"textPart","children":[{"name":"text","value":"Text for:fitnesseTestTextVarDefText"}],"attributes":{"type":"alternative","lang":"en"}}]} -!
variable defined: expectedCompareResult=OK
ChildComparerFixture
authToken type id testReadAndStoreRecord? children testCheckContainWithValues?
$adminAuthToken text fitnesseTestTextVarDefText {"name":"text","children":[{"name":"recordInfo","children":[{"name":"dataDivider","children":[{"name":"linkedRecordType","value":"system"},{"name":"linkedRecordId","value":"diva"}]},{"name":"validationType","children":[{"name":"linkedRecordType","value":"validationType"},{"name":"linkedRecordId","value":"divaText"}]}]},{"name":"textPart","children":[{"name":"text","value":"Text för:fitnesseTestTextVarDefText"}],"attributes":{"type":"default","lang":"sv"}},{"name":"textPart","children":[{"name":"text","value":"Text for:fitnesseTestTextVarDefText"}],"attributes":{"type":"alternative","lang":"en"}}]} OK



Read presentationVars again to see that they have been created

Read fitnesseTestPVar and fitnesseTestOutputPVar


RecordEndpointFixture
id type testReadRecord? getStatusType?
fitnesseTestPVar presentation OK
fitnesseTestOutputPVar presentation OK

Reset testdata

Remove data created for this test

Delete created metadataTextVariable, presentationVars and texts


RecordEndpointFixture
authToken type id testDeleteRecord? getStatusType?
$adminAuthToken presentation fitnesseTestPVar OK
$adminAuthToken presentation fitnesseTestOutputPVar OK
$adminAuthToken metadata fitnesseTestTextVar OK
$adminAuthToken text fitnesseTestTextVarText OK
$adminAuthToken text fitnesseTestTextVarDefText OK