-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[type: feature] replenish alibaba-dubbo syn method (#4931)
* replenish alibaba-dubbo syn method 01 * replenish alibaba-dubbo syn method 02 * replenish alibaba-dubbo syn method 03 * replenish alibaba-dubbo syn method 04 * replenish alibaba-dubbo syn method 05 * replenish alibaba-dubbo syn method 06 * replenish alibaba-dubbo syn method 07 * replenish alibaba-dubbo syn method 08 * replenish alibaba-dubbo syn method 09 * replenish alibaba-dubbo syn method 10 --------- Co-authored-by: dragon-zhang <[email protected]>
- Loading branch information
1 parent
3082629
commit 4271cb8
Showing
13 changed files
with
313 additions
and
27 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
...baba-dubbo/src/test/java/org/apache/shenyu/e2e/testcase/alibabadubbo/DataSynHttpTest.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,74 @@ | ||
/* | ||
* 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.shenyu.e2e.testcase.alibabadubbo; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.apache.shenyu.e2e.client.admin.AdminClient; | ||
import org.apache.shenyu.e2e.client.gateway.GatewayClient; | ||
import org.apache.shenyu.e2e.engine.annotation.ShenYuTest; | ||
import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure; | ||
import org.apache.shenyu.e2e.model.data.MetaData; | ||
import org.apache.shenyu.e2e.model.data.RuleCacheData; | ||
import org.apache.shenyu.e2e.model.data.SelectorCacheData; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Testing the correctness of Http data synchronization method. | ||
*/ | ||
@ShenYuTest( | ||
mode = ShenYuEngineConfigure.Mode.DOCKER, | ||
services = { | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "admin", | ||
port = 9095, | ||
baseUrl = "http://{hostname:localhost}:9095", | ||
parameters = { | ||
@ShenYuTest.Parameter(key = "username", value = "admin"), | ||
@ShenYuTest.Parameter(key = "password", value = "123456"), | ||
@ShenYuTest.Parameter(key = "dataSyn", value = "admin_http") | ||
} | ||
), | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "gateway", | ||
port = 9195, | ||
baseUrl = "http://{hostname:localhost}:9195", | ||
type = ShenYuEngineConfigure.ServiceType.SHENYU_GATEWAY, | ||
parameters = { | ||
@ShenYuTest.Parameter(key = "dataSyn", value = "gateway_http") | ||
} | ||
) | ||
}, | ||
dockerComposeFile = "classpath:./docker-compose.mysql.yml" | ||
) | ||
public class DataSynHttpTest { | ||
|
||
@Test | ||
void testDataSyn(final AdminClient adminClient, final GatewayClient gatewayClient) throws InterruptedException, JsonProcessingException { | ||
adminClient.login(); | ||
Thread.sleep(10000); | ||
List<MetaData> metaDataCacheList = gatewayClient.getMetaDataCache(); | ||
List<SelectorCacheData> selectorCacheList = gatewayClient.getSelectorCache(); | ||
List<RuleCacheData> ruleCacheList = gatewayClient.getRuleCache(); | ||
Assertions.assertEquals(1, selectorCacheList.size()); | ||
Assertions.assertEquals(25, metaDataCacheList.size()); | ||
Assertions.assertEquals(25, ruleCacheList.size()); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...aba-dubbo/src/test/java/org/apache/shenyu/e2e/testcase/alibabadubbo/DataSynNacosTest.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,75 @@ | ||
/* | ||
* 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.shenyu.e2e.testcase.alibabadubbo; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.apache.shenyu.e2e.client.admin.AdminClient; | ||
import org.apache.shenyu.e2e.client.gateway.GatewayClient; | ||
import org.apache.shenyu.e2e.engine.annotation.ShenYuTest; | ||
import org.apache.shenyu.e2e.engine.annotation.ShenYuTest.Parameter; | ||
import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure; | ||
import org.apache.shenyu.e2e.model.data.MetaData; | ||
import org.apache.shenyu.e2e.model.data.RuleCacheData; | ||
import org.apache.shenyu.e2e.model.data.SelectorCacheData; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Testing the correctness of Nacos data synchronization method. | ||
*/ | ||
@ShenYuTest( | ||
mode = ShenYuEngineConfigure.Mode.DOCKER, | ||
services = { | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "admin", | ||
port = 9095, | ||
baseUrl = "http://{hostname:localhost}:9095", | ||
parameters = { | ||
@Parameter(key = "username", value = "admin"), | ||
@Parameter(key = "password", value = "123456"), | ||
@Parameter(key = "dataSyn", value = "nacos") | ||
} | ||
), | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "gateway", | ||
port = 9195, | ||
baseUrl = "http://{hostname:localhost}:9195", | ||
type = ShenYuEngineConfigure.ServiceType.SHENYU_GATEWAY, | ||
parameters = { | ||
@Parameter(key = "dataSyn", value = "nacos") | ||
} | ||
) | ||
}, | ||
dockerComposeFile = "classpath:./docker-compose.mysql.yml" | ||
) | ||
public class DataSynNacosTest { | ||
|
||
@Test | ||
void testDataSyn(final AdminClient adminClient, final GatewayClient gatewayClient) throws InterruptedException, JsonProcessingException { | ||
adminClient.login(); | ||
Thread.sleep(10000); | ||
List<MetaData> metaDataCacheList = gatewayClient.getMetaDataCache(); | ||
List<SelectorCacheData> selectorCacheList = gatewayClient.getSelectorCache(); | ||
List<RuleCacheData> ruleCacheList = gatewayClient.getRuleCache(); | ||
Assertions.assertEquals(1, selectorCacheList.size()); | ||
Assertions.assertEquals(25, metaDataCacheList.size()); | ||
Assertions.assertEquals(25, ruleCacheList.size()); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...dubbo/src/test/java/org/apache/shenyu/e2e/testcase/alibabadubbo/DataSynZookeeperTest.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,75 @@ | ||
/* | ||
* 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.shenyu.e2e.testcase.alibabadubbo; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.apache.shenyu.e2e.client.admin.AdminClient; | ||
import org.apache.shenyu.e2e.client.gateway.GatewayClient; | ||
import org.apache.shenyu.e2e.engine.annotation.ShenYuTest; | ||
import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure; | ||
import org.apache.shenyu.e2e.model.data.MetaData; | ||
import org.apache.shenyu.e2e.model.data.RuleCacheData; | ||
import org.apache.shenyu.e2e.model.data.SelectorCacheData; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Testing the correctness of Apollo data synchronization method. | ||
*/ | ||
@ShenYuTest( | ||
mode = ShenYuEngineConfigure.Mode.DOCKER, | ||
services = { | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "admin", | ||
port = 9095, | ||
baseUrl = "http://{hostname:localhost}:9095", | ||
parameters = { | ||
@ShenYuTest.Parameter(key = "username", value = "admin"), | ||
@ShenYuTest.Parameter(key = "password", value = "123456"), | ||
@ShenYuTest.Parameter(key = "dataSyn", value = "zookeeper") | ||
} | ||
), | ||
@ShenYuTest.ServiceConfigure( | ||
serviceName = "gateway", | ||
port = 9195, | ||
baseUrl = "http://{hostname:localhost}:9195", | ||
type = ShenYuEngineConfigure.ServiceType.SHENYU_GATEWAY, | ||
parameters = { | ||
@ShenYuTest.Parameter(key = "dataSyn", value = "zookeeper") | ||
} | ||
) | ||
}, | ||
dockerComposeFile = "classpath:./docker-compose.mysql.yml" | ||
) | ||
public class DataSynZookeeperTest { | ||
|
||
@Test | ||
void testDataSyn(final AdminClient adminClient, final GatewayClient gatewayClient) throws InterruptedException, JsonProcessingException { | ||
adminClient.login(); | ||
Thread.sleep(10000); | ||
List<MetaData> metaDataCacheList = gatewayClient.getMetaDataCache(); | ||
List<SelectorCacheData> selectorCacheList = gatewayClient.getSelectorCache(); | ||
List<RuleCacheData> ruleCacheList = gatewayClient.getRuleCache(); | ||
Assertions.assertEquals(1, selectorCacheList.size()); | ||
Assertions.assertEquals(25, metaDataCacheList.size()); | ||
Assertions.assertEquals(25, ruleCacheList.size()); | ||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.