class: TestCitationStylesSubstantial

public class: TestCitationStylesSubstantial
Author: Vladislav Makarenko (initial)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 1700 $ $LastChangedDate: 2009-03-12 12:; Complexity: 1
Dates: Created: 16.07.2009 15:12:42; Modified: 16.07.2009 15:12:42;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {9015709A-68EE-4a99-B578-FF1524B6257A}
Test class for citation manager processing component Can be started from eclipse. The system property <code>citation.style</code> is used to define citation style to test. See <code>resource/CitationStyles/<CitationStyle>/test.properties</code> for definition of the tests. The following fields are obligatory to define the correct test:
 

Goto: Custom Properties, Fields, Methods

See also: CitationStyleHandler, UserAccountHandler, UserAccountHandler

Appears in: test

Connections
 
Custom Properties
 
TestCitationStylesSubstantial Attributes
Attribute Details
private static String
  adminHandle
private static const String
  CITATION_STYLE_TEST_COLLECTION_FILE_NAME
Initial: "CitationStyleTestCollection.xml"
private static const String
  CITATION_STYLE_TEST_CONTEXTS_FILE_NAME
Initial: "CitationStyleTestContexts.xml"
private static const String
  CITATION_STYLE_TEST_USER_ACCOUNT_FILE_NAME
Initial: "CitationStyleTestUserAccount.xml"
private static const String
  CITATION_STYLE_TEST_USER_GRANTS_FILE_NAME
Initial: "CitationStyleTestUserGrants.xml"
private static const String
  CITATION_STYLE_TEST_XMLS_DIRECTORY
Initial: "src/test/resources/backup"
private static const String
  CONTEXT
Initial: "Citation Style Testing Context"
private static const String
  FILTER_CITATION_STYLE_CONTEXT
Initial: "" + "" + CONTEXT +"" + ""
private static const String
  FILTER_CITATION_STYLE_TEST_COLLECTION
Initial: "" + "" + CONTEXT +"" + ""
private static const String
  FILTER_CITATION_USER
Initial: "" + "" + USER_NAME + "" + ""
private static const String
  LMD_FORMAT
Initial: ""
private Logger
  logger
Initial: Logger.getLogger(getClass())
private static CitationStyleHandler
  pcs
protected static const String
  PROPERTY_PASSWORD_ADMIN
Initial: "framework.admin.password"
protected static const String
  PROPERTY_USERNAME_ADMIN
Initial: "framework.admin.username"
private static UserAccountHandler
  uah_admin
private static UserAccountHandler
  uah_user
private static const String
  USER_NAME
Initial: "citman_user"
private static const String
  USER_PASSWD
Initial: "citman_user"
private static String
  userHandle
private static XPath
  xpath
 
TestCitationStylesSubstantial Methods
Operation Details
public
backupAll():void
Sequential
Tags: annotations=@Test@Ignore
throws=Exception
Notes: Saves complete bundle of the XMLs related to citation style testing collection: 1. User account 2. Context 3. Grants 4. Testing items into the XML files
public
backupContext():void
Sequential
Tags: throws=Exception
Notes: Saves Context into the file
public
backupItems():void
Sequential
Tags: throws=Exception
Notes: Saves Items of the Context into the file
public
backupUser():void
Sequential
Tags: throws=Exception
Notes: Saves User Account and Grants assigned to the user into the file
private static
cleanCit(
   String str):String
Sequential
private
createDocument(
   String xml):Document
Sequential
Tags: throws=Exception
private
diffStrings(
   String str1,
   String str2):boolean
Sequential
Notes: Compares two strings
@return
private
getContextId():String
Sequential
Tags: throws=Exception
Notes: Get <code>objid</code> of the Context against the name of it
@return objid of the Context
private
getCreatorOfUserId(
   String userXml):String
Sequential
Tags: throws=Exception
Notes: Get <code>objid</code> of the Creator of the User
@return objid of the Creator of the User
private
getFileAsString(
   String fileName):String
Sequential
Tags: throws=IOException
private
getPathToTestResources():String
Sequential
private
getUserId(
   String userXml):String
Sequential
Tags: throws=Exception
Notes: Get <code>objid</code> of the User
@return objid of the User
public
restoreAll():void
Sequential
Tags: annotations=@Test@Ignore
throws=Exception
Notes: Restores the bundle of the XML files needed to create citation style testing collection in the current eSciDoc framework
private
restoreContext():boolean
Sequential
Tags: throws=Exception
Notes: Restores Context
@return <code>true</code> if successful, <code>false</code> otherwise
private
restoreGrants():boolean
Sequential
Tags: throws=Exception
Notes: restores Grants for the Context on the User
@return <code>true</code> if successful, <code>false</code> otherwise
private
restoreItems():boolean
Sequential
Tags: throws=Exception
private
restoreUser():boolean
Sequential
Tags: throws=Exception
Notes: Creates User Account
@return <code>true</code> if successful, <code>false</code> otherwise
public static
setUp():void
Sequential
Tags: annotations=@BeforeClass
throws=Exception
public const
testCitationStylesGeneration():void
Sequential
Tags: annotations=@Test
throws=Exception
Notes: Tests all citation styles substantial
private
writeToFile(
   String fileName,
   String content):void
Sequential
Tags: throws=IOException
private
xpathNode(
   String expr,
   String xml):Node
Sequential
Tags: throws=Exception
private
xpathNode(
   String expr,
   Document doc):Node
Sequential
Tags: throws=Exception
private
xpathNodeList(
   String expr,
   String xml):NodeList
Sequential
Tags: throws=Exception
private
xpathNodeList(
   String expr,
   Document doc):NodeList
Sequential
Tags: throws=Exception
private
xpathNumber(
   String expr,
   String xml):Double
Sequential
Tags: throws=Exception
private
xpathNumber(
   String expr,
   Document doc):Double
Sequential
Tags: throws=Exception
private
xpathString(
   String expr,
   String xml):String
Sequential
Tags: throws=Exception
private
xpathString(
   String expr,
   Document doc):String
Sequential
Tags: throws=Exception