-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
191 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
common-api/src/test/kotlin/io/xpdf/api/common/exception/XpdfProcessingExceptionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Common - The components shared between Xpdf APIs. | ||
* Copyright © 2024 xpdf.io (info@xpdf.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.xpdf.api.common.exception | ||
|
||
import io.kotest.matchers.shouldBe | ||
import io.mockk.mockk | ||
import org.junit.jupiter.api.Test | ||
|
||
class XpdfProcessingExceptionTest { | ||
|
||
@Test | ||
fun `should initialize`() { | ||
// given | ||
val cause = mockk<Exception>() | ||
val exception = XpdfProcessingException(cause) | ||
|
||
// when then | ||
exception.cause shouldBe cause | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
common-api/src/test/kotlin/io/xpdf/api/common/exception/XpdfRuntimeExceptionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Common - The components shared between Xpdf APIs. | ||
* Copyright © 2024 xpdf.io (info@xpdf.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.xpdf.api.common.exception | ||
|
||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
|
||
class XpdfRuntimeExceptionTest { | ||
|
||
@Test | ||
fun `should initialize`() { | ||
// given | ||
val exception = XpdfRuntimeException("some message") | ||
|
||
// when then | ||
exception.message shouldBe "some message" | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
common-api/src/test/kotlin/io/xpdf/api/common/exception/XpdfTimeoutExceptionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Common - The components shared between Xpdf APIs. | ||
* Copyright © 2024 xpdf.io (info@xpdf.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.xpdf.api.common.exception | ||
|
||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
|
||
class XpdfTimeoutExceptionTest { | ||
|
||
@Test | ||
fun `should initialize`() { | ||
// given | ||
val exception = XpdfTimeoutException("some message") | ||
|
||
// when then | ||
exception.message shouldBe "some message" | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
common-api/src/test/kotlin/io/xpdf/api/common/exception/XpdfValidationExceptionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Common - The components shared between Xpdf APIs. | ||
* Copyright © 2024 xpdf.io (info@xpdf.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.xpdf.api.common.exception | ||
|
||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
|
||
class XpdfValidationExceptionTest { | ||
|
||
@Test | ||
fun `should initialize`() { | ||
// given | ||
val exception = XpdfValidationException("some message") | ||
|
||
// when then | ||
exception.message shouldBe "some message" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...xt-api-spring-boot-starter/src/main/resources/META-INF/spring-configuration-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"properties": [ | ||
{ | ||
"name": "io.xpdf.api.pdftext.executable-path" | ||
"name": "io.xpdf.api.pdf-text.executable-path" | ||
}, | ||
{ | ||
"name": "io.xpdf.api.pdftext.timeout-seconds" | ||
"name": "io.xpdf.api.pdf-text.timeout-seconds" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
pdf-text-api/src/test/kotlin/io/xpdf/api/pdftext/PdfTextOptionsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* PdfText API - An API for accessing a native pdftotext library. | ||
* Copyright © 2024 xpdf.io (info@xpdf.io) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package io.xpdf.api.pdftext | ||
|
||
import io.kotest.matchers.shouldBe | ||
import io.xpdf.api.pdftext.options.PdfTextEncoding | ||
import io.xpdf.api.pdftext.options.PdfTextEndOfLine | ||
import io.xpdf.api.pdftext.options.PdfTextFormat | ||
import org.junit.jupiter.api.Test | ||
|
||
class PdfTextOptionsTest { | ||
|
||
@Test | ||
fun `should convert to string`() { | ||
// given | ||
val options = PdfTextOptions.builder() | ||
.pageStart(1) | ||
.pageStop(5) | ||
.format(PdfTextFormat.LAYOUT) | ||
.encoding(PdfTextEncoding.UTF_8) | ||
.endOfLine(PdfTextEndOfLine.UNIX) | ||
.pageBreakExcluded(true) | ||
.ownerPassword("ownerPassword") | ||
.userPassword("userPassword") | ||
.build() | ||
|
||
// when then | ||
options.toString() shouldBe "PdfTextOptions(pageStart=1, pageStop=5, format=LAYOUT, encoding=UTF_8, endOfLine=UNIX, pageBreakExcluded=true, ownerPassword=ownerPassword, userPassword=userPassword, nativeOptions=null)" | ||
} | ||
|
||
} |