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
3 changes: 2 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
ignore = [
"**/cobertura.ser"
]

[words]
allow = [
"Verticle",
"verticle",
"VERTICLE",
]
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static KeyPairEntry generateALGKeyPair() {
PrivateKey privKey = keyPair.getPrivate();
return new KeyPairEntry(privKey, pubKey, encoder.encodeToString(pubKey.getEncoded()));
} catch (NoSuchAlgorithmException e) {
LOGGER.error("generate rsa keypair faild");
LOGGER.error("generate rsa keypair failed");
throw new IllegalStateException("perhaps error occurred on jre");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ private boolean servicesMatch(String services) {
return true;
}

return Arrays.stream(services.split(",")).anyMatch(ser -> {
String[] serviceAndVersion = ser.split(":");
return Arrays.stream(services.split(",")).anyMatch(service -> {
String[] serviceAndVersion = service.split(":");
if (serviceAndVersion.length == 1) {
return microserviceMeta.getName().equals(serviceAndVersion[0]);
} else if (serviceAndVersion.length == 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void test_should_pass_when_multiple_value() {
public void test_should_throw_exception_when_not_implements_interface() {
GovernanceRequest request = new GovernanceRequest();
try {
Matcher mockMatcher = generateMatcher("classNotImplments", "bill,bill2");
Matcher mockMatcher = generateMatcher("classNotImplements", "bill,bill2");
this.requestProcessor.match(request, mockMatcher);
Assertions.fail("an exception is expected!");
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void testRetryNoRouteToHostException() {

@Test
public void testRetryEqualTen() {
Exception target = new ConnectException("connectin refused");
Exception target = new ConnectException("connection refused");
for (int i = 0; i < 8; i++) {
target = new Exception("Level" + i, target);
}
Expand All @@ -145,7 +145,7 @@ public void testRetryEqualTen() {

@Test
public void testRetryOverTen() {
Exception target = new ConnectException("connectin refused");
Exception target = new ConnectException("connection refused");
for (int i = 0; i < 9; i++) {
target = new Exception("Level" + i, target);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.servicecomb.governance.marker.GovernanceRequest;

@Component
public class ClassNotImplments {
public class ClassNotImplements {
public boolean matchRequest(GovernanceRequest request, String parameters) {
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions governance/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ servicecomb:
rate: 1
demo-rateLimiting-servicename: |
rate: 1
wrongIngored: |
wrongIgnored: |
rate: 0
identifierRateLimiting:
demo-rateLimiting: |
Expand Down Expand Up @@ -131,15 +131,15 @@ servicecomb:
retry:
demo-retry: |
maxAttempts: 3
wrongIngored: |
wrongIgnored: |
maxAttempts: -1
circuitBreaker:
demo-circuitBreaker: |
minimumNumberOfCalls: 2
slidingWindowSize: 2
slidingWindowType: COUNT_BASED
services: myself:1.0,other
wrongIngored: |
wrongIgnored: |
rules:
match: demo-circuitBreaker.xx
minimumNumberOfCalls: -1
Expand All @@ -158,7 +158,7 @@ servicecomb:
maxConcurrentCalls: 1
maxWaitDuration: 3000
services: other:1.0
wrongIngored: |
wrongIgnored: |
rules:
match: demo-bulkhead.xx
maxWaitDuration: -1
Expand Down Expand Up @@ -191,7 +191,7 @@ servicecomb:
type: abort
percentage: 50
errorCode: 500
wrongIngored: |
wrongIgnored: |
delayTime: -1
type: ERROR
faultInjection2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import mockit.Mock;
import mockit.MockUp;

public class TestSessionSticknessRule {
public class TestSessionStickinessRule {
@Test
public void testServerWithoutTimeoutAndWithThreshold() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean enabled(String application, String serviceName) {
public List<EtcdDiscoveryInstance> findServiceInstances(String application, String serviceName) {

String prefixPath = basePath + "/" + application + "/" + serviceName;
watchMap.computeIfAbsent(prefixPath, serName -> {
watchMap.computeIfAbsent(prefixPath, listenServiceName -> {
Watch watchClient = client.getWatchClient();
try {
ByteSequence prefixByteSeq = ByteSequence.from(prefixPath, Charset.defaultCharset());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public LocalDiscoveryInstance(LocalOpenAPIRegistry localOpenAPIRegistry,
SwaggerGenerator generator = SwaggerGenerator.create(v);
OpenAPI openAPI = generator.generate();
if (openAPI == null) {
throw new IllegalStateException(String.format("Generate schema for %s/%s/%s faild.",
throw new IllegalStateException(String.format("Generate schema for %s/%s/%s failed.",
registryBean.getAppId(), registryBean.getServiceName(), k));
}
String schemaContent = SwaggerUtils.swaggerToString(openAPI);
if (StringUtils.isEmpty(schemaContent)) {
throw new IllegalStateException(String.format("Generate schema for %s/%s/%s faild.",
throw new IllegalStateException(String.format("Generate schema for %s/%s/%s failed.",
registryBean.getAppId(), registryBean.getServiceName(), k));
}
localOpenAPIRegistry.registerOpenAPI(registryBean.getAppId(), registryBean.getServiceName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void start(Promise<Void> startPromise) throws Exception {
SPIServiceUtils.getAllService(HttpServerExceptionHandler.class);
httpServer.exceptionHandler(e -> {
if (e instanceof ClosedChannelException) {
// This is quite normal in between browser and ege, so do not print out.
// This is quite normal in between browser and edge, so do not print out.
LOGGER.debug("Unexpected error in server.{}", ExceptionUtils.getExceptionMessageWithoutTrace(e));
} else {
LOGGER.error("Unexpected error in server.{}", ExceptionUtils.getExceptionMessageWithoutTrace(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ public void testRestServerVerticleWithRouter(@Mocked Transport transport, @Mocke
result = endpointObject;
}
};
Endpoint endpiont = new Endpoint(transport, "http://127.0.0.1:8080");
Endpoint endpoint = new Endpoint(transport, "http://127.0.0.1:8080");

new Expectations() {
{
context.config();
result = jsonObject;
jsonObject.getValue(AbstractTransport.ENDPOINT_KEY);
result = endpiont;
result = endpoint;
}
};
RestServerVerticle server = new RestServerVerticle();
Expand All @@ -228,14 +228,14 @@ public void testRestServerVerticleWithRouterSSL(@Mocked Transport transport, @Mo
result = endpointObject;
}
};
Endpoint endpiont = new Endpoint(transport, "http://127.0.0.1:8080?sslEnabled=true");
Endpoint endpoint = new Endpoint(transport, "http://127.0.0.1:8080?sslEnabled=true");

new Expectations() {
{
context.config();
result = jsonObject;
jsonObject.getValue(AbstractTransport.ENDPOINT_KEY);
result = endpiont;
result = endpoint;
}
};
RestServerVerticle server = new RestServerVerticle();
Expand Down
Loading