Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public SchemaMeta registerSchema(String schemaId, Class<?> schemaInterface, Obje
}

// This is special requirement by users: When service deployed in tomcat,user want to use RestTemplate to
// call REST service by the full url. e.g. restTemplate.getForObejct("cse://serviceName/root/prefix/health")
// By default, user's do not need context prefix, e.g. restTemplate.getForObejct("cse://serviceName/health")
// call REST service by the full url. e.g. restTemplate.getForObject("cse://serviceName/root/prefix/health")
// By default, user's do not need context prefix, e.g. restTemplate.getForObject("cse://serviceName/health")
private void registerUrlPrefixToSwagger(OpenAPI swagger) {
String urlPrefix = ClassLoaderScopeContext.getClassLoaderScopeProperty(DefinitionConst.URL_PREFIX);
if (!StringUtils.isEmpty(urlPrefix) && !SwaggerUtils.getBasePath(swagger).startsWith(urlPrefix)
Expand Down
30 changes: 15 additions & 15 deletions core/src/test/java/org/apache/servicecomb/core/TestException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
public class TestException {
@Test
public void testCseException() {
CseException oExeception = new CseException("500", "InternalServerError");
Assertions.assertEquals("500", oExeception.getCode());
CseException oException = new CseException("500", "InternalServerError");
Assertions.assertEquals("500", oException.getCode());
Assertions.assertEquals("ServiceDefinitionException Code:500, Message:InternalServerError",
oExeception.toString());
oException.toString());

oExeception = new CseException("503", "OwnException", new Throwable());
Assertions.assertEquals("503", oExeception.getCode());
oException = new CseException("503", "OwnException", new Throwable());
Assertions.assertEquals("503", oException.getCode());
}

@Test
public void testExceptionUtils() {
CseException oExeception = ExceptionUtils
CseException oException = ExceptionUtils
.createCseException("servicecomb.handler.ref.not.exist", new String("test"));
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oExeception.getCode());
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oException.getCode());

oExeception =
oException =
ExceptionUtils.createCseException("servicecomb.handler.ref.not.exist", new Throwable(), new String("test"));
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oExeception.getCode());
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oException.getCode());

oExeception = ExceptionUtils.producerOperationNotExist("servicecomb.error", "unit-testing");
Assertions.assertEquals("servicecomb.producer.operation.not.exist", oExeception.getCode());
oException = ExceptionUtils.producerOperationNotExist("servicecomb.error", "unit-testing");
Assertions.assertEquals("servicecomb.producer.operation.not.exist", oException.getCode());

oExeception = ExceptionUtils.handlerRefNotExist("servicecomb.double.error");
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oExeception.getCode());
oException = ExceptionUtils.handlerRefNotExist("servicecomb.double.error");
Assertions.assertEquals("servicecomb.handler.ref.not.exist", oException.getCode());

oExeception = ExceptionUtils.lbAddressNotFound("microServiceName", "my rule my world", "transportChannel");
Assertions.assertEquals("servicecomb.lb.no.available.address", oExeception.getCode());
oException = ExceptionUtils.lbAddressNotFound("microServiceName", "my rule my world", "transportChannel");
Assertions.assertEquals("servicecomb.lb.no.available.address", oException.getCode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface ServiceCombConstants {

String DEFAULT_TRACING_COLLECTOR_ADDRESS = "http://127.0.0.1:9411";

String CONFIG_KEY_SPLITER = "_";
String CONFIG_KEY_SPLITTER = "_";

String CONFIG_FRAMEWORK_DEFAULT_NAME = "servicecomb-java-chassis";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static List<Resource> getSortedResources(String locationPattern, String s
return resList;
}

public static List<Resource> getSortedPorperties(String locationPattern) {
public static List<Resource> getSortedProperties(String locationPattern) {
return getSortedResources(locationPattern, PROPERTIES_SUFFIX);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public List<Resource> getFoundResList() {
public <T> T load() throws Exception {
Properties props = new Properties();
for (String locationPattern : locationPatternList) {
List<Resource> resList = PaaSResourceUtils.getSortedPorperties(locationPattern);
List<Resource> resList = PaaSResourceUtils.getSortedProperties(locationPattern);
foundResList.addAll(resList);
PaaSPropertiesLoaderUtils.fillAllProperties(props, resList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static IpPort parseIpPort(String scheme, String authority) {
/**
* 对于配置为0.0.0.0的地址,let it go
* schema, e.g. http
* adddress, e.g 0.0.0.0:8080
* address, e.g 0.0.0.0:8080
* return 实际监听的地址
*/
public static String getRealListenAddress(String schema, String address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ public void assertFileNotTooLong() {
Assertions.assertTrue(names.isEmpty());
}

private static void findLongFileName(File folder, List<String> holder, int baseLenght) {
private static void findLongFileName(File folder, List<String> holder, int baseLength) {
if (folder.isFile()) {
if (folder.getAbsolutePath().length() >= MAN_FILE_SIZE + baseLenght) {
if (folder.getAbsolutePath().length() >= MAN_FILE_SIZE + baseLength) {
holder.add(folder.getAbsolutePath());
}
} else if (folder.isDirectory() && !"target".equals(folder.getName())) {
File[] children = folder.listFiles();
for (File child : children) {
findLongFileName(child, holder, baseLenght);
findLongFileName(child, holder, baseLength);
}
} else {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static SSLServerSocket createSSLServerSocket(SSLOption option,
setClientAuth(option, socket);
return socket;
} catch (UnknownHostException e) {
throw new IllegalArgumentException("unkown host");
throw new IllegalArgumentException("unknown host");
} catch (IOException e) {
throw new IllegalArgumentException("unable create socket");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private void checkCNHost(X509Certificate[] chain, String ip) throws CertificateE
}
}
} catch (SocketException e) {
throw new CertificateException("Get local adrress fail.");
throw new CertificateException("Get local address fail.");
}
} else if (cnValid(cns, ipTmp)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void testSSLOptionYamlOption2() throws Exception {
}

@Test
public void testSSLOptionYamlOptionWithProperyFalse() throws Exception {
public void testSSLOptionYamlOptionWithPropertyFalse() throws Exception {
Mockito.when(environment.getProperty("ssl.authPeer")).thenReturn("false");

SSLOption option = SSLOption.build("server", environment);
Expand All @@ -225,7 +225,7 @@ public void testSSLOptionYamlOptionWithProperyFalse() throws Exception {
}

@Test
public void testSSLOptionYamlOptionWithProperyTrue() throws Exception {
public void testSSLOptionYamlOptionWithPropertyTrue() throws Exception {
SSLOption option = SSLOption.build("server", environment);

boolean authPeer = option.isAuthPeer();
Expand Down
Loading