class: TestBase

public class: TestBase
Author: Miriam Doelle (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 2117 $ $LastChangedDate: 2009-02-11 17:; Complexity: 1
Dates: Created: 16.07.2009 15:31:43; Modified: 16.07.2009 15:31:43;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {46510D0E-EAD8-4048-9D50-09731CBD76AF}
Base class for pubman logic tests.
 

Goto: Custom Properties, Fields, Methods

See also: RetrievePubCollectionTest, PubItemDepositingTest, ItemExportingTest, PubItemPublishingTest, AdvancedSearchTest, SearchAndOutputTest, SearchPubItemsByAffiliationTest, SearchTest

Appears in: pubman

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_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"
 
TestBase Methods
Operation Details
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
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
getMdsPublication():MdsPublicationVO
Sequential
protected
getNewPubItemWithoutFiles():PubItemVO
Sequential
Notes: Get a new pub item.
@return pub item
protected
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
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
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
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
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
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