forked from apache/camel-k
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e05ff80
commit f027db3
Showing
17 changed files
with
668 additions
and
436 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import org.apache.camel.builder.RouteBuilder; | ||
|
||
public class Java extends RouteBuilder { | ||
@Override | ||
public void configure() throws Exception { | ||
from("timer:tick") | ||
.setHeader("m").constant("string!") | ||
.setBody().simple("Magic${header.m}") | ||
.log("${body}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
from('timer:groovy?period=1s') | ||
.routeId('groovy') | ||
.setHeader("m").constant("string!") | ||
.setBody() | ||
.simple('Magic${header.m}') | ||
.to('log:info?showAll=false') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more | ||
// contributor license agreements. See the NOTICE file distributed with | ||
// this work for additional information regarding copyright ownership. | ||
// The ASF licenses this file to You under the Apache License, Version 2.0 | ||
// (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
from('timer:js?period=1s') | ||
.routeId('js') | ||
.setHeader("m").constant("string!") | ||
.setBody() | ||
.simple('Magic${header.m}') | ||
.to('log:info') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
from("timer:kotlin?period=1s") | ||
.routeId("kotlin") | ||
.setHeader("m").constant("string!") | ||
.setBody() | ||
.simple("Magic\${header.m}") | ||
.to("log:info") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://camel.apache.org/schema/spring" | ||
xsi:schemaLocation=" | ||
http://camel.apache.org/schema/spring | ||
http://camel.apache.org/schema/spring/camel-spring.xsd"> | ||
|
||
<route id="hello"> | ||
<from uri="timer:hello?period=3s"/> | ||
<setHeader headerName="m"> | ||
<constant>string!</constant> | ||
</setHeader> | ||
<setBody> | ||
<simple>Magic${header.m}</simple> | ||
</setBody> | ||
<to uri="log:info"/> | ||
</route> | ||
|
||
</routes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// +build integration | ||
|
||
// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration" | ||
|
||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package e2e | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestBasicInstallation(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns).Execute()).Should(BeNil()) | ||
Eventually(operatorPod(ns)).ShouldNot(BeNil()) | ||
}) | ||
} | ||
|
||
func TestAlternativeImageInstallation(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns, "--operatorPod-image", "x/y:latest").Execute()).Should(BeNil()) | ||
Eventually(operatorImage(ns)).Should(Equal("x/y:latest")) | ||
}) | ||
} | ||
|
||
func TestKitJVMInstallation(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns, "--kit", "jvm").Execute()).Should(BeNil()) | ||
Eventually(build(ns, "jvm")).ShouldNot(BeNil()) | ||
}) | ||
} | ||
|
||
func TestMavenRepositoryInstallation(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns, "--maven-repository", "https://my.repo.org/public/").Execute()).Should(BeNil()) | ||
Eventually(configmap(ns, "camel-k-maven-settings")).Should(Not(BeNil())) | ||
Eventually(func()string { | ||
return configmap(ns, "camel-k-maven-settings")().Data["settings.xml"] | ||
}).Should(ContainSubstring("https://my.repo.org/public/")) | ||
}) | ||
} | ||
|
Oops, something went wrong.