-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unittest rpc netty 20190125 (#305)
* release 0.1.1 (#178) * Remove redundant semicolons and modify non-standard names * remove duplicate RM init * issue #86 length of applicationData should be int * fix: fixed qualifier * Modify method description of DemoCode * Update ConfigurationKeys.java * config instance obtained by the factory class * fix typo of `retryable` as the annotation of Spring Retryable. add static code to init BranchStatus mapper to speed up get(int ordinal) * add template * add template * add template * fixes #117 * fixes #114 * fix issue #122 * update template * fix file.RenameTo->Files.move * #73 add travis config * fix #121 * #73 add travis config * fix #135 delete BranchSession main * fix #137 param position err * fix #142 delete defaultEventExecutorGroup * fix #142 delete defaultEventExecutorGroup (#144) * fix #139 netty heartbeat configurable * fixes #139 heartbeat configurable (#146) * fix #142 delete defaultEventExecutorGroup * fix #139 netty heartbeat configurable * FileTransactionStoreManager#closeFile() method remove redundant fileChannel.close() invoke (#140) * fix: When local branch change nothing, the RC will rise an NullpointerException (#155) * bugfix: when no record changed register localBranch will occur exception in TC * clean the environment * enhancement: when no changes in local branch let RC not throw an NullpointerException * change tabs to spaces * fix #150 use ServerBootstrap#childOption() to set SO_KEEPALIVE (#151) * FileTransactionStoreManager#closeFile() method remove redundant fileChannel.close() invoke * Netty SO_KEEPALIVE option not works on ServerBootstrap#option(), should replace with ServerBootstrap#childOption() * fix #149 (long)->Number.longValue * fix #149 (long)->Number.longValue (#156) * fix #142 delete defaultEventExecutorGroup * fix #139 netty heartbeat configurable * fix #149 (long)->Number.longValue * remove mistake twitter icon (#165) * Update README.md * Update README.md * issue #110 bug fix for RM channel management (#169) * issue #110 fix RM channel management * fix merge mistake * issue #110 enhance: if no channel found on my application set, try other application on the same resource. * bug fix and enhance * issue #110 enhance the original fix * fix: Unify `undo_log` table name variable (#174) * ShowSql might be better when debugging to execute the demo to observe the data. (#164) issues #158 * revert OrderServiceImpl * add toString method * add toString method * add toString method * add toString method * fix * 小优化-类型转换 * 类型转换小优化 * add unit test to TmRpcClient * fix conflicts * fix conflicts * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient * add unit test to TmRpcClient reconnect method * add unit test to RegisterTMResponse * add unit test * add unit test to TmRpcClient * add copyright * remove printf
- Loading branch information
1 parent
40ea4eb
commit f817d35
Showing
7 changed files
with
367 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core/src/test/java/com/alibaba/fescar/core/message/BranchRegisterResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alibaba.fescar.core.message; | ||
|
||
import com.alibaba.fescar.core.protocol.ResultCode; | ||
import com.alibaba.fescar.core.protocol.transaction.BranchRegisterResponse; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class BranchRegisterResponseTest { | ||
|
||
@Test | ||
public void toStringTest() throws Exception{ | ||
BranchRegisterResponse branchRegisterResponse = new BranchRegisterResponse(); | ||
|
||
branchRegisterResponse.setTransactionId(123456L); | ||
branchRegisterResponse.setBranchId(123457L); | ||
branchRegisterResponse.setResultCode(ResultCode.Success); | ||
branchRegisterResponse.setMsg(""); | ||
Assert.assertEquals("BranchRegisterResponse: transactionId=123456,branchId=123457,result code =Success,getMsg =", branchRegisterResponse.toString()); | ||
|
||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
core/src/test/java/com/alibaba/fescar/core/message/RegisterTMResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alibaba.fescar.core.message; | ||
|
||
import com.alibaba.fescar.core.protocol.RegisterTMResponse; | ||
import com.alibaba.fescar.core.protocol.ResultCode; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class RegisterTMResponseTest { | ||
|
||
@Test | ||
public void testToString() throws Exception{ | ||
RegisterTMResponse registerTMResponse = new RegisterTMResponse(); | ||
|
||
registerTMResponse.setVersion("1"); | ||
registerTMResponse.setIdentified(true); | ||
registerTMResponse.setResultCode(ResultCode.Success); | ||
|
||
Assert.assertEquals("version=1,extraData=null,identified=true,resultCode=Success,msg=null", registerTMResponse.toString()); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.