-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1043 from FoghostCn/native
Add native image integration test support
- Loading branch information
Showing
19 changed files
with
1,167 additions
and
25 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
2-advanced/dubbo-samples-native-image-registry/case-versions.conf
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,24 @@ | ||
# | ||
# | ||
# 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. | ||
# | ||
|
||
# Supported component versions of the test case | ||
|
||
# Spring app | ||
dubbo.version=3.3.* | ||
spring.version=6.* | ||
java.version= [ >= 17] |
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
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
47 changes: 47 additions & 0 deletions
47
...ve-image-registry-consumer/src/test/java/org/apache/dubbo/registry/DemoServiceTestIT.java
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,47 @@ | ||
/* | ||
* 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 org.apache.dubbo.registry; | ||
|
||
import org.apache.dubbo.config.ApplicationConfig; | ||
import org.apache.dubbo.config.ReferenceConfig; | ||
import org.apache.dubbo.config.RegistryConfig; | ||
import org.apache.dubbo.registry.consumer.NativeDemoConsumerRegistryApplication; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
|
||
/** | ||
* if not use SpringBootTest annotation you have to config proxy-config.json and serialization-config.json Manually | ||
*/ | ||
@SpringBootTest(classes = {NativeDemoConsumerRegistryApplication.class}) | ||
@ExtendWith(SpringExtension.class) | ||
class DemoServiceTestIT { | ||
private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1"); | ||
@Test | ||
public void sayHello() { | ||
ReferenceConfig<DemoService> reference = new ReferenceConfig<>(); | ||
reference.setApplication(new ApplicationConfig("first-dubbo-consumer")); | ||
reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181")); | ||
reference.setInterface(DemoService.class); | ||
DemoService service = reference.get(); | ||
HelloResponse message = service.sayHello(new HelloRequest("dubbo")); | ||
Assertions.assertEquals("dubbo", message.getResponse()); | ||
} | ||
|
||
} |
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
59 changes: 59 additions & 0 deletions
59
2-advanced/dubbo-samples-native-image-registry/native-case-configuration.yml
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,59 @@ | ||
# 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. | ||
|
||
timeout: 600 | ||
|
||
services: | ||
zookeeper: | ||
image: zookeeper:latest | ||
|
||
dubbo-samples-native-image-registry-provider: | ||
type: nativeApp | ||
basedir: dubbo-samples-native-image-registry-provider | ||
checkLog: "dubbo provider application started" | ||
checkPorts: | ||
- 50052 | ||
waitPortsBeforeRun: | ||
- zookeeper:2181 | ||
depends_on: | ||
- zookeeper | ||
systemProps: | ||
- zookeeper.address=zookeeper | ||
|
||
dubbo-samples-native-image-registry-consumer: | ||
type: nativeApp | ||
basedir: dubbo-samples-native-image-registry-consumer | ||
checkLog: "dubbo consumer application started" | ||
waitPortsBeforeRun: | ||
- zookeeper:2181 | ||
- dubbo-samples-native-image-registry-provider:50052 | ||
depends_on: | ||
- zookeeper | ||
systemProps: | ||
- zookeeper.address=zookeeper | ||
|
||
dubbo-samples-native-image-registry-test: | ||
type: nativeTest | ||
basedir: dubbo-samples-native-image-registry-consumer | ||
tests: | ||
- "**/*IT.class" | ||
depends_on: | ||
- zookeeper | ||
systemProps: | ||
- zookeeper.address=zookeeper | ||
waitPortsBeforeRun: | ||
- zookeeper:2181 | ||
- dubbo-samples-native-image-registry-provider:50052 |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Use mirror: | ||
# DEBIAN_MIRROR=http://mirrors.aliyun.com ./build-test-image.sh | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
$DIR/dubbo-test-runner/build-native.sh | ||
|
||
$DIR/build-nacos-image.sh |
Oops, something went wrong.