Skip to content

Commit 3d252eb

Browse files
authored
Update to camel3
1 parent a74722f commit 3d252eb

File tree

19 files changed

+190
-173
lines changed

19 files changed

+190
-173
lines changed

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ cache:
1818
- $HOME/.gradle/caches/
1919
- $HOME/.gradle/wrapper/
2020

21+
branches:
22+
only:
23+
- master
24+
# release tags
25+
- /^camel-ldp-recipes-\d+\.\d+\.\d+$/
26+
# maintenance branches
27+
- /^camel-ldp-recipes-\d+\.\d+\.x$/
28+
# long-lived branches
29+
- /branch-.+/
30+
2131
stages:
2232
- test
2333
- deploy

build.gradle

+12-9
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,30 @@ ext {
1313

1414
/* Dependencies */
1515
marmottaVersion = '3.4.0'
16-
camelVersion = '2.23.1'
17-
camelLdpVersion = '0.1.1'
18-
jenaVersion = '3.10.0'
19-
javaxAnnotationsVersion = '1.3.2'
20-
javaxInjectVersion = '2.5.0-b62'
16+
camelVersion = '3.0.0'
17+
camelLdpVersion = '0.2.0'
18+
jenaVersion = '3.13.1'
2119
slf4jVersion = '1.7.26'
2220

21+
/* JavaEE */
22+
activationApiVersion = '1.2.1'
23+
annotationApiVersion = '1.3.5'
24+
jaxbApiVersion = '2.3.2'
25+
injectApiVersion = '1.0'
26+
2327
/* Testing */
24-
activationApiVersion = '1.2.0'
2528
apiguardianVersion = '1.0.0'
2629
checkstyleVersion = '8.18'
27-
jaxbVersion = '2.3.0'
2830
jacocoVersion = '0.8.3'
31+
jaxbRuntimeVersion = '2.3.2'
2932
junitPlatformVersion = '1.4.1'
3033
junitVersion = '5.4.1'
3134
logbackVersion = '1.2.3'
3235
mockitoVersion = '2.25.1'
3336

3437
/* OSGi */
35-
camelVersionRange = "[2.22,3)"
36-
jenaVersionRange = "[3.8.0,4)"
38+
camelVersionRange = "[3.0,4)"
39+
jenaVersionRange = "[3.13,4)"
3740
karafVersion = '4.2.4'
3841
osgiVersion = '6.0.0'
3942
osgiCompendiumVersion = '5.0.0'

elasticsearch/build.gradle

+15-10
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ ext {
88
}
99

1010
dependencies {
11-
api("org.apache.camel:camel-core:$camelVersion")
11+
api enforcedPlatform("org.apache.camel:camel-bom:$camelVersion")
1212

13-
implementation("org.apache.camel:camel-blueprint:$camelVersion")
14-
implementation("org.apache.camel:camel-http4:$camelVersion")
15-
implementation("org.apache.camel:camel-jackson:$camelVersion")
16-
implementation("org.slf4j:slf4j-api:$slf4jVersion")
17-
implementation("org.trellisldp:camel-ldp:$camelLdpVersion")
13+
api "org.apache.camel:camel-api"
1814

19-
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")
20-
testImplementation("javax.activation:javax.activation-api:$activationApiVersion")
21-
testImplementation("javax.xml.bind:jaxb-api:$jaxbVersion")
22-
testImplementation("org.apache.camel:camel-test-blueprint:$camelVersion")
15+
implementation "org.apache.camel:camel-direct"
16+
implementation "org.apache.camel:camel-seda"
17+
implementation "org.apache.camel:camel-blueprint"
18+
implementation "org.apache.camel:camel-http"
19+
implementation "org.apache.camel:camel-jackson"
20+
implementation "org.slf4j:slf4j-api:$slf4jVersion"
21+
implementation "org.trellisldp:camel-ldp:$camelLdpVersion"
22+
23+
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
24+
testImplementation "jakarta.activation:jakarta.activation-api:$activationApiVersion"
25+
testImplementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion"
26+
testImplementation "org.apache.camel:camel-test-blueprint"
27+
testImplementation "org.glassfish.jaxb:jaxb-runtime:$jaxbRuntimeVersion"
2328
}
2429

2530
publishing.publications {

elasticsearch/src/main/java/org/trellisldp/ext/elasticsearch/ElasticsearchRouter.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import static org.apache.camel.Exchange.HTTP_URI;
2121
import static org.apache.camel.LoggingLevel.INFO;
2222
import static org.apache.camel.builder.PredicateBuilder.and;
23-
import static org.apache.camel.component.http4.HttpMethods.DELETE;
24-
import static org.apache.camel.component.http4.HttpMethods.GET;
25-
import static org.apache.camel.component.http4.HttpMethods.PUT;
23+
import static org.apache.camel.component.http.HttpMethods.DELETE;
24+
import static org.apache.camel.component.http.HttpMethods.GET;
25+
import static org.apache.camel.component.http.HttpMethods.PUT;
2626
import static org.apache.camel.model.dataformat.JsonLibrary.Jackson;
2727
import static org.slf4j.LoggerFactory.getLogger;
2828
import static org.trellisldp.camel.ActivityStreamProcessor.ACTIVITY_STREAM_OBJECT_ID;
@@ -38,7 +38,7 @@
3838
public class ElasticsearchRouter extends RouteBuilder {
3939

4040
private static final Logger LOGGER = getLogger(ElasticsearchRouter.class);
41-
private static final String HTTP_ENDPOINT = "http4://localhost?useSystemProperties=true";
41+
private static final String HTTP_ENDPOINT = "http://localhost?useSystemProperties=true";
4242
private static final String CAMEL_HTTP_HEADERS = "CamelHttp*";
4343

4444
@Override

elasticsearch/src/test/java/org/trellisldp/ext/elasticsearch/ElasticsearchRouterTest.java

+18-30
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
import static org.apache.camel.Exchange.HTTP_METHOD;
1818
import static org.apache.camel.Exchange.HTTP_QUERY;
1919
import static org.apache.camel.Exchange.HTTP_URI;
20-
import static org.apache.camel.component.http4.HttpMethods.DELETE;
21-
import static org.apache.camel.component.http4.HttpMethods.GET;
22-
import static org.apache.camel.component.http4.HttpMethods.PUT;
20+
import static org.apache.camel.component.http.HttpMethods.DELETE;
21+
import static org.apache.camel.component.http.HttpMethods.GET;
22+
import static org.apache.camel.component.http.HttpMethods.PUT;
2323
import static org.apache.camel.util.ObjectHelper.loadResourceAsStream;
2424

2525
import java.util.Properties;
@@ -67,23 +67,17 @@ protected Properties useOverridePropertiesWithPropertiesComponent() {
6767

6868
@Test
6969
public void testUpdate() throws Exception {
70-
context.getRouteDefinition("TrellisLdpathFormatter").adviceWith(context, new AdviceWithRouteBuilder() {
71-
@Override
72-
public void configure() throws Exception {
73-
mockEndpointsAndSkip("http*");
74-
}
70+
AdviceWithRouteBuilder.adviceWith(context, "TrellisLdpathFormatter", builder -> {
71+
builder.mockEndpointsAndSkip("http*");
7572
});
76-
context.getRouteDefinition("TrellisElasticsearchUpdater").adviceWith(context, new AdviceWithRouteBuilder() {
77-
@Override
78-
public void configure() throws Exception {
79-
weaveAddLast().to("mock:results");
80-
mockEndpointsAndSkip("http*");
81-
}
73+
AdviceWithRouteBuilder.adviceWith(context, "TrellisElasticsearchUpdater", builder -> {
74+
builder.weaveAddLast().to("mock:results");
75+
builder.mockEndpointsAndSkip("http*");
8276
});
8377
context.start();
8478

85-
getMockEndpoint("mock:http4:localhost").expectedMessageCount(2);
86-
getMockEndpoint("mock:http4:localhost").expectedHeaderValuesReceivedInAnyOrder(
79+
getMockEndpoint("mock:http:localhost").expectedMessageCount(2);
80+
getMockEndpoint("mock:http:localhost").expectedHeaderValuesReceivedInAnyOrder(
8781
HTTP_METHOD, GET, PUT);
8882

8983
resultEndpoint.expectedMessageCount(1);
@@ -99,13 +93,10 @@ public void configure() throws Exception {
9993

10094
@Test
10195
public void testFetch() throws Exception {
102-
context.getRouteDefinition("TrellisLdpathFormatter").adviceWith(context, new AdviceWithRouteBuilder() {
103-
@Override
104-
public void configure() throws Exception {
105-
mockEndpointsAndSkip("http*");
106-
mockEndpointsAndSkip("direct:update.elasticsearch");
107-
weaveAddLast().to("mock:results");
108-
}
96+
AdviceWithRouteBuilder.adviceWith(context, "TrellisLdpathFormatter", builder -> {
97+
builder.mockEndpointsAndSkip("http*");
98+
builder.mockEndpointsAndSkip("direct:update.elasticsearch");
99+
builder.weaveAddLast().to("mock:results");
109100
});
110101
context.start();
111102

@@ -123,16 +114,13 @@ public void configure() throws Exception {
123114

124115
@Test
125116
public void testDelete() throws Exception {
126-
context.getRouteDefinition("TrellisElasticsearchDeleter").adviceWith(context, new AdviceWithRouteBuilder() {
127-
@Override
128-
public void configure() throws Exception {
129-
weaveAddLast().to("mock:results");
130-
mockEndpointsAndSkip("http*");
131-
}
117+
AdviceWithRouteBuilder.adviceWith(context, "TrellisElasticsearchDeleter", builder -> {
118+
builder.weaveAddLast().to("mock:results");
119+
builder.mockEndpointsAndSkip("http*");
132120
});
133121
context.start();
134122

135-
getMockEndpoint("mock:http4:localhost").expectedMessageCount(1);
123+
getMockEndpoint("mock:http:localhost").expectedMessageCount(1);
136124

137125
resultEndpoint.expectedMessageCount(1);
138126
resultEndpoint.expectedHeaderReceived(HTTP_URI,

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = 0.1.1-SNAPSHOT
1+
version = 0.2.0-SNAPSHOT

karaf/src/main/resources/features.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<feature version="${camelVersionRange}">camel</feature>
88
<feature version="${camelVersionRange}">camel-blueprint</feature>
9-
<feature version="${camelVersionRange}">camel-http4</feature>
9+
<feature version="${camelVersionRange}">camel-http</feature>
1010
<feature version="${camelVersionRange}">camel-jackson</feature>
1111

1212
<bundle dependency="true">mvn:org.trellisldp/camel-ldp/${camelLdpVersion}</bundle>
@@ -20,7 +20,7 @@
2020

2121
<feature version="${camelVersionRange}">camel</feature>
2222
<feature version="${camelVersionRange}">camel-blueprint</feature>
23-
<feature version="${camelVersionRange}">camel-http4</feature>
23+
<feature version="${camelVersionRange}">camel-http</feature>
2424
<feature version="${camelVersionRange}">camel-jackson</feature>
2525

2626
<bundle dependency="true">mvn:org.trellisldp/camel-ldp/${camelLdpVersion}</bundle>
@@ -34,11 +34,11 @@
3434

3535
<feature version="${camelVersionRange}">camel</feature>
3636
<feature version="${camelVersionRange}">camel-blueprint</feature>
37-
<feature version="${camelVersionRange}">camel-http4</feature>
37+
<feature version="${camelVersionRange}">camel-http</feature>
3838
<feature version="${camelVersionRange}">camel-jackson</feature>
3939
<feature version="${jenaVersionRange}">jena</feature>
4040

41-
<bundle dependency="true">mvn:javax.annotation/javax.annotation-api/${javaxAnnotationsVersion}</bundle>
41+
<bundle dependency="true">mvn:jakarta.annotation/jakarta.annotation-api/${annotationApiVersion}</bundle>
4242
<bundle dependency="true">mvn:org.trellisldp/camel-ldp/${camelLdpVersion}</bundle>
4343

4444
<bundle>mvn:org.trellisldp.ext/camel-ldp-triplestore/${project.version}</bundle>
@@ -51,8 +51,8 @@
5151
<feature prerequisite="true">wrap</feature>
5252
<feature version="${camelVersionRange}">camel</feature>
5353
<feature version="${camelVersionRange}">camel-blueprint</feature>
54-
<feature version="${camelVersionRange}">camel-jetty9</feature>
55-
<feature version="${camelVersionRange}">camel-http4</feature>
54+
<feature version="${camelVersionRange}">camel-jetty</feature>
55+
<feature version="${camelVersionRange}">camel-http</feature>
5656
<feature version="${camelVersionRange}">camel-jackson</feature>
5757

5858
<!-- Marmotta dependencies -->

ldpath/build.gradle

+24-20
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,32 @@ ext {
88
}
99

1010
dependencies {
11-
api("org.apache.camel:camel-core:$camelVersion")
11+
api enforcedPlatform("org.apache.camel:camel-bom:$camelVersion")
1212

13-
implementation("org.apache.camel:camel-blueprint:$camelVersion")
14-
implementation("org.apache.camel:camel-http4:$camelVersion")
15-
implementation("org.apache.camel:camel-jackson:$camelVersion")
16-
implementation("org.apache.camel:camel-jetty9:$camelVersion")
17-
implementation("org.apache.marmotta:ldcache-api:$marmottaVersion")
18-
implementation("org.apache.marmotta:ldcache-backend-file:$marmottaVersion")
19-
implementation("org.apache.marmotta:ldcache-core:$marmottaVersion")
20-
implementation("org.apache.marmotta:ldclient-provider-xml:$marmottaVersion")
21-
implementation("org.apache.marmotta:ldclient-provider-rdf:$marmottaVersion")
22-
implementation("org.apache.marmotta:ldclient-core:$marmottaVersion")
23-
implementation("org.apache.marmotta:ldpath-api:$marmottaVersion")
24-
implementation("org.apache.marmotta:ldpath-backend-linkeddata:$marmottaVersion")
25-
implementation("org.apache.marmotta:ldpath-core:$marmottaVersion")
26-
implementation("org.slf4j:slf4j-api:$slf4jVersion")
13+
api "org.apache.camel:camel-api"
2714

28-
testImplementation("javax.activation:javax.activation-api:$activationApiVersion")
29-
testImplementation("javax.xml.bind:jaxb-api:$jaxbVersion")
30-
testImplementation("org.apache.camel:camel-test-blueprint:$camelVersion")
31-
testImplementation("org.mockito:mockito-core:$mockitoVersion")
32-
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")
15+
implementation "org.apache.camel:camel-blueprint"
16+
implementation "org.apache.camel:camel-direct"
17+
implementation "org.apache.camel:camel-http"
18+
implementation "org.apache.camel:camel-jackson"
19+
implementation "org.apache.camel:camel-jetty"
20+
implementation "org.apache.marmotta:ldcache-api:$marmottaVersion"
21+
implementation "org.apache.marmotta:ldcache-backend-file:$marmottaVersion"
22+
implementation "org.apache.marmotta:ldcache-core:$marmottaVersion"
23+
implementation "org.apache.marmotta:ldclient-provider-xml:$marmottaVersion"
24+
implementation "org.apache.marmotta:ldclient-provider-rdf:$marmottaVersion"
25+
implementation "org.apache.marmotta:ldclient-core:$marmottaVersion"
26+
implementation "org.apache.marmotta:ldpath-api:$marmottaVersion"
27+
implementation "org.apache.marmotta:ldpath-backend-linkeddata:$marmottaVersion"
28+
implementation "org.apache.marmotta:ldpath-core:$marmottaVersion"
29+
implementation "org.slf4j:slf4j-api:$slf4jVersion"
30+
31+
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
32+
testImplementation "jakarta.activation:jakarta.activation-api:$activationApiVersion"
33+
testImplementation "jakarta.xml.bind:jakarta.xml.bind-api:$jaxbApiVersion"
34+
testImplementation "org.apache.camel:camel-test-blueprint"
35+
testImplementation "org.glassfish.jaxb:jaxb-runtime:$jaxbRuntimeVersion"
36+
testImplementation "org.mockito:mockito-core:$mockitoVersion"
3337
}
3438

3539
publishing.publications {

ldpath/src/main/java/org/trellisldp/ext/ldpath/LDPathRouter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void configure() throws Exception {
5252
.when(header("program").regex("^https?://.*"))
5353
.removeHeaders("CamelHttp*")
5454
.setHeader(HTTP_URI).header("program")
55-
.to("http4://localhost?useSystemProperties=true")
55+
.to("http://localhost?useSystemProperties=true")
5656
.to(PARSE_ROUTE)
5757
.otherwise()
5858
.to("{{ldpath.defaultProgram}}")

ldpath/src/test/java/org/trellisldp/ext/ldpath/LDPathRouterTest.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ protected Properties useOverridePropertiesWithPropertiesComponent() {
6969

7070
@Test
7171
public void testQuery() throws Exception {
72-
context.getRouteDefinition("TrellisLDPathQuery").adviceWith(context, new AdviceWithRouteBuilder() {
73-
@Override
74-
public void configure() throws Exception {
75-
weaveAddLast().to("mock:results");
76-
}
72+
AdviceWithRouteBuilder.adviceWith(context, "TrellisLDPathQuery", builder -> {
73+
builder.weaveAddLast().to("mock:results");
7774
});
7875
context.start();
7976

osgi/build.gradle

+17-15
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,27 @@ sonarqube {
3030
}
3131

3232
dependencies {
33-
testCompile("ch.qos.logback:logback-classic:$logbackVersion")
34-
testCompile("org.apache.karaf.features:standard:$karafVersion")
35-
testCompile("org.apache.karaf.features:org.apache.karaf.features.core:$karafVersion")
36-
testCompile("org.ops4j.pax.exam:pax-exam:$paxExamVersion")
37-
testCompile("org.ops4j.pax.exam:pax-exam-junit4:$paxExamVersion")
38-
testCompile("org.ops4j.pax.exam:pax-exam-container-karaf:$paxExamVersion")
39-
testCompile("org.osgi:org.osgi.core:$osgiVersion")
40-
testCompile("org.osgi:org.osgi.compendium:$osgiCompendiumVersion")
41-
testCompile("org.mockito:mockito-core:$mockitoVersion")
42-
testCompile("org.glassfish.hk2.external:javax.inject:$javaxInjectVersion")
43-
testCompile project(':camel-ldp-websub')
44-
testCompile project(':camel-ldp-triplestore')
45-
testCompile project(':camel-ldp-ldpath')
46-
testCompile project(':camel-ldp-elasticsearch')
33+
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
34+
testImplementation "org.apache.karaf.features:standard:$karafVersion"
35+
testImplementation "org.apache.karaf.features:org.apache.karaf.features.core:$karafVersion"
36+
testImplementation "org.ops4j.pax.exam:pax-exam:$paxExamVersion"
37+
testImplementation "org.ops4j.pax.exam:pax-exam-junit4:$paxExamVersion"
38+
testImplementation "org.ops4j.pax.exam:pax-exam-container-karaf:$paxExamVersion"
39+
testImplementation "org.osgi:org.osgi.core:$osgiVersion"
40+
testImplementation "org.osgi:org.osgi.compendium:$osgiCompendiumVersion"
41+
testImplementation "org.mockito:mockito-core:$mockitoVersion"
42+
testImplementation "org.glassfish.hk2.external:javax.inject:2.5.0-b62"
43+
44+
testImplementation project(':camel-ldp-websub')
45+
testImplementation project(':camel-ldp-triplestore')
46+
testImplementation project(':camel-ldp-ldpath')
47+
testImplementation project(':camel-ldp-elasticsearch')
48+
4749
testCompile project(':camel-ldp-karaf')
4850

4951
testCompile group: 'org.apache.karaf.features', name: 'standard', version: karafVersion, classifier:'features', ext: 'xml'
5052

51-
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVersion}")
53+
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junitVersion"
5254

5355
karafDistro group: 'org.apache.karaf', name: 'apache-karaf', version: karafVersion, ext: 'zip'
5456
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE configuration>
3+
<configuration>
4+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
5+
<encoder>
6+
<pattern>%p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<logger name="org.trellisldp" additivity="false" level="INFO">
11+
<appender-ref ref="STDOUT"/>
12+
</logger>
13+
<logger name="org.apache.camel" additivity="false" level="INFO">
14+
<appender-ref ref="STDOUT"/>
15+
</logger>
16+
<root additivity="false" level="WARN">
17+
<appender-ref ref="STDOUT"/>
18+
</root>
19+
</configuration>

0 commit comments

Comments
 (0)