Skip to content

Commit

Permalink
Cache tests replaced and build process improved
Browse files Browse the repository at this point in the history
* NED-Dandelion 3.2.0
add new properties for caching, token and apiLiveTesting
add costume exceptions
add RestTemplateWithCaching and CacheOfRestTemplateResponse
process method divided into several new methods
add tests for LiveAPI, MockedAPI and Caching

* NED-Dandelion 3.2.1
removing old test approaches

* NED-Dandelion 3.2.2
rename property for global usage

* NED-AGDISTIS 4.2.0
split the process method in seperate testeble methods for future testing
add RestTemplateWithCache for API call
add cache property
add cache test

* NED-Babelfy 3.2.0
split the process method in seperate testeble methods for future testing
add RestTemplateWithCache for API call
add cache property
add cache test
add live test
add mocked test

* NER-ComicCharacterNameSimpleNamedEntityRecognizer 3.2.0
split the process method in seperate testeble methods for future testing
add live test
add mocked test

* NER-Dandelion 3.2.0
split the process method in seperate testeble methods for future testing
add live test
add mocked test
add cache test

* qanary-component-NER-DBpediaSpotlight 3.2.0
add tests
update the fetcher, using now restTemplate
split the process method in smaller methods

* qanary-component-NER-DBpediaSpotlight 3.2.1
some bug fixes

* NER-MeaningCloud 3.2.0
add live tests
add mocked tests
add cache tests
split process method in separate methods
changed api call to restTemplate (with cache)
remove default template
bugfix in insert query

* NED-Dandelion 3.2.3
change api.key property
some code clean up
add new solution for cache test

* NED-Babelfy 3.2.1
update cache test

* NER-Dandelion 3.2.1
update cache test

* NER-MeaningCloud 3.2.1
update cache test

* NER-TextRazor 3.2.0
split process method in separate methods
add exceptions
add new properties
using RestTemplate for api calls
add tests

* NED-Babelfy 3.2.2

update property names

* NER-Dandelion 3.2.2

update property names

* NER-Tagme 3.2.0

split process method in smaller methods
add properties
add tests

* QB-BirthDataWikidata 3.3.0

add tests

* QB-ComicCharacterAlterEgoSimpleDBpedia 3.320

add tests

* QBE-SimpleQueryBuilderAndExecutor 3.2.0

add tests

* QB-ComicCharacterAlterEgoSimpleDBpedia 3.2.0

add tests

* QBE-SimpleQueryBuilderAndExecutor 3.2.0

add tests

* NED-AGDISTIS 4.2.1

split process method in separate methods
add tests

* fix of components MeaningCloud and Babelfy

* fixed configuration

* NER-MeaningCloud
3.2.2

disable question 3

* ASR-Kaldi 3.1.6

remove warnings in pom

* CLS-CLSNLIOD 4.1.6

remove warnings in pom

* LD-Shuyo 4.1.6

remove warnings in pom

* NED-Ambiverse 3.1.5

remove warnings in pom

* NED-Dandelion 3.2.4

remove warnings in pom

* NED-DBpediaSpotlight 3.3.1

remove warnings in pom
move cache test to separate file
update cache test to the newest version

* NED-DiambiguationClass 3.1.4

remove warnings in pom

* NED-MeaningCloud 3.0.7

remove warnings in pom

* NED-Ontotext 3.0.4

remove warnings in pom
rename docker image to new standard
update build options

* NED-Opentapioca 3.2.2

remove warnings in pom

* NED-Tagme 3.1.6

remove warnings in pom

* NED-Watson 3.1.6

remove warnings in pom

* NER-Ambiverse 3.1.5

remove warnings in pom
update package name

* NED-Watson 3.1.7

rename package name

* NER-Ambiverse 3.1.6

undo rename package name

* NER-Aylien 3.1.3

remove warnings in pom
update path to main class

* NER-Babelfy 3.1.3

remove warnings in pom

* NER-ComicCharacterNameSimpleNamedEntityRecognizer 3.2.1

remove warnings in pom

* NER-Dandelion 3.2.3

remove warnings in pom

* NED-DBpediaSpotlight 3.3.2

update Test configuration

* NER-DBpediaSpotlight 3.2.2

remove warnings in pom
move cache test in seperate file
update cache test to the newest version
update path to main class

* NER-EntityClassifier 3.1.3

remove warnings in pom

* NER-EntityClassifier2 3.1.3

remove warnings in pom

* NER-Fox 3.1.3

remove warnings in pom

* NER-MeaningCloud 3.2.3

remove warnings in pom

* NER-Ontotext 3.1.3

remove warnings in pom

* NER-Stanford 3.1.6

remove warnings in pom

* NER-Tagme 3.2.1

remove warnings in pom
update path to main

* NER-TextRazor 3.2.2

remove warnings in pom

* NERD-Alchemy 3.1.3

remove warnings in pom

* NERD-LuceneLinker 3.1.6

remove warnings in pom

* NERD-SMAPH 3.1.4

remove warnings in pom

* QB-AnnotationOfSpotClass-OKBQA 3.1.3

remove warnings in pom

* QB-BirthDataWikidata 3.3.1

remove warnings in pom

* QB-ComicCharacterAlterEgoSimpleDBpedia 3.2.1

remove warnings in pom

* QB-GAnswerWrapper 3.1.5

remove warnings in pom
update path to main class
move cache test in separate file
update cache tes to the newest version

* QB-MonoliticWrapper 3.1.2

remove warnings in pom

* QB-PlatypusWrapper 3.1.5

remove warnings in pom
move cache test to separate file
update cache test to the newest version

* QB-QAnswer 3.1.4

remove warnings in pom

* QB-RuBQWrapper 3.1.5

remove warnings in pom
update path to main class
move cache test to separate file
update cache tes to the newest version

* QB-SimpleRealNameOfSuperHero 3.1.6

remove warnings in pom

* QB-Sina 3.2.4

remove warnings in pom

* QB-TeBaQAWrapper 3.1.7

remove warnings in pom
update path to main class
move cache test to separate file
update cache test to the newest version

* QBE-SimpleQueryBuilderAndExecutor 3.2.1

remove warnings in pom

* QC-AnswerTypeClassifier 3.1.2

remove warnings in pom

* QE-SparqlExecuter 3.1.8

remove warnings in pom

* QE-Wikidata 3.1.5

remove warnings in pom

* RD-AnnotaitonOfSpotProperty-OKBQA 3.1.2

remove warnings in pom

* RD-DiambiguationProperty-OKBQA 3.1.2

remove warnings in pom

* REL-RelNliod 3.1.3

remove warnings in pom

* mvn.reactor 0.1.2-SNAPSHOT

update pom format
add application-local.properties to gitignore

* NED-Babelfy 3.2.3

remove warnings in pom
move cache test in separate file
update cache test to the newest version

* NED-Babelfy 3.3.0

added new cache test

* NED-Babelfy 3.3.1

remove old cache test

* NED-AGDISTIS 4.4.0

add new cache test

* NED-Dandelion 3.4.0

add new cache test

* NED-DBpediaSpotlight 3.4.0

add new cache test

* NER-Dandelion 3.4.0

add new cache test

* NER-DBpediaSpotlight 3.4.0

add new cache test

* NER-MeaningCloud 3.4.0

add new cache test

* NER-Tagme 3.4.0

add new cache test

* NER-TextRazor 3.4.0

add new cache test

* QB-GAnswerWrapper 3.2.0

add new cache test

* QB-PlatypusWrapper 3.3.0

add new cache test

* QB-RuBQWrapper 3.2.0

add new cache test

* QB-TeBaQAWrapper 3.2.0

add new cache test

* TQA-ChatGPTWrapper 0.3.0

add new cache test

* QB-ComicCharacterAlterEgoSimpleDBpedia 3.2.2

bugfix in test

* QBE-SimpleQueryBuilderAndExecutor 3.2.2

bugfix in test

* QB-PlatypusWrapper 3.3.1

bugfix in imports

* QBE-QAnswer 3.2.3

remove warning in pom

* add GitHub secrets to auto deployment

---------

Co-authored-by: anbo-de <[email protected]>
Co-authored-by: Andreas Both <[email protected]>
  • Loading branch information
3 people committed Aug 16, 2023
1 parent 390abfa commit ff96f58
Show file tree
Hide file tree
Showing 116 changed files with 1,328 additions and 1,889 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
jobs:
build-java:
runs-on: ubuntu-latest
env:
BABELFY_API_KEY: ${{ secrets.BABELFY_API_KEY }}
CHATGPT_API_KEY: ${{ secrets.CHATGPT_API_KEY }}
DANDELION_API_KEY: ${{ secrets.DANDELION_API_KEY }}
MEANINGCLOUD_API_KEY: ${{ secrets.MEANINGCLOUD_API_KEY }}
TAGME_API_KEY: ${{ secrets.TAGME_API_KEY }}
TEXTRAZOR_API_KEY: ${{ secrets.TEXTRAZOR_API_KEY }}
steps:
- name: Configure java
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,5 @@ dmypy.json

.factorypath

# LOCAL PROPERTIES
# LOCAL APPLEICATION PROPERTIES
application-local.properties
7 changes: 2 additions & 5 deletions qanary-component-ASR-Kaldi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-ASR-Kaldi</artifactId>
<version>3.1.5</version>
<version>3.1.6</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>17</java.version>
Expand Down Expand Up @@ -100,10 +101,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- https://github.com/spotify/dockerfile-maven -->
<!-- build Docker image: mvn dockerfile:build -->
<plugin>
Expand Down
7 changes: 2 additions & 5 deletions qanary-component-CLS-CLSNLIOD/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-CLS-CLSNLIOD</artifactId>
<version>4.1.5</version>
<version>4.1.6</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>17</java.version>
Expand Down Expand Up @@ -101,10 +102,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- https://github.com/spotify/dockerfile-maven -->
<!-- build Docker image: mvn dockerfile:build -->
<plugin>
Expand Down
4 changes: 0 additions & 4 deletions qanary-component-LD-Shuyo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- https://github.com/spotify/dockerfile-maven -->
<!-- build Docker image: mvn dockerfile:build -->
<plugin>
Expand Down
15 changes: 11 additions & 4 deletions qanary-component-NED-AGDISTIS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>qanary-component-NED-AGDISTIS</artifactId>
<groupId>eu.wdaqua.qanary.component</groupId>
<version>4.3.1</version>
<version>4.4.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand All @@ -14,7 +14,8 @@
</parent>
<properties>
<java.version>17</java.version>
<qanary.version>[3.7.0,4.0.0)</qanary.version>
<qanary.component.version>[3.7.0,4.0.0)</qanary.component.version>
<qanary.commons.version>[3.8.0,4.0.0)</qanary.commons.version>
<docker.image.prefix>qanary</docker.image.prefix>
<docker.image.name>qanary-component-ned-agdistis</docker.image.name>
<dockerfile-maven-version>1.4.13</dockerfile-maven-version>
Expand All @@ -24,7 +25,14 @@
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.component</artifactId>
<version>${qanary.version}</version>
<version>${qanary.component.version}</version>
</dependency>
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.commons</artifactId>
<version>${qanary.commons.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -72,7 +80,6 @@
<artifactId>json-path-assert</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AgdistisTestConfiguration {
System.setProperty("question2", "What is the capital of <entity>Germany</entity>?");
System.setProperty("question3", "What is the real name of <entity>Batman</entity>?");

System.setProperty("qanary.webservicecalls.cache.specs", "maximumSize=1000,expireAfterAccess=" + AgdistisCacheTests.MAX_TIME_SPAN_SECONDS + "s");
System.setProperty("qanary.webservicecalls.cache.specs", "maximumSize=1000,expireAfterAccess=" + CacheTests.MAX_TIME_SPAN_SECONDS + "s");
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package eu.wdaqua.qanary.component.agdistis.ned;

import eu.wdaqua.qanary.communications.CacheOfRestTemplateResponse;
import eu.wdaqua.qanary.communications.RestTemplateWithCaching;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import qa.commons.QanaryCacheTest;

import java.net.URISyntaxException;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class CacheTests {
// time span for caching, tests wait this time span during the test runs
protected final static int MAX_TIME_SPAN_SECONDS = 5;
private static final Logger LOGGER = LoggerFactory.getLogger(CacheTests.class);

private final int testPort;
private final RestTemplateWithCaching myRestTemplate;
private final CacheOfRestTemplateResponse myCacheOfResponse;

CacheTests(
@Value(value = "${local.server.port}") int testPort, //
@Autowired RestTemplateWithCaching myRestTemplate, //
@Autowired CacheOfRestTemplateResponse myCacheOfResponse //
) {
this.testPort = testPort;
this.myRestTemplate = myRestTemplate;
this.myCacheOfResponse = myCacheOfResponse;
}

@BeforeEach
public void init() {
assert this.myRestTemplate != null : "restTemplate cannot be null";
}

/**
* @throws InterruptedException
* @throws URISyntaxException
*/
@Test
void givenRestTemplate_whenRequested_thenLogAndModifyResponse() {
QanaryCacheTest qanaryCacheTest = new QanaryCacheTest(
testPort,
MAX_TIME_SPAN_SECONDS,
myRestTemplate,
myCacheOfResponse
);

assertDoesNotThrow(
qanaryCacheTest::givenRestTemplate_whenRequested_thenLogAndModifyResponse
);
}

}
7 changes: 2 additions & 5 deletions qanary-component-NED-Ambiverse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-NED-Ambiverse</artifactId>
<version>3.1.4</version>
<version>3.1.5</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>17</java.version>
Expand Down Expand Up @@ -99,10 +100,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- https://github.com/spotify/dockerfile-maven -->
<!-- build Docker image: mvn dockerfile:build -->
<plugin>
Expand Down
18 changes: 11 additions & 7 deletions qanary-component-NED-Babelfy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>17</java.version>
<qanary.version>[3.7.0,4.0.0)</qanary.version>
<qanary.component.version>[3.7.0,4.0.0)</qanary.component.version>
<qanary.commons.version>[3.8.0,4.0.0)</qanary.commons.version>
<docker.image.prefix>qanary</docker.image.prefix>
<docker.image.name>qanary-component-ned-babelfy</docker.image.name>
<dockerfile-maven-version>1.4.13</dockerfile-maven-version>
Expand All @@ -23,7 +25,14 @@
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.component</artifactId>
<version>${qanary.version}</version>
<version>${qanary.component.version}</version>
</dependency>
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.commons</artifactId>
<version>${qanary.commons.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -82,7 +91,6 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand All @@ -104,10 +112,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- https://github.com/spotify/dockerfile-maven -->
<!-- build Docker image: mvn dockerfile:build -->
<plugin>
Expand Down
Loading

0 comments on commit ff96f58

Please sign in to comment.