Skip to content

Commit dc86980

Browse files
author
wangqqqqq
committedJun 12, 2019
Modify testcase
1 parent 8c95742 commit dc86980

11 files changed

+26
-64
lines changed
 

‎.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
- checkout
1515
- run:
1616
name: multi_os_result
17-
command: echo "curl http://60.205.215.34/multi_os_result"
17+
command: echo "curl http://47.95.206.44:50080/multi_os_result"
1818
#
1919
# - run:
2020
# name: Daily Build Report
21-
# command: curl http://60.205.215.34/Daily_Build_Task_Report
21+
# command: curl http://47.95.206.44:50080/Daily_Build_Task_Report
2222
#
2323
# - run:
2424
# name: Download Links

‎DownloadLinks.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
PassFlag=`curl -s http://60.205.215.34/Daily_Build_Task_Report | grep "Failed: 0" | wc -c`
1+
PassFlag=`curl -s http://47.95.206.44:50080/Daily_Build_Task_Report | grep "Failed: 0" | wc -c`
22

33
if [ $PassFlag -eq 0 ]; then
44
echo "Daily Build Stest Fail"
55
echo "To view Daily Replay and Stress Test logs please visit website below on browsers"
6-
echo "--- http://60.205.215.34/latestReplayLog"
7-
echo "--- http://60.205.215.34/latestStressLog"
6+
echo "--- http://47.95.206.44:50080/latestReplayLog"
7+
echo "--- http://47.95.206.44:50080/latestStressLog"
88

99
else
1010
echo "Daily Build Stest Pass"
1111
echo "Build on `date +"%Y-%m-%d"` 3:00:00 (CST), UTC +8"
1212
echo "Please visit following website to download java-tron.jar on browsers"
13-
echo "--- http://60.205.215.34/Daily_Build/java-tron.jar"
13+
echo "--- http://47.95.206.44:50080/Daily_Build/jFava-tron.jar"
1414
echo "To view Daily Replay and Stress Test logs please visit website below on browsers"
15-
echo "--- http://60.205.215.34/latestReplayLog"
16-
echo "--- http://60.205.215.34/latestStressLog"
15+
echo "--- http://47.95.206.44:50080/latestReplayLog"
16+
echo "--- http://47.95.206.44:50080/latestStressLog"
1717
echo "The following compressed package is provided for user to set up Fullnode. Please use Linux OS to Download"
18-
echo "--- curl -# -O http://60.205.215.34/Daily_Build/java-tron.tar.gz"
18+
echo "--- curl -# -O http://47.95.206.44:50080/Daily_Build/java-tron.tar.gz"
1919
echo "To unzip file use the command below"
2020
echo "--- tar -xzvf java-tron.tar.gz"
2121
fi

‎src/test/java/stest/tron/wallet/account/WalletTestAccount013.java

+5-53
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public void test4DelegateResourceAboutTransferAsset() {
385385
}
386386

387387
@Test(enabled = true)
388-
public void test5DelegateResourceAboutTriggerContract() {
388+
public void test5CanNotDelegateResourceToContract() {
389389
//Create Account6
390390
ECKey ecKey6 = new ECKey(Utils.getRandom());
391391
accountForDeployAddress = ecKey6.getAddress();
@@ -411,61 +411,13 @@ public void test5DelegateResourceAboutTriggerContract() {
411411
maxFeeLimit, 0L, consumeUserResourcePercent, null, accountForDeployKey,
412412
accountForDeployAddress, blockingStubFull);
413413
PublicMethed.waitProduceNextBlock(blockingStubFull);
414-
//Account4 DelegatedResource of Energy to Contract
415-
Assert.assertTrue(PublicMethed.freezeBalanceForReceiver(
414+
415+
//After 3.6 can not delegate resource to contract
416+
Assert.assertFalse(PublicMethed.freezeBalanceForReceiver(
416417
account4DelegatedResourceAddress, freezeAmount, freezeDuration, 1,
417418
ByteString.copyFrom(contractAddress), account4DelegatedResourceKey, blockingStubFull));
418419

419-
//Account4 DelegatedResource Energy to deploy
420-
Assert.assertTrue(PublicMethed.freezeBalanceForReceiver(
421-
account4DelegatedResourceAddress, freezeAmount, freezeDuration, 1,
422-
ByteString.copyFrom(accountForDeployAddress),
423-
account4DelegatedResourceKey, blockingStubFull));
424-
425-
//get Energy of Account013,Account4,Contract before trigger contract
426-
final long account013CurrentEnergyUsed = PublicMethed.getAccountResource(
427-
account013Address, blockingStubFull).getEnergyUsed();
428-
final long account013CurrentBandwidthUsed = PublicMethed.getAccountResource(
429-
account013Address, blockingStubFull).getFreeNetUsed();
430-
final long account4CurrentEnergyUsed = PublicMethed.getAccountResource(
431-
account4DelegatedResourceAddress, blockingStubFull).getEnergyUsed();
432-
final long contractCurrentEnergyUsed = PublicMethed.getAccountResource(
433-
contractAddress, blockingStubFull).getEnergyUsed();
434-
final long deployCurrentEnergyUsed = PublicMethed.getAccountResource(
435-
accountForDeployAddress, blockingStubFull).getEnergyUsed();
436-
437-
//Account013 trigger contract
438-
String txid = PublicMethed.triggerContract(contractAddress,
439-
"add2(uint256)", "1", false,
440-
0, 1000000000L, "0", 0, account013Address, testKeyForAccount013, blockingStubFull);
441-
logger.info(txid);
442-
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
443-
logger.info(String.valueOf(infoById.get().getResultValue()));
444-
Assert.assertTrue(infoById.get().getResultValue() == 0);
445-
//get transaction info of Energy used and Bandwidth used
446-
final long contractTriggerEnergyUsed = infoById.get().getReceipt().getOriginEnergyUsage();
447-
final long contractTriggerBandwidthUsed = infoById.get().getReceipt().getNetUsage();
448-
449-
//get Energy of Account013,Account4,Contract after trigger contract
450-
final long account013CurrentEnergyUsedAfterTrig = PublicMethed.getAccountResource(
451-
account013Address, blockingStubFull).getEnergyUsed();
452-
final long account013CurrentBandwidthUsedAfterTrig = PublicMethed.getAccountResource(
453-
account013Address, blockingStubFull).getFreeNetUsed();
454-
final long account4CurrentEnergyUsedAfterTrig = PublicMethed.getAccountResource(
455-
account4DelegatedResourceAddress, blockingStubFull).getEnergyUsed();
456-
final long contractCurrentEnergyUsedAfterTrig = PublicMethed.getAccountResource(
457-
contractAddress, blockingStubFull).getEnergyUsed();
458-
final long deployCurrentEnergyUsedAfterTrig = PublicMethed.getAccountResource(
459-
accountForDeployAddress, blockingStubFull).getEnergyUsed();
460-
//compare energy changed
461-
Assert.assertTrue(account013CurrentEnergyUsed == account013CurrentEnergyUsedAfterTrig);
462-
Assert.assertTrue(account4CurrentEnergyUsed == account4CurrentEnergyUsedAfterTrig);
463-
Assert.assertTrue(contractCurrentEnergyUsed == contractCurrentEnergyUsedAfterTrig);
464-
Assert.assertTrue(deployCurrentEnergyUsed
465-
== deployCurrentEnergyUsedAfterTrig - contractTriggerEnergyUsed);
466-
//compare bandwidth of Account013 before and after trigger contract
467-
Assert.assertTrue(account013CurrentBandwidthUsed
468-
== account013CurrentBandwidthUsedAfterTrig - contractTriggerBandwidthUsed);
420+
469421
}
470422

471423
/**

‎src/test/java/stest/tron/wallet/contract/scenario/ContractScenario004.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,15 @@ public void deployErc20TronToken() {
8181
String code = retMap.get("byteCode").toString();
8282
String abi = retMap.get("abI").toString();
8383

84-
byte[] contractAddress;
8584
String txid = PublicMethed
8685
.deployContractAndGetTransactionInfoById(contractName, abi, code, "", maxFeeLimit,
8786
0L, 100, null, contract004Key, contract004Address, blockingStubFull);
87+
PublicMethed.waitProduceNextBlock(blockingStubFull);
8888
Optional<TransactionInfo> infoById = PublicMethed
8989
.getTransactionInfoById(txid, blockingStubFull);
9090
logger.info("Txid is " + txid);
9191
logger.info("Deploy energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
92+
byte[] contractAddress;
9293
contractAddress = infoById.get().getContractAddress().toByteArray();
9394

9495
SmartContract smartContract = PublicMethed.getContract(contractAddress, blockingStubFull);

‎src/test/java/stest/tron/wallet/contract/scenario/ContractScenario005.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ public void deployIcoContract() {
8484
String code = retMap.get("byteCode").toString();
8585
String abi = retMap.get("abI").toString();
8686

87-
byte[] contractAddress = null;
8887
String txid = PublicMethed
8988
.deployContractAndGetTransactionInfoById(contractName, abi, code, "", maxFeeLimit,
9089
0L, 100, null, contract005Key, contract005Address, blockingStubFull);
90+
PublicMethed.waitProduceNextBlock(blockingStubFull);
9191
Optional<TransactionInfo> infoById = PublicMethed
9292
.getTransactionInfoById(txid, blockingStubFull);
9393
logger.info("Txid is " + txid);
9494
logger.info("Deploy energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
95+
byte[] contractAddress = null;
9596
contractAddress = infoById.get().getContractAddress().toByteArray();
9697
SmartContract smartContract = PublicMethed.getContract(contractAddress, blockingStubFull);
9798

‎src/test/java/stest/tron/wallet/contract/scenario/ContractScenario006.java

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public void deployFomo3D() {
9595
String txid = PublicMethed
9696
.deployContractAndGetTransactionInfoById(contractName, abi, code, "", maxFeeLimit,
9797
0L, 100, null, contract006Key, contract006Address, blockingStubFull);
98+
PublicMethed.waitProduceNextBlock(blockingStubFull);
9899
Optional<TransactionInfo> infoById = PublicMethed
99100
.getTransactionInfoById(txid, blockingStubFull);
100101
contractAddress = infoById.get().getContractAddress().toByteArray();

‎src/test/java/stest/tron/wallet/contract/scenario/ContractScenario012.java

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public void test1DeployTransactionCoin() {
9999
String txid = PublicMethed
100100
.deployContractAndGetTransactionInfoById(contractName, abi, code, "", maxFeeLimit, 0L, 100,
101101
null, contract012Key, contract012Address, blockingStubFull);
102+
PublicMethed.waitProduceNextBlock(blockingStubFull);
102103
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
103104
logger.info("infobyid : --- " + infoById);
104105
Assert.assertTrue(infoById.get().getResultValue() == 0);

‎src/test/java/stest/tron/wallet/contract/scenario/ContractScenario013.java

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void deployTronTrxAndSunContract() {
8585
txid = PublicMethed.deployContractAndGetTransactionInfoById(contractName, abi, code, "",
8686
maxFeeLimit, 0L, 100, null, contract013Key, contract013Address, blockingStubFull);
8787
logger.info(txid);
88+
PublicMethed.waitProduceNextBlock(blockingStubFull);
8889
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
8990
logger.info("energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
9091
Assert.assertTrue(infoById.get().getResultValue() == 0);
@@ -112,6 +113,7 @@ public void triggerTronTrxAndSunContract() {
112113
String txid = PublicMethed
113114
.deployContractAndGetTransactionInfoById(contractName, abi, code, "", maxFeeLimit,
114115
0L, 100, null, contract013Key, contract013Address, blockingStubFull);
116+
PublicMethed.waitProduceNextBlock(blockingStubFull);
115117
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
116118
Assert.assertTrue(infoById.get().getResultValue() == 0);
117119
logger.info("energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());
@@ -122,6 +124,7 @@ public void triggerTronTrxAndSunContract() {
122124
"time()", "#", false,
123125
0, 100000000L, contract013Address, contract013Key, blockingStubFull);
124126
logger.info(txid);
127+
PublicMethed.waitProduceNextBlock(blockingStubFull);
125128
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
126129
logger.info("result is " + infoById.get().getResultValue());
127130
logger.info("energytotal is " + infoById.get().getReceipt().getEnergyUsageTotal());

‎src/test/java/stest/tron/wallet/dailybuild/manual/ContractScenario011.java

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public void deploySaleClockAuction() {
168168
.deployContractWithConstantParame(contractName, abi, code, "constructor(address,uint256)",
169169
data, "", maxFeeLimit, 0L, consumeUserResourcePercent, null, deployKey, deployAddress,
170170
blockingStubFull);
171+
PublicMethed.waitProduceNextBlock(blockingStubFull);
171172
Optional<TransactionInfo> info = PublicMethed
172173
.getTransactionInfoById(deplTxid, blockingStubFull);
173174
Assert.assertTrue(info.get().getResultValue() == 0);

‎src/test/java/stest/tron/wallet/dailybuild/manual/ContractScenario014.java

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public void testTripleTrigger() {
115115
txid = PublicMethed.deployContractWithConstantParame(contractName, abi1, code1,
116116
"constructor(address)", parame, "", maxFeeLimit, 0L, 100, null,
117117
contract014Key, contract014Address, blockingStubFull);
118+
PublicMethed.waitProduceNextBlock(blockingStubFull);
118119
infoById = PublicMethed.getTransactionInfoById(txid, blockingStubFull);
119120
Assert.assertTrue(infoById.get().getResultValue() == 0);
120121
contractAddress2 = infoById.get().getContractAddress().toByteArray();

‎src/test/java/stest/tron/wallet/mutisign/WalletTestMutiSign001.java

+1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ public void testMutiSign3ParticipateAssetissue() {
284284

285285
Assert.assertNotNull(txid);
286286

287+
PublicMethed.waitProduceNextBlock(blockingStubFull);
287288
infoById = PublicMethed
288289
.getTransactionInfoById(txid, blockingStubFull);
289290
balanceAfter = PublicMethed.queryAccount(participateAddress, blockingStubFull)

0 commit comments

Comments
 (0)
Please sign in to comment.