From e929b5f4c6d9351b29150e6c1843f06806ee7b00 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Mon, 1 Dec 2014 12:23:47 +0100 Subject: added status servlet to pdf-as-web --- pdf-as-web/build.gradle | 9 +++++++- .../egiz/pdfas/web/status/PdfAsWebTestFactory.java | 18 +++++++++++++++ .../gv/egiz/pdfas/web/status/SimpleAliveTest.java | 27 ++++++++++++++++++++++ .../services/at.gv.egiz.status.TestFactory | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/PdfAsWebTestFactory.java create mode 100644 pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/SimpleAliveTest.java create mode 100644 pdf-as-web/src/main/resources/META-INF/services/at.gv.egiz.status.TestFactory (limited to 'pdf-as-web') diff --git a/pdf-as-web/build.gradle b/pdf-as-web/build.gradle index 57eb54f9..2dbd7188 100644 --- a/pdf-as-web/build.gradle +++ b/pdf-as-web/build.gradle @@ -15,19 +15,26 @@ repositories { mavenCentral() } +configurations { providedCompile } + +sourceSets.main.compileClasspath += configurations.providedCompile +sourceSets.test.compileClasspath += configurations.providedCompile +sourceSets.test.runtimeClasspath += configurations.providedCompile + dependencies { compile project (':pdf-as-lib') compile project (':pdf-as-moa') compile project (':signature-standards:sigs-pkcs7detached') compile project (':signature-standards:sigs-pades') compile project (':pdf-as-pdfbox') + compile project (':pdf-as-web-status') compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1' compile group: 'opensymphony', name: 'sitemesh', version: '2.4.2' compile "commons-codec:commons-codec:1.9" compile 'org.apache.commons:commons-lang3:3.3.2' compile 'org.apache.cxf:cxf-rt-transports-http:3.0.1' compile 'org.apache.cxf:cxf-rt-frontend-jaxws:3.0.1' - providedCompile "javax.servlet:servlet-api:2.5" + providedCompile 'javax.servlet:javax.servlet-api:3.0.1' testCompile group: 'junit', name: 'junit', version: '4.+' } diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/PdfAsWebTestFactory.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/PdfAsWebTestFactory.java new file mode 100644 index 00000000..a6fa8a05 --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/PdfAsWebTestFactory.java @@ -0,0 +1,18 @@ +package at.gv.egiz.pdfas.web.status; + +import java.util.ArrayList; +import java.util.List; + +import at.gv.egiz.status.Test; +import at.gv.egiz.status.TestFactory; + +public class PdfAsWebTestFactory implements TestFactory { + + @Override + public List createTests() { + List testList = new ArrayList(); + testList.add(new SimpleAliveTest()); + return testList; + } + +} diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/SimpleAliveTest.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/SimpleAliveTest.java new file mode 100644 index 00000000..1f78f90c --- /dev/null +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/status/SimpleAliveTest.java @@ -0,0 +1,27 @@ +package at.gv.egiz.pdfas.web.status; + +import at.gv.egiz.status.Test; +import at.gv.egiz.status.TestResult; +import at.gv.egiz.status.TestStatus; +import at.gv.egiz.status.impl.BaseTestResult; + +public class SimpleAliveTest implements Test { + + @Override + public String getName() { + return "ALIVE"; + } + + @Override + public long getCacheDelay() { + return 0; + } + + @Override + public TestResult runTest() { + BaseTestResult result = new BaseTestResult(); + result.setStatus(TestStatus.OK); + return result; + } + +} diff --git a/pdf-as-web/src/main/resources/META-INF/services/at.gv.egiz.status.TestFactory b/pdf-as-web/src/main/resources/META-INF/services/at.gv.egiz.status.TestFactory new file mode 100644 index 00000000..d0787dae --- /dev/null +++ b/pdf-as-web/src/main/resources/META-INF/services/at.gv.egiz.status.TestFactory @@ -0,0 +1 @@ +at.gv.egiz.pdfas.web.status.PdfAsWebTestFactory \ No newline at end of file -- cgit v1.2.3