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
8 changes: 5 additions & 3 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
"vertx" = "vertx"

[files]
ignore = [
extend-exclude = [
"**/cobertura.ser"
]
[words]
allow = [
[default]
extend-ignore-words-re = [
"Verticle",
"verticle",
"VERTICLE",
"Prelease",
"cobertura",
"ser",
]
2 changes: 1 addition & 1 deletion core/src/test/resources/test/test/microservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
service_description:
name: default
version: 0.0.1
propertyExtentedClass: org.apache.servicecomb.serviceregistry.MicroServicePropertyExtendedStub
propertyExtendedClass: org.apache.servicecomb.serviceregistry.MicroServicePropertyExtendedStub
servicecomb:
service:
registry:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testRestTransport() throws Exception {
testHelloWorld();
testHelloWorldCanary();
testHelloWorldEmptyProtectionCloseWeight100();
testHelloWorldeEptyProtectionCloseWeightLess100();
testHelloWorldeEmptyProtectionCloseWeightLess100();
testHelloWorldEmptyProtectionCloseFallback();
testHelloWorldEmptyProtectionCloseWeight100Two();
}
Expand Down Expand Up @@ -142,7 +142,7 @@ private void testHelloWorldEmptyProtectionCloseWeight100() {
TestMgr.check(failCount == 20, true);
}

private void testHelloWorldeEptyProtectionCloseWeightLess100() {
private void testHelloWorldeEmptyProtectionCloseWeightLess100() {
int failCount = 0;
int succCount = 0;

Expand Down
4 changes: 2 additions & 2 deletions demo/demo-cse-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cse:
priority1: v1
```

* 服务级配置:consumerSer.yaml,微服务性选择consumer。类型为 yaml。
* 服务级配置:consumerService.yaml,微服务性选择consumer。类型为 yaml。
```yaml
cse:
v2:
Expand Down Expand Up @@ -115,7 +115,7 @@ cse:

* 执行 tests-client 里面的集成测试用例 (成功)
* 修改
* 服务级配置:consumerSer.yaml。
* 服务级配置:consumerService.yaml。
```yaml
cse:
v2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TestMgr {

private static String msg = "";

private static final AtomicLong checkes = new AtomicLong(0);
private static final AtomicLong checks = new AtomicLong(0);

public static void setMsg(String msg) {
TestMgr.msg = msg;
Expand All @@ -47,7 +47,7 @@ public static void check(Object expect, Object real) {
}

public static void check(Object expect, Object real, Throwable error) {
checkes.incrementAndGet();
checks.incrementAndGet();

if (expect == real) {
return;
Expand All @@ -66,7 +66,7 @@ public static void check(Object expect, Object real, Throwable error) {
}

public static void checkNotEmpty(String real) {
checkes.incrementAndGet();
checks.incrementAndGet();

if (StringUtils.isEmpty(real)) {
errorList.add(new Error(msg + " | unexpected null result, method is " + getCaller()));
Expand All @@ -78,7 +78,7 @@ public static void fail(String desc) {
}

public static void failed(String desc, Throwable e) {
checkes.incrementAndGet();
checks.incrementAndGet();

Error error = new Error(msg + " | " + desc + ", method is " + getCaller());
if (e != null) {
Expand All @@ -94,12 +94,12 @@ public static boolean isSuccess() {
public static void summary() {
if (errorList.isEmpty()) {
LOGGER.info("............. test finished ............");
LOGGER.info("............. total checks : " + checkes.get());
LOGGER.info("............. total checks : " + checks.get());
return;
}

LOGGER.info("............. test not finished ............");
LOGGER.info("............. total checks : " + checkes.get());
LOGGER.info("............. total checks : " + checks.get());
LOGGER.info("............. total errors : " + errorList.size());
LOGGER.info("............. error details: ");
for (Throwable e : errorList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class UploadDownloadSchemaTest implements CategorizedTestCase {
@Override
public void testRestTransport() throws Exception {
testEmptyFileUploadWork();
testNonEmptyFileUploadWorkd();
testNonEmptyFileUploadWork();
}

private void testNonEmptyFileUploadWorkd() throws Exception {
private void testNonEmptyFileUploadWork() throws Exception {
String file2Content = " bonjour";
File someFile = File.createTempFile("upload2", ".txt");
FileUtils.writeStringToFile(someFile, file2Content, StandardCharsets.UTF_8, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ private void testCodeFirstTestForm(RestOperations template, String cseUrlPrefix)
Map<String, String> map = new HashMap<>();
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
map.put("form1", code);
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
TestMgr.check(code + "null",
template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
map.put("form2", "hello");
TestMgr
.check(code + "hello", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
.check(code + "hello", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
}

private void testCodeFirstTestFormHighway(RestOperations template, String cseUrlPrefix) {
Expand All @@ -228,16 +228,16 @@ private void testCodeFirstTestFormHighway(RestOperations template, String cseUrl
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
map.put("form1", code);
map.put("form2", "");
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());

map = new HashMap<>();
code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
map.put("form1", code);
map.put("form2", null);
formEntiry = new HttpEntity<>(map, formHeaders);
formEntry = new HttpEntity<>(map, formHeaders);
TestMgr.check(code + "null",
template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
}

private void testCodeFirstTestFormRest(RestOperations template, String cseUrlPrefix) {
Expand All @@ -247,8 +247,8 @@ private void testCodeFirstTestFormRest(RestOperations template, String cseUrlPre
String code = "servicecomb%2bwelcome%40%23%24%25%5e%26*()%3d%3d";
map.put("form1", code);
map.put("form2", "");
HttpEntity<Map<String, String>> formEntiry = new HttpEntity<>(map, formHeaders);
HttpEntity<Map<String, String>> formEntry = new HttpEntity<>(map, formHeaders);
// Rest will have empty string, but users will try to avoid depend on this, This is different from highway
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntiry, String.class).getBody());
TestMgr.check(code + "", template.postForEntity(cseUrlPrefix + "/testform", formEntry, String.class).getBody());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public String addString(@RequestParam(name = "s") List<String> s) {
}

// Using 490, 590 error code, the response type should be CommonExceptionData. Or we need
// complex ExceptionConverters to deal with exceptions thrown by Hanlders, etc.
// complex ExceptionConverters to deal with exceptions thrown by Handlers, etc.
@RequestMapping(path = "/fallback/returnnull/{name}", method = RequestMethod.GET)
@ApiResponses(value = {@ApiResponse(responseCode = "200",
content = @Content(schema = @Schema(implementation = String.class)), description = "xxx"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* only checksum is validated to make sure schema is not changed.
*/
@RestSchema(schemaId = "CodeFirstSpringmvcForSchema")
@RequestMapping(path = "/forScheam")
@RequestMapping(path = "/forSchema")
public class CodeFirstSpringmvcForSchema {
/*
* Using http://editor.swagger.io/ . Listing errors not handled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ info:
title: swagger definition for org.apache.servicecomb.demo.springmvc.server.CodeFirstSpringmvcForSchema
version: 1.0.0
servers:
- url: /forScheam
- url: /forSchema
paths:
/uploadFile:
post:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ servicecomb:
matches:
- apiPath:
exact: "/governance/retry"
demo-retry-no-prefex: |
demo-retry-no-prefix: |
matches:
- apiPath:
exact: "/noPrefixRetry"
Expand Down Expand Up @@ -82,7 +82,7 @@ servicecomb:
maxAttempts: 3
## services is optional in configuration file
services: demo-zeroconfig-registry-client
demo-retry-no-prefex: |
demo-retry-no-prefix: |
maxAttempts: 3
## services is optional in configuration file
services: demo-zeroconfig-registry-client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public static <T> T parserObject(String yamlContent, Class<T> clazz) {
}

@SuppressWarnings("unchecked")
public static Map<String, Object> retrieveItems(String prefix, Map<String, Object> propertieMap) {
public static Map<String, Object> retrieveItems(String prefix, Map<String, Object> propertiesMap) {
Map<String, Object> result = new LinkedHashMap<>();
if (!prefix.isEmpty()) {
prefix += ".";
}

for (Map.Entry<String, Object> entry : propertieMap.entrySet()) {
for (Map.Entry<String, Object> entry : propertiesMap.entrySet()) {
if (entry.getValue() instanceof Map) {
result.putAll(retrieveItems(prefix + entry.getKey(), (Map<String, Object>) entry.getValue()));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ shutDownHandler:
enabled: true
timeLimit: 30000

hsa:
has:
manager:
url: 127.0.0.1
serializer:
Expand Down
73 changes: 37 additions & 36 deletions foundations/foundation-protobuf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class User {
// getter and setter
}
```
```java
RootSerializer serializer = protoMapper.createRootSerializer("User", User.class);

User user = new User();
Expand All @@ -63,6 +62,8 @@ byte[] pojoBytes= serializer.serialize(user);
Map<String, Object> map = new HashMap<>();
map.put("name", "userName");
byte[] mapBytes = serializer.serialize(map);
```java


// pojoBytes equals mapBytes
```
Expand Down Expand Up @@ -96,57 +97,57 @@ Map<String, Object> map = mapDeserializer.deserialize(bytes);

Empty:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 519 515 240 288 1242
ser len : 36 0 0 0 56
deser time(ms): 161 69 10 516 486
deser->ser len: 36 0 0 0 56
ser+deser(ms) : 680 584 250 804 1728
serialize time(ms) : 519 515 240 288 1242
serialize len : 36 0 0 0 56
deserialize time(ms): 161 69 10 516 486
deserialize->serialize len: 36 0 0 0 56
serialize+deserialize(ms) : 680 584 250 804 1728

Scalars:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 557 529 328 262 1357
ser len : 56 24 24 24 76
deser time(ms): 181 141 115 527 504
deser->ser len: 56 24 24 24 76
ser+deser(ms) : 738 670 443 789 1861
serialize time(ms) : 557 529 328 262 1357
serialize len : 56 24 24 24 76
deserialize time(ms): 181 141 115 527 504
deserialize->serialize len: 56 24 24 24 76
serialize+deserialize(ms) : 738 670 443 789 1861

Pojo:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 571 574 276 309 1304
ser len : 46 10 10 10 66
deser time(ms): 230 69 112 668 537
deser->ser len: 46 10 10 10 66
ser+deser(ms) : 801 643 388 977 1841
serialize time(ms) : 571 574 276 309 1304
serialize len : 46 10 10 10 66
deserialize time(ms): 230 69 112 668 537
deserialize->serialize len: 46 10 10 10 66
serialize+deserialize(ms) : 801 643 388 977 1841

SimpleList:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 590 609 296 637 1320
ser len : 68 32 32 32 88
deser time(ms): 233 105 122 2226 541
deser->ser len: 68 32 32 32 88
ser+deser(ms) : 823 714 418 2863 1861
serialize time(ms) : 590 609 296 637 1320
serialize len : 68 32 32 32 88
deserialize time(ms): 233 105 122 2226 541
deserialize->serialize len: 68 32 32 32 88
serialize+deserialize(ms) : 823 714 418 2863 1861

PojoList:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 609 632 319 2777 1407
ser len : 56 20 20 20 76
deser time(ms): 244 134 173 2287 679
deser->ser len: 56 20 20 20 76
ser+deser(ms) : 853 766 492 5064 2086
serialize time(ms) : 609 632 319 2777 1407
serialize len : 56 20 20 20 76
deserialize time(ms): 244 134 173 2287 679
deserialize->serialize len: 56 20 20 20 76
serialize+deserialize(ms) : 853 766 492 5064 2086

Map:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 746 772 491 1079 1298
ser len : 92 54 54 54 56
deser time(ms): 522 427 468 1031 422
deser->ser len: 92 54 54 54 56
ser+deser(ms) : 1268 1199 959 2110 1720
serialize time(ms) : 746 772 491 1079 1298
serialize len : 92 54 54 54 56
deserialize time(ms): 522 427 468 1031 422
deserialize->serialize len: 92 54 54 54 56
serialize+deserialize(ms) : 1268 1199 959 2110 1720

Mixed:
Protostuff ScbStrong ScbWeak Protobuf Jackson
ser time(ms) : 1686 1999 2034 2112 2537
ser len : 479 505 505 505 489
deser time(ms): 1969 2154 2923 2984 3316
deser->ser len: 479 505 505 505 489
ser+deser(ms) : 3655 4153 4957 5096 5853
serialize time(ms) : 1686 1999 2034 2112 2537
serialize len : 479 505 505 505 489
deserialize time(ms): 1969 2154 2923 2984 3316
deserialize->serialize len: 479 505 505 505 489
serialize+deserialize(ms) : 3655 4153 4957 5096 5853
```
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ContentFileReader implements FileReader {

private final String content;

private boolean contentReaded;
private boolean contentRead;

public ContentFileReader(FileReader importReader, String content) {
this.importReader = importReader;
Expand All @@ -35,8 +35,8 @@ public ContentFileReader(FileReader importReader, String content) {

@Override
public CharStream read(String contentOrName) {
if (!contentReaded) {
contentReaded = true;
if (!contentRead) {
contentRead = true;
return CharStreams.fromString(this.content);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void testTrue() throws Throwable {

// equalsIgnoreCase
doTestFromString("true");
doTestFromString("trUe");
doTestFromString("true");
}

@Test
Expand Down
Loading