|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.silverpeas.attachment.repository.JcrTest
public abstract class JcrTest
This class handle a JCR test with using a Spring context.
| Constructor Summary | |
|---|---|
JcrTest()
|
|
| Method Summary | |
|---|---|
SimpleDocument |
assertContent(String uuId,
String language,
String expectedContent)
Common method to assert the content for a language of a document. |
void |
assertDocumentDoesNotExist(String uuId)
Common method to assert a document existence. |
void |
assertDocumentExists(String uuId)
Common method to assert a document existence. |
SimpleDocument |
createAttachmentForTest(SimpleDocument document,
SimpleAttachment attachment,
String content)
Creates an Image Master Node into the JCR |
SimpleAttachment |
defaultDEContent()
|
SimpleDocument |
defaultDocument(String instanceId,
String foreignId)
|
protected SimpleDocument |
defaultDocument(String instanceId,
String foreignId,
SimpleAttachment file)
|
protected SimpleAttachment |
defaultENContent()
|
SimpleAttachment |
defaultFRContent()
|
void |
execute()
Execute the test with its context. |
org.springframework.context.support.ClassPathXmlApplicationContext |
getAppContext()
|
protected byte[] |
getBinaryContent(javax.jcr.Property property)
Gets the Binary content of a JCR node property. |
protected String |
getBinaryContentAsString(javax.jcr.Property property)
Gets the Binary content of a JCR node property as a String. |
protected SimpleDocument |
getDocumentById(String uuId)
|
SimpleDocument |
getDocumentById(String uuId,
String language)
|
protected javax.jcr.Node |
getRelativeNode(javax.jcr.Node parentNode,
String jcrPath)
Gets from the specified parent node the child node that satisfies the given jcrPath. |
protected javax.jcr.Node |
getSingleChildNode(javax.jcr.Node node)
Gets the single child node of a node. |
Date |
getTestStartDate()
|
protected List<String> |
listPathesFrom(javax.jcr.Node parentNode)
Lists all entire pathes that exists from the specified node (recursive treatment). |
protected List<String> |
listPathesFrom(javax.jcr.Node parentNode,
int deep)
Lists all entire pathes that exists from the specified node (recursive treatment). |
protected Date |
randomDate()
|
abstract void |
run()
|
void |
setAppContext(org.springframework.context.support.ClassPathXmlApplicationContext appContext)
|
protected void |
setBinaryContent(javax.jcr.Property property,
byte[] content)
Sets the Binary content of a JCR node property. |
protected SimpleDocument |
updateAttachmentForTest(SimpleDocument document)
Creates an Image Master Node into the JCR |
SimpleDocument |
updateAttachmentForTest(SimpleDocument document,
String language,
String content)
Creates an Image Master Node into the JCR |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JcrTest()
| Method Detail |
|---|
public org.springframework.context.support.ClassPathXmlApplicationContext getAppContext()
public void setAppContext(org.springframework.context.support.ClassPathXmlApplicationContext appContext)
public Date getTestStartDate()
public abstract void run()
throws Exception
Exception
public void execute()
throws Exception
Exception
public void assertDocumentExists(String uuId)
throws Exception
uuId - the uuId to retrieve the document.
Exception
public void assertDocumentDoesNotExist(String uuId)
throws Exception
uuId - the uuId to retrieve the document.
Exception
public SimpleDocument assertContent(String uuId,
String language,
String expectedContent)
throws Exception
uuId - the uuId to retrieve the document.language - the language in which the content must be verified.expectedContent - if null, the content for the language does not exist.
Exception
public SimpleDocument getDocumentById(String uuId,
String language)
throws Exception
Exception
protected SimpleDocument getDocumentById(String uuId)
throws Exception
Exception
protected SimpleDocument defaultDocument(String instanceId,
String foreignId,
SimpleAttachment file)
public SimpleDocument defaultDocument(String instanceId,
String foreignId)
protected SimpleAttachment defaultENContent()
public SimpleAttachment defaultFRContent()
public SimpleAttachment defaultDEContent()
protected Date randomDate()
public SimpleDocument createAttachmentForTest(SimpleDocument document,
SimpleAttachment attachment,
String content)
throws Exception
document - attachment - content -
Exception
public SimpleDocument updateAttachmentForTest(SimpleDocument document,
String language,
String content)
throws Exception
document - language - content -
Exception
protected SimpleDocument updateAttachmentForTest(SimpleDocument document)
throws Exception
document -
Exception
protected javax.jcr.Node getSingleChildNode(javax.jcr.Node node)
throws Exception
node - the parent node.
Exception
protected String getBinaryContentAsString(javax.jcr.Property property)
throws Exception
Binary content of a JCR node property as a String.
property - the JCR property that must contains a binary content.
String.
Exception
protected byte[] getBinaryContent(javax.jcr.Property property)
throws Exception
Binary content of a JCR node property.
property - the JCR property that must contains a binary content.
Exception
protected void setBinaryContent(javax.jcr.Property property,
byte[] content)
throws Exception
Binary content of a JCR node property.
property - the JCR property that must contains a binary content.
Exception
protected javax.jcr.Node getRelativeNode(javax.jcr.Node parentNode,
String jcrPath)
parentNode - the parent node from which the JCR path is guessed.jcrPath - the JCR path to find.
protected List<String> listPathesFrom(javax.jcr.Node parentNode)
throws javax.jcr.RepositoryException
parentNode - the parent node.
javax.jcr.RepositoryException
protected List<String> listPathesFrom(javax.jcr.Node parentNode,
int deep)
throws javax.jcr.RepositoryException
parentNode - the parent node.deep - the maximum number sub-nodes to reach.
javax.jcr.RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||