class: TestBase

public class: TestBase
Author: Miriam Doelle (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 422 $ $LastChangedDate: 2007-11-07 12:1; Complexity: 1
Dates: Created: 16.07.2009 15:20:03; Modified: 16.07.2009 15:20:03;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {01C52FF1-AC30-44bd-AEFC-017DFE0068C0}
Base class for pubman logic tests.
 

Goto: Custom Properties, Fields, Methods

See also: AdvancedSearchTest, SearchAndOutputTest, SearchPubItemsByAffiliationTest, SimpleSearchTest, TestSearchBase

Appears in: search

Connections
 
Custom Properties
 
TestBase Attributes
Attribute Details
private static const Logger
  logger
Initial: Logger.getLogger(TestBase.class)
protected static const String
  MPG_TEST_AFFILIATION
Initial: "escidoc:persistent13"
private static const int
  NUMBER_OF_URL_TOKENS
Initial: 2
protected static const String
  PUBMAN_CONTENT_TYPE_ID
Initial: "escidoc:persistent4"
protected static const String
  PUBMAN_TEST_COLLECTION_DESCRIPTION
Initial: "This is the sample collection description of the PubMan Test\n" + "collection. Any content can be stored in this collection, which is of relevance\n" + "for the users of the system. You can submit " + "relev" + "ant bibliographic information\n" + "for your publication (metadata) and all relevant files. The MPS is the\n" + "responsible affiliation for this collection. Please contact\n" + "u.tschida@zim.mpg.de for any questions."
protected static const String
  PUBMAN_TEST_COLLECTION_ID
Initial: "escidoc:persistent3"
protected static const String
  PUBMAN_TEST_COLLECTION_NAME
Initial: "PubMan Test Collection"
protected static const String
  TESTFILE_PATH
Initial: "src/test/resources/search/Der_kleine_Prinz_Auszug.pdf"
 
TestBase Methods
Operation Details
protected static
createItem(
   ItemVO pubItem,
   AccountUserVO user):ItemVO
Sequential
Tags: throws=Exception
public
findFileInClasspath(
   String fileName):File
Sequential
Tags: throws=FileNotFoundException
Notes: Finds a given file name in the classpath and returns the file.
@return The found file.
public const
getActualDateString():String
Sequential
Notes: Returns the current date in a valid format.
@return String that contains the actual date
protected static
getComplexPubItemWithoutFiles():PubItemVO
Sequential
protected static
getDocument(
   String xml,
   boolean namespaceAwareness):Document
Sequential
Tags: throws=Exception
Notes: Parse the given xml String into a org.w3c.dom.Document.
@return The Document
protected static
getMdsPublication():MdsPublicationVO
Sequential
protected static
getNewPubItemWithoutFiles():PubItemVO
Sequential
Notes: Get a new pub item.
@return pub item
protected static
getPubItemFromFramework(
   ItemRO pubItemRef,
   AccountUserVO accountUser):PubItemVO
Sequential
Tags: throws=Exception
Notes: Helper: Retrieves the item from the Framework ItemHandler and transforms it to a PubItemVO.
protected static
getService(
   String serviceName):Object
Sequential
Tags: throws=NamingException
Notes: Helper method to retrieve a EJB service instance. The name to be passed to the method is normally 'ServiceXY.SERVICE_NAME'.
@return instance of the EJB service
protected static
getUserSystemAdministratorWithHandle():AccountUserVO
Sequential
Tags: throws=Exception
Notes: Logs in the user roland and returns the corresponding AccountUserVO
@return The account user roland with handle set.
protected static
getUserTestDepLibWithHandle():AccountUserVO
Sequential
Tags: throws=Exception
Notes: Logs in the user test_dep_lib and returns the corresponding AccountUserVO
@return The account user test_dep_lib with handle set.
protected static
getUserTestDepScientistWithHandle():AccountUserVO
Sequential
Tags: throws=Exception
Notes: Logs in the user test_dep_scientist and returns the corresponding AccountUserVO
@return The account user test_dep_scientist with handle set.
private static
getUserWithHandle(
   String userHandle):AccountUserVO
Sequential
Tags: throws=Exception
protected static
loginDepositorLibrary():String
Sequential
Tags: throws=ServiceException,HttpException,IOException,URISyntaxException
Notes: Logs the user test_dep_lib in and returns the corresponding user handle.
@return userhandle
protected static
loginScientist():String
Sequential
Tags: throws=ServiceException,HttpException,IOException,URISyntaxException
Notes: Logs the user test_dep_scientist in and returns the corresponding user handle.
@return userhandle
protected static
loginSystemAdministrator():String
Sequential
Tags: throws=ServiceException,HttpException,IOException,URISyntaxException
Notes: Logs the user roland in and returns the corresponding user handle.
@return userhandle
protected static
loginUser(
   String userid,
   String password):String
Sequential
Tags: throws=HttpException,IOException,ServiceException,URISyntaxException
Notes: Logs in the given user with the given password.
@return The handle for the logged in user.
public static
readFile(
   String fileName):String
Sequential
Notes: Reads contents from text file and returns it as String.
@return Entire contents of filename as a String
protected static
submitAndReleaseItem(
   ItemVO item,
   AccountUserVO user):ItemVO
Sequential
Tags: throws=Exception
protected static
uploadFile(
   String filename,
   String mimetype,
   String userHandle):URL
Sequential
Tags: throws=Exception
Notes: Uploads a file to the staging servlet and returns the corresponding URL.
@return The URL of the uploaded file