Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ private static String removeWhiteSpace(String string) {
if(string==null){
return null;
}
return CharMatcher.BREAKING_WHITESPACE.removeFrom(string);
return CharMatcher.breakingWhitespace().removeFrom(string);
}
}
1 change: 1 addition & 0 deletions official-build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DISABLE_AUTOTAGGING=true
USE_OPEN_SOURCE_SETTINGS=false
DISABLE_DOWNGRADE_ON_SNAPSHOT_DEPENDENCY=true
SEPG_BUILD_ENV_IMAGE=cafapi/opensuse-jdk8-maven:1.0.0
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</developers>

<properties>
<caf.worker-framework.version>1.9.0-260</caf.worker-framework.version>
<caf.worker-framework.version>5.1.0-SNAPSHOT</caf.worker-framework.version>
<cafBoilerplateApiContainerName>${dockerDataProcessingOrg}boilerplate-api${dockerProjectVersion}</cafBoilerplateApiContainerName>
<cafBoilerplateCreationContainerName>${dockerDataProcessingOrg}boilerplate-creator${dockerProjectVersion}</cafBoilerplateCreationContainerName>
<cafBoilerplateDbInstallerContainerName>${dockerDataProcessingOrg}boilerplate-db-installer${dockerProjectVersion}</cafBoilerplateDbInstallerContainerName>
Expand Down
2 changes: 2 additions & 0 deletions worker-boilerplate-container-fs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<expected.folder>${test.data}</expected.folder>
<test.sourcefile.base.folder>${test.binary.content.location}</test.sourcefile.base.folder>
<datastore.enabled>false</datastore.enabled>
<worker.testing.usehttpdatastore>true</worker.testing.usehttpdatastore>

<!-- boilerplate setup specific properties -->
<boilerplate.adminport>${boilerplate.adminport}</boilerplate.adminport>
Expand All @@ -206,6 +207,7 @@
<CAF_APPNAME>test/worker-boilerplate</CAF_APPNAME>
<CAF_CONFIG_PATH>${project.basedir}/test-configs</CAF_CONFIG_PATH>
<CAF_INTEGRATIONTESTS_FS_PATH>\\${docker.host.address}@${webdav.apache.port}\webdav</CAF_INTEGRATIONTESTS_FS_PATH>
<CAF_WORKER_HTTP_DATASTORE_URL>http://${docker.host.address}:${webdav.apache.port}/webdav</CAF_WORKER_HTTP_DATASTORE_URL>
<!-- Environment variables needed for old style tests-->
<rabbit.port>${rabbitmq.node.port}</rabbit.port>
<rabbit.host>${docker.host.address}</rabbit.host>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public class BoilerplateWorker extends AbstractWorker<BoilerplateWorkerTask, Boi

private static Logger logger = LoggerFactory.getLogger(BoilerplateWorker.class);

public BoilerplateWorker(BoilerplateWorkerTask task, DataStore dataStore, String resultQueue, String baseUrl,
Codec codec, int resultSizeLimit, String defaultReplacementText,
public BoilerplateWorker(BoilerplateWorkerTask task, final WorkerTaskData workerTaskData, DataStore dataStore, String resultQueue,
String baseUrl, Codec codec, int resultSizeLimit, String defaultReplacementText,
ExecutorService jepThreadPool, LoadingCache<Pair<String, Long>, BoilerplateExpression> expressionCache,
LoadingCache<Pair<String, Long>, Tag> tagCache,
LoadingCache<Pair<String, Long>, List<BoilerplateExpression>> tagExpressionCache) throws InvalidTaskException, TaskRejectedException {
super(task, resultQueue, codec);
LoadingCache<Pair<String, Long>, Tag> tagCache, LoadingCache<Pair<String, Long>,
List<BoilerplateExpression>> tagExpressionCache) throws InvalidTaskException, TaskRejectedException {
super(task, resultQueue, codec, workerTaskData);
this.dataStore = dataStore;
this.resultSizeLimit = resultSizeLimit;
processor = new RegexProcessor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ protected int getWorkerApiVersion() {
}

@Override
protected Worker createWorker(BoilerplateWorkerTask boilerplateWorkerTask) throws TaskRejectedException, InvalidTaskException {
return new BoilerplateWorker(boilerplateWorkerTask, getDataStore(), getConfiguration().getOutputQueue(),
protected Worker createWorker(BoilerplateWorkerTask boilerplateWorkerTask, final WorkerTaskData workerTaskData)
throws TaskRejectedException, InvalidTaskException {
return new BoilerplateWorker(boilerplateWorkerTask, workerTaskData, getDataStore(), getConfiguration().getOutputQueue(),
getConfiguration().getBaseUrl(), getCodec(), getConfiguration().getResultSizeLimit(),
getConfiguration().getDefaultReplacementText(), jepThreadPool,
expressionCache, tagCache, tagExpressionCache);
getConfiguration().getDefaultReplacementText(), jepThreadPool, expressionCache, tagCache, tagExpressionCache);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public class BoilerplateWorkerIT {
private static LoadingCache<Pair<String, Long>, Tag> tagCache;
@Mock
private DataStore dataStore;
@Mock
private WorkerTaskData workerTaskData;

@Before
public void setup() {
Expand Down Expand Up @@ -259,8 +261,8 @@ public BoilerplateExpression load(Pair<String, Long> stringLongPair) throws ApiE
// Test expression cache error handling.
InvalidTaskException exception = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
errorCache, tagCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, errorCache, tagCache, tagExpressionCache);
} catch (InvalidTaskException ite) {
exception = ite;
}
Expand All @@ -277,8 +279,8 @@ public BoilerplateExpression load(Pair<String, Long> stringLongPair) throws Exce

TaskRejectedException taskRejectedException = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
errorCache, tagCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, errorCache, tagCache, tagExpressionCache);
} catch (TaskRejectedException e) {
taskRejectedException = e;
}
Expand All @@ -295,8 +297,8 @@ public BoilerplateExpression load(Pair<String, Long> stringLongPair) throws Exce

taskRejectedException = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
errorCache, tagCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, errorCache, tagCache, tagExpressionCache);
} catch (TaskRejectedException e) {
taskRejectedException = e;
}
Expand Down Expand Up @@ -340,8 +342,8 @@ public Tag load(Pair<String, Long> stringLongPair) throws ApiException {
// Test expression cache error handling.
InvalidTaskException exception = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
expressionCache, errorCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, expressionCache, errorCache, tagExpressionCache);
} catch (InvalidTaskException ite) {
exception = ite;
}
Expand All @@ -358,8 +360,8 @@ public Tag load(Pair<String, Long> stringLongPair) throws Exception {

TaskRejectedException taskRejectedException = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
expressionCache, errorCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, expressionCache, errorCache, tagExpressionCache);
} catch (TaskRejectedException e) {
taskRejectedException = e;
}
Expand All @@ -376,8 +378,8 @@ public Tag load(Pair<String, Long> stringLongPair) throws Exception {

taskRejectedException = null;
try {
worker = new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
expressionCache, errorCache, tagExpressionCache);
worker = new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, expressionCache, errorCache, tagExpressionCache);
} catch (TaskRejectedException e) {
taskRejectedException = e;
}
Expand Down Expand Up @@ -508,8 +510,8 @@ private ReferencedData saveItem(String string) throws DataStoreException {
}

private BoilerplateWorker createBoilerplateWorker(BoilerplateWorkerTask task) throws InvalidTaskException, TaskRejectedException {
return new BoilerplateWorker(task, dataStore, "results", connectionString, new JsonCodec(), 1000, "<boilerplate content>", null,
expressionCache, tagCache, tagExpressionCache);
return new BoilerplateWorker(task, workerTaskData, dataStore, "results", connectionString, new JsonCodec(), 1000,
"<boilerplate content>", null, expressionCache, tagCache, tagExpressionCache);
}

private Tag create(Tag tag) {
Expand Down