Skip to content

Commit

Permalink
Change some names from soul to shenyu (apache#1394) (apache#1441)
Browse files Browse the repository at this point in the history
Signed-off-by: sunlong <[email protected]>
  • Loading branch information
sunl888 authored May 12, 2021
1 parent da3c714 commit 2ab5aaf
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public QueueConsumerExecutor create() {

@Override
public String fixName() {
return "soul_register_client";
return "shenyu_register_client";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public class AlibabaDubboClientValidator implements Validator {
@SuppressWarnings({"unchecked", "rawtypes"})
public AlibabaDubboClientValidator(final URL url) {
this.clazz = ReflectUtils.forName(url.getServiceInterface());
String soulValidation = url.getParameter("soulValidation");
String shenyuValidation = url.getParameter("shenyuValidation");
ValidatorFactory factory;
if (soulValidation != null && soulValidation.length() > 0) {
factory = Validation.byProvider((Class) ReflectUtils.forName(soulValidation)).configure().buildValidatorFactory();
if (shenyuValidation != null && shenyuValidation.length() > 0) {
factory = Validation.byProvider((Class) ReflectUtils.forName(shenyuValidation)).configure().buildValidatorFactory();
} else {
factory = Validation.buildDefaultValidatorFactory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ public final class ApacheDubboClientValidatorTest {
public void validate() {
URL url = URL.valueOf("dubbo://127.0.0.1:20880/org.apache.shenyu"
+ ".client.apache.dubbo.validation.service.TestService"
+ "?accepts=500&anyhost=true&application=soul-proxy"
+ "?accepts=500&anyhost=true&application=shenyu-proxy"
+ "&bind.ip=127.0.0.1&bind.port=20880&deprecated=false"
+ "&dubbo=2.0.2&dynamic=true&generic=false"
+ "&interface=org.apache.shenyu.client.apache.dubbo.validation.service.TestService"
+ "&keep.alive=true&methods=test&pid=67352&qos.enable=false&release=2.7.0"
+ "&side=provider&threadpool=fixed&threads=500&timeout=20000"
+ "&timestamp=1608119259859&validation=soulValidation");
+ "&timestamp=1608119259859&validation=shenyuValidation");
Validator apacheDubboClientValidator = new ApacheDubboClientValidation().getValidator(url);
try {
apacheDubboClientValidator.validate("test",
Expand All @@ -84,7 +84,7 @@ public void testValidateWithNonExistMethod() throws Exception {

@Test
public void testValidateWithExistMethod() throws Exception {
final URL url = URL.valueOf(MOCK_SERVICE_URL + "?soulValidation=org.hibernate.validator.HibernateValidator");
final URL url = URL.valueOf(MOCK_SERVICE_URL + "?shenyuValidation=org.hibernate.validator.HibernateValidator");
ApacheDubboClientValidator apacheDubboClientValidator = new ApacheDubboClientValidator(url);
apacheDubboClientValidator
.validate("methodOne", new Class<?>[]{String.class}, new Object[]{"anything"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@Slf4j
public final class ShenyuThreadFactoryTest {

private static final String NAME_PREFIX = "soul##thread##";
private static final String NAME_PREFIX = "shenyu##thread##";

@Test
public void testCreate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ public void testToTreeMap() {
@Test
public void testConvertToMap() {
List<Integer> innerList = ImmutableList.of(1, 2, 3);
Map<String, Object> innerMap = ImmutableMap.of("id", 123, "name", "soul");
Map<String, Object> innerMap = ImmutableMap.of("id", 123, "name", "shenyu");
Map<String, Object> map = ImmutableMap.of("code", 200, "message", "test",
"data", innerMap, "list", innerList);

String testJson = "{\"code\":200,\"message\":\"test\","
+ "\"data\":{\"id\":123,\"name\":\"soul\"},\"list\":[1,2,3]}";
+ "\"data\":{\"id\":123,\"name\":\"shenyu\"},\"list\":[1,2,3]}";
Map<String, Object> parseMap = GsonUtils.getInstance().convertToMap(testJson);

map.forEach((key, value) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class PrometheusMetricsRegisterTest {
public void assertCounter() {
String requestTotal = "request_total";
String[] labelNames = new String[] {"name"};
prometheusMetricsRegister.registerCounter(requestTotal, labelNames, "soul request total count");
prometheusMetricsRegister.registerCounter(requestTotal, labelNames, "shenyu request total count");
prometheusMetricsRegister.counterIncrement(requestTotal, labelNames);
prometheusMetricsRegister.counterIncrement(requestTotal, labelNames, 2);
Map<String, Counter> counterMap = (Map<String, Counter>) ReflectUtils.getFieldValue(prometheusMetricsRegister, "COUNTER_MAP");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public void setUp() {
this.conditionDataList = Lists.newArrayListWithCapacity(2);
ConditionData matchConditionData = new ConditionData();
matchConditionData.setOperator("match");
matchConditionData.setParamName("soul");
matchConditionData.setParamName("shenyu");
matchConditionData.setParamType("uri");
matchConditionData.setParamValue("/http/**");
ConditionData eqConditionData = new ConditionData();
eqConditionData.setOperator("=");
eqConditionData.setParamName("soul");
eqConditionData.setParamName("shenyu");
eqConditionData.setParamType("uri");
eqConditionData.setParamValue("/http/test");
conditionDataList.add(matchConditionData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ public void setUp() {
this.conditionDataList = Lists.newArrayListWithCapacity(2);
ConditionData matchConditionData = new ConditionData();
matchConditionData.setOperator("match");
matchConditionData.setParamName("soul");
matchConditionData.setParamName("shenyu");
matchConditionData.setParamType("uri");
matchConditionData.setParamValue("/http/**");
ConditionData eqConditionData = new ConditionData();
eqConditionData.setOperator("=");
eqConditionData.setParamName("soul");
eqConditionData.setParamName("shenyu");
eqConditionData.setParamType("uri");
eqConditionData.setParamValue("/http/test");
conditionDataList.add(matchConditionData);
conditionDataList.add(eqConditionData);
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/soul")
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/shenyu")
.build());
matchStrategy = new OrMatchStrategy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public void setUp() {
this.pluginDataHandler = new PluginDataHandler() {
@Override
public String pluginNamed() {
return "SOUL";
return "SHENYU";
}
};
when(ruleData.getId()).thenReturn("SOUL");
when(pluginData.getId()).thenReturn("SOUL");
when(selectorData.getId()).thenReturn("SOUL");
when(ruleData.getId()).thenReturn("SHENYU");
when(pluginData.getId()).thenReturn("SHENYU");
when(selectorData.getId()).thenReturn("SHENYU");
}

/**
Expand Down Expand Up @@ -134,8 +134,8 @@ public void removeRuleTest() {
*/
@Test
public void pluginNamedTest() {
Assert.assertEquals("SOUL", pluginDataHandler.pluginNamed());
Assert.assertEquals("SOUL_TEST", testPluginDataHandler.pluginNamed());
Assert.assertEquals("SHENYU", pluginDataHandler.pluginNamed());
Assert.assertEquals("SHENYU_TEST", testPluginDataHandler.pluginNamed());
}

@Data
Expand Down Expand Up @@ -179,7 +179,7 @@ public void removeRule(final RuleData ruleData) {

@Override
public String pluginNamed() {
return "SOUL_TEST";
return "SHENYU_TEST";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public final class FallbackUtilsTest {
public void setUp() {
ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
SpringBeanUtils.getInstance().setCfgContext(context);
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/SOUL/SOUL")
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/SHENYU/SHENYU")
.remoteAddress(new InetSocketAddress(8090))
.contextPath("/SOUL")
.contextPath("/SHENYU")
.build());
when(context.getBean(ShenyuResult.class)).thenReturn(new DefaultShenyuResult());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void setUp() {
conditionData.setParamType("uri");
conditionData.setParamValue("/http/**");
conditionDatas.add(conditionData);
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/SOUL")
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/SHENYU")
.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public final class UriUtilsTest {

@Test
public void createUriTest() {
URI uri = UriUtils.createUri("/SOUL/TEST");
Assert.assertEquals(uri.getPath(), "/SOUL/TEST");
URI uri = UriUtils.createUri("/SHENYU/TEST");
Assert.assertEquals(uri.getPath(), "/SHENYU/TEST");
Assert.assertNull(UriUtils.createUri(""));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ private int getSize() {
}

/**
* Get soulServiceInstanceList.
* Get shenyuServiceInstanceList.
*
* @param contextPath contextPath
* @return SoulServiceInstanceLists instances
* @return ShenyuServiceInstanceLists instances
*/
public ShenyuServiceInstanceLists get(final String contextPath) {
try {
Expand All @@ -91,8 +91,8 @@ public void initPrx(final SelectorData selectorData) {
invalidate(selectorData.getName());
return;
}
ShenyuServiceInstanceLists soulServiceInstances = cache.get(selectorData.getName());
List<ShenyuServiceInstance> instances = soulServiceInstances.getShenyuServiceInstances();
ShenyuServiceInstanceLists shenyuServiceInstances = cache.get(selectorData.getName());
List<ShenyuServiceInstance> instances = shenyuServiceInstances.getShenyuServiceInstances();
instances.clear();
instances.addAll(upstreamList.stream().map(this::build).collect(Collectors.toList()));
Consumer<Object> consumer = listener.get(selectorData.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class GrpcClientBuilder {
* Build the client.
*
* @param contextPath contextPath
* @return SoulGrpcClient soulGrpcClient
* @return ShenyuGrpcClient shenyuGrpcClient
*/
public static ShenyuGrpcClient buildClient(final String contextPath) {
ManagedChannelBuilder<?> builder = ManagedChannelBuilder.forTarget(contextPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.shenyu.plugin.api.context.ShenyuContextDecorator;

/**
* The type Grpc soul context decorator.
* The type Grpc shenyu context decorator.
*/
public class GrpcShenyuContextDecorator implements ShenyuContextDecorator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private ShenyuGrpcReflectionClient(final Channel channel) {
* A new reflection client using the supplied channel.
*
* @param channel channel
* @return SoulGrpcReflectionClient client
* @return ShenyuGrpcReflectionClient client
*/
public static ShenyuGrpcReflectionClient create(final Channel channel) {
return new ShenyuGrpcReflectionClient(channel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static ApplicationConfigCache getInstance() {
public void init(final MotanRegisterConfig motanRegisterConfig) {
if (registryConfig == null) {
registryConfig = new RegistryConfig();
registryConfig.setId("soul_motan_proxy");
registryConfig.setId("shenyu_motan_proxy");
registryConfig.setRegister(false);
registryConfig.setRegProtocol("zookeeper");
registryConfig.setAddress(motanRegisterConfig.getRegister());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public static ApplicationConfigCache getInstance() {
public void init(final SofaRegisterConfig sofaRegisterConfig) {
if (applicationConfig == null) {
applicationConfig = new ApplicationConfig();
applicationConfig.setAppId("soul_proxy");
applicationConfig.setAppName("soul_proxy");
applicationConfig.setAppId("shenyu_proxy");
applicationConfig.setAppName("shenyu_proxy");
}
if (registryConfig == null) {
registryConfig = new RegistryConfig();
Expand Down

0 comments on commit 2ab5aaf

Please sign in to comment.