Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
fixed bug on singleJobLauncher and acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RichJackson committed Mar 20, 2017
1 parent 7ede71a commit 999ac88
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gradle/2.11/taskArtifacts/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Fri Mar 10 00:24:12 GMT 2017
Binary file added .gradle/2.11/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file added .gradle/2.11/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file added .gradle/2.11/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file added .gradle/2.11/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file added .gradle/2.11/taskArtifacts/taskArtifacts.bin
Binary file not shown.
1 change: 1 addition & 0 deletions .gradle/2.3/taskArtifacts/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#Mon Mar 13 17:13:14 GMT 2017
Binary file added .gradle/2.3/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file added .gradle/2.3/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file added .gradle/2.3/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file added .gradle/2.3/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file added .gradle/2.3/taskArtifacts/taskArtifacts.bin
Binary file not shown.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,27 @@ gradlew -DsqlServerIntegTest.single=TikaWithoutScheduling -i sqlServerIntegTest

Applications that require GATE generally need to be configured to point to the GATE installation directory (or they would need to include a rather large amount of plugins on their classpath). To do this in cogstack, set the appropriate properties as detailed in gate.* .


## Acceptance Tests

The accompanying manuscript for this piece describes some artifically generated pseudo-documents containing misspellings and
other string mutations in order to validate the de-identification algorithm without requiring access to real world
data. These results can be replicated (subject to RNG) by using the acceptance test package.

To reproduce the results described in the manuscript, simply run the following command:
```
gradlew -DacceptTest.single=ElasticGazetteerAcceptanceTest -i acceptTest
```

to reconfigure this test class for the different conditions described in the manuscript, you will need to alter the parameters inside the

```
elasticgazetteer_test.properties
```

file, which describes the potential options. For efficiency, it is recommended to do this from inside an IDE.


## Example usage in real world deployments

The entire process is run through the command line, taking a path to a directory as a single argument. This directory should contain configuration files, (one complete one per spring batch job that you want to run simultaneously). These config files selectively activate Spring profiles as required to perform required data selection, processing and output writing steps.
Expand Down
23 changes: 22 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,29 @@ task sqlServerIntegTest(type: Test) {
}

task acceptTest(type: Test) {
testClassesDir = sourceSets.acceptTest.output.classesDir
testClassesDir = new File(sourceSets.acceptTest.output.classesDir.absolutePath
+'/uk/ac/kcl/at')
print testClassesDir.absolutePath
classpath = sourceSets.acceptTest.runtimeClasspath
print classpath

beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}

// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
}

beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}

// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import uk.ac.kcl.utils.DbmsTestUtils;
import uk.ac.kcl.it.PostGresTestUtils;
import uk.ac.kcl.utils.PostGresTestUtils;
import uk.ac.kcl.utils.SqlServerTestUtils;
import uk.ac.kcl.utils.TestUtils;
import uk.ac.kcl.mutators.Mutant;
Expand Down Expand Up @@ -59,8 +59,6 @@
@TestPropertySource({
"classpath:postgres_test.properties",
"classpath:postgres_db.properties",
// "classpath:sql_server_test.properties",
// "classpath:sql_server_db.properties",
"classpath:jms.properties",
"classpath:noScheduling.properties",
"classpath:gate.properties",
Expand All @@ -71,10 +69,9 @@
@ContextConfiguration(classes = {
SingleJobLauncher.class,
PostGresTestUtils.class,
SqlServerTestUtils.class,
TestUtils.class},
loader = AnnotationConfigContextLoader.class)
@ActiveProfiles({"deid","basic","localPartitioning","jdbc","elasticsearch","primaryKeyPartition","postgres"})
@ActiveProfiles({"deid","localPartitioning","jdbc_in","elasticsearchRest","primaryKeyPartition","postgres"})
//@ActiveProfiles({"deid","basic","localPartitioning","jdbc","primaryKeyPartition","sqlserver"})
public class ElasticGazetteerAcceptanceTest {

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/uk/ac/kcl/scheduling/ScheduledJobLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;
Expand All @@ -28,7 +29,7 @@
*
* @author King's College London, Richard Jackson <[email protected]>
*/
@Import(JobConfiguration.class)
@ComponentScan({"uk.ac.kcl.scheduling"})
@EnableScheduling
public class ScheduledJobLauncher {

Expand Down

2 comments on commit 999ac88

@hkkenneth
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are content in .gradle folder should be checked in to git? It causes conflict everytime when I switch branches.

@hkkenneth
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.