public class XMPUtilTest
extends TestCase
Constructor and Description |
---|
XMPUtilTest() |
Modifier and Type | Method and Description |
---|---|
void |
assertEquals(BibtexEntry expected,
BibtexEntry actual) |
static java.lang.String |
bibtexDescription(java.lang.String bibtex)
Wrap bibtex-data (
|
static java.lang.String |
bibtexEntry2BibtexString(BibtexEntry e) |
static BibtexEntry |
bibtexString2BibtexEntry(java.lang.String s) |
static java.lang.String |
bibtexXPacket(java.lang.String bibtexDescriptions)
Wrap bibtex-descriptions (rdf:Description) into the xpacket header.
|
static java.lang.String |
readManually(java.io.File tempFile) |
void |
setUp()
Create a temporary PDF-file with a single empty page.
|
static java.lang.String |
slurp(java.io.Reader reader)
Read the contents of a reader as one string
|
BibtexEntry |
t1BibtexEntry() |
java.lang.String |
t1BibtexString() |
BibtexEntry |
t2BibtexEntry() |
java.lang.String |
t2BibtexString() |
java.lang.String |
t2XMP() |
BibtexEntry |
t3BibtexEntry() |
java.lang.String |
t3BibtexString() |
java.lang.String |
t3XMP() |
void |
tearDown()
Delete the temporary file.
|
void |
testAttributeRead()
Test whether XMP.readFile can deal with text-properties that are not
element-nodes, but attribute-nodes
|
void |
testCommandLineByKey()
Test whether the command-line client can pick one of several entries from
a bibtex file
|
void |
testCommandLineSeveral()
Test whether the command-line client can deal with several bibtex
entries.
|
void |
testCommandLineSingleBib()
Test whether the command-line client works correctly with writing a
single entry
|
void |
testCommandLineSinglePdf() |
void |
testEmpty() |
void |
testEncryption()
Test that we cannot use encrypted PDFs.
|
void |
testNewlineHandling()
Are newlines in the XML processed correctly?
|
void |
testPrivacyFilter()
Make sure that the privacy filter works.
|
void |
testReadMultiple()
Tests whether it is possible to read several BibtexEntries
|
void |
testReadRawXMP() |
void |
testReadWriteDC() |
void |
testReadWriteXMP()
Test that readXMP and writeXMP work together.
|
void |
testReadXMPEntryType()
Is the XMPEntryType correctly set?
|
void |
testReadXMPSeq()
Are authors and editors correctly read?
|
void |
testReadXMPSimple()
Most basic test for reading.
|
void |
testReadXMPUTF8()
Is UTF8 handling working? This is because Java by default uses the
platform encoding or a special UTF-kind.
|
void |
testResolveStrings()
Test that readXMP and writeXMP work together.
|
void |
testResolveStrings2()
A better testcase for resolveStrings.
|
void |
testSimpleUpdate()
Tests whether writing BibTex.xmp will preserve existing XMP-descriptions.
|
void |
testWriteMultiple()
Tests whether it is possible to write several Bibtexentries
|
void |
testWriteReadManually()
Test whether the helper function work correctly.
|
void |
testWriteSingleUpdatesDCAndInfo() |
void |
testXMLEscape()
Is XML in text properties properly escaped?
|
void |
testXMPreadString() |
void |
writeManually(java.io.File tempFile,
java.lang.String xmpString)
Write a manually constructed xmp-string to file
|
public static java.lang.String bibtexDescription(java.lang.String bibtex)
bibtex
- public static java.lang.String bibtexXPacket(java.lang.String bibtexDescriptions)
bibtexDescriptions
- public void writeManually(java.io.File tempFile, java.lang.String xmpString) throws java.lang.Exception
xmpString
- java.lang.Exception
public static BibtexEntry bibtexString2BibtexEntry(java.lang.String s) throws java.io.IOException
java.io.IOException
public static java.lang.String bibtexEntry2BibtexString(BibtexEntry e) throws java.io.IOException
java.io.IOException
public java.lang.String t1BibtexString()
public BibtexEntry t1BibtexEntry() throws java.io.IOException
java.io.IOException
public java.lang.String t2XMP()
public java.lang.String t2BibtexString() throws java.io.IOException
java.io.IOException
public BibtexEntry t2BibtexEntry()
public BibtexEntry t3BibtexEntry()
public java.lang.String t3BibtexString() throws java.io.IOException
java.io.IOException
public java.lang.String t3XMP()
public void setUp() throws java.io.IOException, org.apache.pdfbox.exceptions.COSVisitorException
java.io.IOException
org.apache.pdfbox.exceptions.COSVisitorException
public void tearDown()
public void testReadXMPSimple() throws java.lang.Exception
java.lang.Exception
public void testReadXMPUTF8() throws java.lang.Exception
java.lang.Exception
public void testPrivacyFilter() throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
- Should not happen.javax.xml.transform.TransformerException
- Should not happen.public void testReadXMPSeq() throws java.lang.Exception
java.lang.Exception
public void testReadXMPEntryType() throws java.lang.Exception
java.lang.Exception
public static java.lang.String readManually(java.io.File tempFile) throws java.io.IOException
java.io.IOException
public void testWriteReadManually() throws java.lang.Exception
java.lang.Exception
public void testReadWriteXMP() throws java.lang.Exception
java.lang.Exception
public void testNewlineHandling() throws java.lang.Exception
java.lang.Exception
public void testAttributeRead() throws java.lang.Exception
java.lang.Exception
public void testEmpty() throws java.lang.Exception
java.lang.Exception
public void testSimpleUpdate() throws java.lang.Exception
java.lang.Exception
- (indicating an failure)public void testXMLEscape() throws java.lang.Exception
java.lang.Exception
public void assertEquals(BibtexEntry expected, BibtexEntry actual)
public void testXMPreadString() throws java.lang.Exception
java.lang.Exception
public void testReadMultiple() throws java.lang.Exception
java.lang.Exception
public void testWriteMultiple() throws java.io.IOException, javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
java.io.IOException
public void testReadWriteDC() throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
javax.xml.transform.TransformerException
public void testWriteSingleUpdatesDCAndInfo() throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
javax.xml.transform.TransformerException
public void testReadRawXMP() throws java.lang.Exception
java.lang.Exception
public void testCommandLineSingleBib() throws java.lang.Exception
java.lang.Exception
public void testCommandLineSinglePdf() throws java.lang.Exception
java.lang.Exception
public void testCommandLineByKey() throws java.lang.Exception
java.lang.Exception
public void testCommandLineSeveral() throws java.lang.Exception
java.lang.Exception
public void testResolveStrings() throws java.lang.Exception
java.lang.Exception
public void testEncryption() throws java.lang.Exception
java.lang.Exception
public void testResolveStrings2() throws java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
java.io.FileNotFoundException
javax.xml.transform.TransformerException
public static java.lang.String slurp(java.io.Reader reader) throws java.io.IOException
reader
- java.io.IOException