Skip to content
Permalink
Browse files
Rewrite the English documentation
Signed-off-by: Xiaoyang Liu <siujoeng.lau@gmail.com>
  • Loading branch information
xiaoyang-sde committed May 24, 2022
1 parent ba55e57 commit 25aa848aacbc00c138429a2bc545439df9bd550e
Show file tree
Hide file tree
Showing 78 changed files with 7,347 additions and 2,419 deletions.
@@ -11,15 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.2.0
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"

- name: Fetch Documentation
- name: Install Dependencies
run: |
npm ci
npm run fetch
npm install
- name: Build
run: |
@@ -132,7 +132,3 @@ dist
.env.test.local
.env.production.local
tmp

# Docs
docs
i18n/zh/docusaurus-plugin-content-docs/current
@@ -1,28 +1 @@
# Apache EventMesh (Incubating) Site

This repository contains the source code of [eventmesh.apache.org](https://eventmesh.apache.org).

## Development Guide

- Clone the repository and install the dependencies with NPM (Make sure your Node.js version > 14)

```sh
npm install
```

- Pull the documentation from [apache/incubator-eventmesh/docs](https://github.com/apache/incubator-eventmesh/tree/master/docs)

```sh
npm run sync
```

- Build and start the website

```sh
npm run build
npm run serve
```

## Contact Us

Submit an [issue](https://github.com/apache/incubator-eventmesh/issues/new/choose) by using [INFRA] as title prefix.
# Apache EventMesh (Incubating) Website
@@ -1,4 +1,8 @@
# Apache 发布指南
# Release Creation Process

:::caution
The documentation of Release Creation Process is WIP (Work-in-Progress).
:::

## 理解 Apache 发布的内容和流程

@@ -605,8 +609,8 @@ On behalf of Apache EventMesh(Incubating) community
```
Hi all,
Thanks for reviewing and voting for Apache EventMesh(Incubating) version ${release_version} ${rc_version} release, I am happy to announce the release voting has passed with [投票结果数] binding votes, no +0 or -1 votes.
Thanks for reviewing and voting for Apache EventMesh(Incubating) version ${release_version} ${rc_version} release, I am happy to announce the release voting has passed with [投票结果数] binding votes, no +0 or -1 votes.
Binding votes are from IPMC
- xxx
- xxx
@@ -616,7 +620,7 @@ Hi all,
+1 xxx
+0 xxx
-1 xxx
The voting thread is:
• [投票结果链接]
@@ -0,0 +1,77 @@
# Unit Test Requirement

- Each unit test case should use assertions instead of `System.out` output or `if` statement
- Each unit test case shouldn't call other cases or depend on the order of execution.
- Each unit test case should be repeatable and not depend on the external environment because the test might be executed in the continuous integration.
- The scope of each unit test should be small enough to help locate the problem at the method level.

## Location and Naming Rules

- The unit test should be placed in `src/test/java`.
- The unit test configuration file should be placed in `src/test/resources`. For example:
- Class to be tested: `src/main/java/org/apache/eventmesh/common/protocol/http/body/BaseResponseBody.java`
- Unit test: `src/test/java/org/apache/eventmesh/common/protocol/http/body/BaseResponseBodyTest.java`
- Unit test configuration: `src/test/resources/configuration.properties`
- The package name of the unit test class should be identical to the class to be tested.
- The name of the unit test class should be `{class or interface to be tested}Test`. For example:
- Class to be tested: `EventMeshUtil`
- Unit test class: `EventMeshUtilTest`
- The name of each test case should be `test{method name}`. For example:
- Method to be tested: `addProp(String key, String val)`
- Unit test case: `testAddProp`

## Assertion Usage

### Common Assertion

| Methods | Instructions |
| :-------------- | :-------------- |
| `assertEquals` | Determines whether two objects or primitive types are equal |
| `assertNotEquals` | Determines whether two objects or primitive types are not equal |
| `assertTrue` | Determines whether the given Boolean value is `true` |
| `assertFalse` | Determines whether the given Boolean value is `false` |
| `assertNull` | Determines whether the given object reference is `null` |
| `assertNotNull` | Determines whether the given object reference is not `null` |
| `assertAll` | When multiple decision logic are processed together if only one error is reported, the whole test will fail |

### Example

#### `assertEquals()`

```java
configuration.init();
Assert.assertEquals("value1", configuration.eventMeshEnv);
```

#### `assertTrue()`

```java
BaseResponseHeader header = BaseResponseHeader.buildHeader("200");
Assert.assertTrue(header.toMap().containsKey(ProtocolKey.REQUEST_CODE));
```

#### `assertFalse()`

```java
Class<NacosRegistryService> nacosRegistryServiceClass = NacosRegistryService.class;
Field initStatus = nacosRegistryServiceClass.getDeclaredField("INIT_STATUS");
initStatus.setAccessible(true);
Object initStatusField = initStatus.get(nacosRegistryService);
Assert.assertFalse((Boolean.parseBoolean(initStatusField.toString())));
```

#### `assertNull()`

```java
DefaultFullHttpResponse response = httpCommand.httpResponse();
Assert.assertNull(response);
```

#### `assertNotNull()`

```java
Codec.Decoder cd = new Codec.Decoder();
ArrayList<Object> result = new ArrayList<>();
cd.decode(null, buf, result);
Assert.assertNotNull(result.get(0));
```
@@ -0,0 +1,5 @@
{
"position": 5,
"label": "Contribute",
"collapsed": false
}

0 comments on commit 25aa848

Please sign in to comment.