Skip to content

Commit

Permalink
rename soul to shenyu in some files (apache#1394) (apache#1434)
Browse files Browse the repository at this point in the history
Co-authored-by: dengliming <[email protected]>
  • Loading branch information
songyuequan and dengliming authored May 11, 2021
1 parent 5ecb509 commit da3c714
Show file tree
Hide file tree
Showing 24 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion shenyu-bootstrap/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/>
<property name="LOG_HOME" value="${log.home:-.}"/>
<property name="LOG_APP_NAME" value="${log.app-name:-soul-bootstrap}"/>
<property name="LOG_APP_NAME" value="${log.app-name:-shenyu-bootstrap}"/>
<property name="MAX_SINGLE_LOG_FILE_SIZE" value="${log.max-single-log-file-size:-100MB}"/>
<property name="MAX_LOG_FILE_HISTORY" value="${log.max-log-file-history:-7}"/>
<property name="LOG_FILE_TOTAL_CAPACITY" value="${log.log-file-total-capacity:-10GB}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
* limitations under the License.
*/

soulValidation=org.apache.shenyu.client.alibaba.dubbo.validation.AlibabaDubboClientValidation
shenyuValidation=org.apache.shenyu.client.alibaba.dubbo.validation.AlibabaDubboClientValidation
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testItWithNonExistMethod() {

@Test
public void testItWithExistMethod() 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");
new AlibabaDubboClientValidation().getValidator(url)
.validate("method1", new Class<?>[]{String.class}, new Object[]{"anything"});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void init() {
}

@Test
public void testSoulBeanProcess() {
public void testShenyuBeanProcess() {
// config with full
SpringCloudClientBeanPostProcessor springCloudClientBeanPostProcessor = buildSpringCloudClientBeanPostProcessor(true);
assertThat(springCloudClientTestBean, equalTo(springCloudClientBeanPostProcessor.postProcessAfterInitialization(springCloudClientTestBean, "springCloudClientTestBean")));
Expand All @@ -80,7 +80,7 @@ public void testNormalBeanProcess() {
}

@Test
public void testWithSoulClientAnnotation() {
public void testWithShenyuClientAnnotation() {
try (MockedStatic mocked = mockStatic(RegisterUtils.class)) {
mocked.when(() -> RegisterUtils.doRegister(any(), any(), any()))
.thenAnswer((Answer<Void>) invocation -> null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ private void handler(final Object serviceBean) {
Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
String serviceName = serviceBean.getClass().getAnnotation(ShenyuTarsService.class).serviceName();
for (Method method : methods) {
ShenyuTarsClient soulSofaClient = method.getAnnotation(ShenyuTarsClient.class);
if (Objects.nonNull(soulSofaClient)) {
publisher.publishEvent(buildMetaDataDTO(serviceName, soulSofaClient, method, buildRpcExt(methods)));
ShenyuTarsClient shenyuSofaClient = method.getAnnotation(ShenyuTarsClient.class);
if (Objects.nonNull(shenyuSofaClient)) {
publisher.publishEvent(buildMetaDataDTO(serviceName, shenyuSofaClient, method, buildRpcExt(methods)));
}
}
}
Expand Down Expand Up @@ -162,8 +162,8 @@ private TarsRpcExt.RpcExt buildRpcExt(final Method method) {
private String buildRpcExt(final Method[] methods) {
List<TarsRpcExt.RpcExt> list = new ArrayList<>();
for (Method method : methods) {
ShenyuTarsClient soulSofaClient = method.getAnnotation(ShenyuTarsClient.class);
if (Objects.nonNull(soulSofaClient)) {
ShenyuTarsClient shenyuSofaClient = method.getAnnotation(ShenyuTarsClient.class);
if (Objects.nonNull(shenyuSofaClient)) {
list.add(buildRpcExt(method));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void init() {
public void testPostProcessAfterInitialization() {
TarsDemoService serviceFactoryBean = new TarsDemoService();
tarsServiceBeanPostProcessor
.postProcessAfterInitialization(serviceFactoryBean, "SoulTarsTest");
.postProcessAfterInitialization(serviceFactoryBean, "ShenyuTarsTest");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class ZkPathConstants implements Constants {
*/
public static final String SELECTOR_JOIN_RULE = "-";

private static final String PRE_FIX = "/soul";
private static final String PRE_FIX = "/shenyu";

/**
* The constant PLUGIN_PARENT.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
*/
public final class ZkPathConstantsTest {

private static final String APP_AUTH_PARENT = "/soul/auth";
private static final String APP_AUTH_PARENT = "/shenyu/auth";

private static final String META_DATA_PARENT = "/soul/metaData";
private static final String META_DATA_PARENT = "/shenyu/metaData";

private static final String PLUGIN_PARENT = "/soul/plugin";
private static final String PLUGIN_PARENT = "/shenyu/plugin";

private static final String SELECTOR_PARENT = "/soul/selector";
private static final String SELECTOR_PARENT = "/shenyu/selector";

private static final String RULE_PARENT = "/soul/rule";
private static final String RULE_PARENT = "/shenyu/rule";

private static final String SELECTOR_JOIN_RULE = "-";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public DisruptorProviderManage(final QueueConsumerFactory<T> consumerFactory,
this.consumerSize = consumerSize;
this.executor = new ThreadPoolExecutor(consumerSize, consumerSize, 0, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(),
DisruptorThreadFactory.create("soul_disruptor_consumer_", false), new ThreadPoolExecutor.AbortPolicy());
DisruptorThreadFactory.create("shenyu_disruptor_consumer_", false), new ThreadPoolExecutor.AbortPolicy());
}

/**
Expand All @@ -102,7 +102,7 @@ public DisruptorProviderManage(final QueueConsumerFactory<T> consumerFactory,
public void startup() {
Disruptor<DataEvent<T>> disruptor = new Disruptor<>(new DisruptorEventFactory<>(),
size,
DisruptorThreadFactory.create("soul_disruptor_provider_" + consumerFactory.fixName(), false),
DisruptorThreadFactory.create("shenyu_disruptor_provider_" + consumerFactory.fixName(), false),
ProducerType.MULTI,
new BlockingWaitStrategy());
QueueConsumer<T>[] consumers = new QueueConsumer[consumerSize];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class DisruptorThreadFactory implements ThreadFactory {

private static final AtomicLong THREAD_NUMBER = new AtomicLong(1);

private static final ThreadGroup THREAD_GROUP = new ThreadGroup("soul-disruptor");
private static final ThreadGroup THREAD_GROUP = new ThreadGroup("shenyu-disruptor");

private final boolean daemon;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class AbstractShenyuPlugin implements ShenyuPlugin {

/**
* Process the Web request and (optionally) delegate to the next
* {@code SoulPlugin} through the given {@link ShenyuPluginChain}.
* {@code ShenyuPlugin} through the given {@link ShenyuPluginChain}.
*
* @param exchange the current server exchange
* @param chain provides a way to delegate to the next plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class AbstractShenyuPluginTest {

private ServerWebExchange exchange;

private TestShenyuPlugin testSoulPlugin;
private TestShenyuPlugin testShenyuPlugin;

private ShenyuPluginChain shenyuPluginChain;

Expand All @@ -68,11 +68,11 @@ public void setUp() {
this.conditionData.setParamType("uri");
this.conditionData.setParamValue("/http/**");
this.shenyuPluginChain = mock(ShenyuPluginChain.class);
this.pluginData = PluginData.builder().name("SOUL").enabled(true).build();
this.selectorData = SelectorData.builder().id("1").pluginName("SOUL")
this.pluginData = PluginData.builder().name("SHENYU").enabled(true).build();
this.selectorData = SelectorData.builder().id("1").pluginName("SHENYU")
.enabled(true).type(SelectorTypeEnum.CUSTOM_FLOW.getCode()).build();
this.testSoulPlugin = new TestShenyuPlugin();
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/SOUL/SOUL")
this.testShenyuPlugin = new TestShenyuPlugin();
this.exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/http/SHENYU/SHENYU")
.build());
when(shenyuPluginChain.execute(exchange)).thenReturn(Mono.empty());
}
Expand All @@ -82,7 +82,7 @@ public void setUp() {
*/
@Test
public void executePluginIsNullTest() {
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

/**
Expand All @@ -91,7 +91,7 @@ public void executePluginIsNullTest() {
@Test
public void executeSelectorIsNullTest() {
BaseDataCache.getInstance().cachePluginData(pluginData);
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

/**
Expand All @@ -101,7 +101,7 @@ public void executeSelectorIsNullTest() {
public void executeSelectorDataIsNullTest() {
BaseDataCache.getInstance().cachePluginData(pluginData);
BaseDataCache.getInstance().cacheSelectData(selectorData);
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

/**
Expand All @@ -115,7 +115,7 @@ public void executeRuleIsNullTest() {
this.selectorData.setConditionList(conditionDataList);
BaseDataCache.getInstance().cachePluginData(pluginData);
BaseDataCache.getInstance().cacheSelectData(selectorData);
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

/**
Expand All @@ -132,7 +132,7 @@ public void executeRuleIsNotNullTest() {
BaseDataCache.getInstance().cachePluginData(pluginData);
BaseDataCache.getInstance().cacheSelectData(selectorData);
BaseDataCache.getInstance().cacheRuleData(ruleData);
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

/**
Expand All @@ -150,7 +150,7 @@ public void executeRuleFullTest() {
BaseDataCache.getInstance().cachePluginData(pluginData);
BaseDataCache.getInstance().cacheSelectData(selectorData);
BaseDataCache.getInstance().cacheRuleData(ruleData);
StepVerifier.create(testSoulPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
StepVerifier.create(testShenyuPlugin.execute(exchange, shenyuPluginChain)).expectSubscription().verifyComplete();
}

static class TestShenyuPlugin extends AbstractShenyuPlugin {
Expand All @@ -167,7 +167,7 @@ public int getOrder() {

@Override
public String named() {
return "SOUL";
return "SHENYU";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public void setup() {
this.exchange.getAttributes().put(Constants.CONTEXT, shenyuContext);
when(chain.execute(exchange)).thenReturn(Mono.empty());
ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
final DefaultShenyuResult soulResult = new DefaultShenyuResult();
when(context.getBean(ShenyuResult.class)).thenReturn(soulResult);
final DefaultShenyuResult shenhyuResult = new DefaultShenyuResult();
when(context.getBean(ShenyuResult.class)).thenReturn(shenhyuResult);
SpringBeanUtils.getInstance().setCfgContext(context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public final class UpstreamCacheManager extends BaseHandleCache<String, DivideRu


/**
* suggest soul.upstream.scheduledTime set 1 SECONDS.
* suggest shenyu.upstream.scheduledTime set 1 SECONDS.
*/
private UpstreamCacheManager() {
boolean check = Boolean.parseBoolean(System.getProperty("soul.upstream.check", "false"));
boolean check = Boolean.parseBoolean(System.getProperty("shenyu.upstream.check", "false"));
if (check) {
new ScheduledThreadPoolExecutor(1, ShenyuThreadFactory.create("scheduled-upstream-task", false))
.scheduleWithFixedDelay(this::scheduled,
30, Integer.parseInt(System.getProperty("soul.upstream.scheduledTime", "30")), TimeUnit.SECONDS);
30, Integer.parseInt(System.getProperty("shenyu.upstream.scheduledTime", "30")), TimeUnit.SECONDS);
}
}

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 Divide soul context decorator.
* The type Divide shenyu context decorator.
*/
public class DivideShenyuContextDecorator implements ShenyuContextDecorator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private static class ShenyuWebSocketHandler implements WebSocketHandler {
private final List<String> subProtocols;

/**
* Instantiates a new Soul web socket handler.
* Instantiates a new shenyu web socket handler.
*
* @param url the url
* @param client the client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
@Slf4j
public class DefaultSignService implements SignService {

@Value("${soul.sign.delay:5}")
@Value("${shenyu.sign.delay:5}")
private int delay;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public void testPersistInterface() {
.build();

repository.persistInterface(data);
String metadataPath = "/soul/register/metadata/http/context/context-ruleName";
String metadataPath = "/shenyu/register/metadata/http/context/context-ruleName";
assert etcdBroker.containsKey(metadataPath);
assert etcdBroker.get(metadataPath).equals(GsonUtils.getInstance().toJson(data));

String uriPath = "/soul/register/uri/http/context/host:80";
String uriPath = "/shenyu/register/uri/http/context/host:80";
assert etcdBroker.containsKey(uriPath);
assert etcdBroker.get(uriPath).equals(GsonUtils.getInstance().toJson(data));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class OkHttpToolsTest {

private String url;

private final String json = "{\"appName\":\"soul\"}";
private final String json = "{\"appName\":\"shenyu\"}";

@Before
public void setUpWireMock() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void setUp() {
};

json = gson.toJson(jsonMap);
url = "http://localhost:9095/soul-client/dubbo-register";
url = "http://localhost:9095/shenyu-client/dubbo-register";
}

@SneakyThrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public void testPersistInterface() {

repository.persistInterface(data);

String uriInstancePath = "soul.register.service.http";
String uriInstancePath = "shenyu.register.service.http";
assert nacosBroker.containsKey(uriInstancePath);
Instance instance = (Instance) nacosBroker.get(uriInstancePath);
assert instance.getPort() == data.getPort();
assert instance.getIp().equals(data.getHost());
Map<String, String> metadataMap = instance.getMetadata();
assert metadataMap.get("uriMetadata").equals(GsonUtils.getInstance().toJson(URIRegisterDTO.transForm(data)));

String configPath = "soul.register.service.http.context";
String configPath = "shenyu.register.service.http.context";
assert nacosBroker.containsKey(configPath);
String dataStr = GsonUtils.getInstance().toJson(data);
assert nacosBroker.get(configPath).equals(GsonUtils.getInstance().toJson(Collections.singletonList(dataStr)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public void testPersistInterface() {
.build();

repository.persistInterface(data);
String metadataPath = "/soul/register/metadata/http/context/context-ruleName";
String metadataPath = "/shenyu/register/metadata/http/context/context-ruleName";
assert zookeeperBroker.containsKey(metadataPath);
assert zookeeperBroker.get(metadataPath).equals(GsonUtils.getInstance().toJson(data));

String uriPath = "/soul/register/uri/http/context/host:80";
String uriPath = "/shenyu/register/uri/http/context/host:80";
assert zookeeperBroker.containsKey(uriPath);
assert zookeeperBroker.get(uriPath).equals(GsonUtils.getInstance().toJson(URIRegisterDTO.transForm(data)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class RegisterPathConstants {
/**
* root path of zookeeper register center.
*/
public static final String ROOT_PATH = "/soul/register";
public static final String ROOT_PATH = "/shenyu/register";

/**
* constants of separator.
Expand Down
Loading

0 comments on commit da3c714

Please sign in to comment.