Skip to content

Commit 7dca9cd

Browse files
author
wangqqqqq
committed
Change test case description
1 parent 2e7f73a commit 7dca9cd

14 files changed

Lines changed: 87 additions & 204 deletions

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/addressStrictCheck/AddressStrictCheck001.java‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class AddressStrictCheck001 {
3232
private final byte[] testNetAccountAddress = PublicMethed.getFinalAddress(testNetAccountKey);
3333
private Long maxFeeLimit = Configuration.getByPath("testng.conf")
3434
.getLong("defaultParameter.maxFeeLimit");
35-
private ManagedChannel channelSolidity = null;
3635

3736
private ManagedChannel channelFull = null;
3837
private WalletGrpc.WalletBlockingStub blockingStubFull = null;
@@ -47,9 +46,6 @@ public class AddressStrictCheck001 {
4746
private String fullnode1 = Configuration.getByPath("testng.conf")
4847
.getStringList("fullnode.ip.list").get(1);
4948

50-
private String soliditynode = Configuration.getByPath("testng.conf")
51-
.getStringList("solidityNode.ip.list").get(0);
52-
5349
byte[] contractAddress = null;
5450
ECKey ecKey1 = new ECKey(Utils.getRandom());
5551
byte[] contractExcAddress = ecKey1.getAddress();
@@ -77,15 +73,10 @@ public void beforeClass() {
7773
.usePlaintext(true)
7874
.build();
7975
blockingStubFull1 = WalletGrpc.newBlockingStub(channelFull1);
80-
81-
channelSolidity = ManagedChannelBuilder.forTarget(soliditynode)
82-
.usePlaintext(true)
83-
.build();
84-
blockingStubSolidity = WalletSolidityGrpc.newBlockingStub(channelSolidity);
8576
}
8677

8778

88-
@Test(enabled = true, description = "open experimental check address ")
79+
@Test(enabled = true, description = "Open experimental check address ")
8980
public void test01CheckAddressNew() {
9081
Assert.assertTrue(PublicMethed
9182
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
@@ -143,21 +134,15 @@ public void test01CheckAddressNew() {
143134
*/
144135
@AfterClass
145136
public void shutdown() throws InterruptedException {
146-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
147-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
137+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
138+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
148139
blockingStubFull);
149-
PublicMethed.waitProduceNextBlock(blockingStubFull);
150-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
151-
logger.info("Balance:" + afterBalancer);
152140
if (channelFull != null) {
153141
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
154142
}
155143
if (channelFull1 != null) {
156144
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
157145
}
158-
if (channelSolidity != null) {
159-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
160-
}
161146
}
162147

163148

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/addressStrictCheck/AddressStrictCheck002.java‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class AddressStrictCheck002 {
3232
private final byte[] testNetAccountAddress = PublicMethed.getFinalAddress(testNetAccountKey);
3333
private Long maxFeeLimit = Configuration.getByPath("testng.conf")
3434
.getLong("defaultParameter.maxFeeLimit");
35-
private ManagedChannel channelSolidity = null;
3635

3736
private ManagedChannel channelFull = null;
3837
private WalletGrpc.WalletBlockingStub blockingStubFull = null;
@@ -47,9 +46,6 @@ public class AddressStrictCheck002 {
4746
private String fullnode1 = Configuration.getByPath("testng.conf")
4847
.getStringList("fullnode.ip.list").get(1);
4948

50-
private String soliditynode = Configuration.getByPath("testng.conf")
51-
.getStringList("solidityNode.ip.list").get(0);
52-
5349
byte[] contractAddress = null;
5450
ECKey ecKey1 = new ECKey(Utils.getRandom());
5551
byte[] contractExcAddress = ecKey1.getAddress();
@@ -77,15 +73,10 @@ public void beforeClass() {
7773
.usePlaintext(true)
7874
.build();
7975
blockingStubFull1 = WalletGrpc.newBlockingStub(channelFull1);
80-
81-
channelSolidity = ManagedChannelBuilder.forTarget(soliditynode)
82-
.usePlaintext(true)
83-
.build();
84-
blockingStubSolidity = WalletSolidityGrpc.newBlockingStub(channelSolidity);
8576
}
8677

8778

88-
@Test(enabled = true, description = "close experimental check address")
79+
@Test(enabled = true, description = "Close experimental check address")
8980
public void test01AddressOld() {
9081
Assert.assertTrue(PublicMethed
9182
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
@@ -139,21 +130,15 @@ public void test01AddressOld() {
139130
*/
140131
@AfterClass
141132
public void shutdown() throws InterruptedException {
142-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
143-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
133+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
134+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
144135
blockingStubFull);
145-
PublicMethed.waitProduceNextBlock(blockingStubFull);
146-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
147-
logger.info("Balance:" + afterBalancer);
148136
if (channelFull != null) {
149137
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
150138
}
151139
if (channelFull1 != null) {
152140
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
153141
}
154-
if (channelSolidity != null) {
155-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
156-
}
157142
}
158143

159144

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/isContract/isContractCommand001.java‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ public void beforeClass() {
102102
}
103103

104104

105-
@Test(enabled = true, description = "correct contract address test")
106-
public void test01CorrectContract() {
105+
@Test(enabled = true, description = "Correct contract address test")
106+
public void test01CorrectContractAddress() {
107107
PublicMethed.waitProduceNextBlock(blockingStubFull);
108108
Protocol.Account info;
109109
GrpcAPI.AccountResourceMessage resourceInfo = PublicMethed
@@ -164,7 +164,7 @@ public void test01CorrectContract() {
164164
.assertEquals(1, ByteArray.toInt(transactionExtention.getConstantResult(0).toByteArray()));
165165
}
166166

167-
@Test(enabled = true, description = " account Address test")
167+
@Test(enabled = true, description = "Account address test")
168168
public void test02AccountAddress() {
169169
PublicMethed.waitProduceNextBlock(blockingStubFull);
170170
Protocol.Account info;
@@ -227,7 +227,7 @@ public void test02AccountAddress() {
227227
.assertEquals(0, ByteArray.toInt(transactionExtention.getConstantResult(0).toByteArray()));
228228
}
229229

230-
@Test(enabled = true, description = "nonexistent Account Address test")
230+
@Test(enabled = true, description = "Nonexistent account address test")
231231
public void test03NonexistentAddress() {
232232
PublicMethed.waitProduceNextBlock(blockingStubFull);
233233
Protocol.Account info;
@@ -289,7 +289,7 @@ public void test03NonexistentAddress() {
289289
.assertEquals(0, ByteArray.toInt(transactionExtention.getConstantResult(0).toByteArray()));
290290
}
291291

292-
@Test(enabled = true, description = "constructor return test")
292+
@Test(enabled = true, description = "Constructor return test")
293293
public void test04ConstructorReturn() {
294294
PublicMethed.waitProduceNextBlock(blockingStubFull);
295295
Protocol.Account info;
@@ -357,21 +357,15 @@ public void test04ConstructorReturn() {
357357
*/
358358
@AfterClass
359359
public void shutdown() throws InterruptedException {
360-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
361-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
360+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
361+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
362362
blockingStubFull);
363-
PublicMethed.waitProduceNextBlock(blockingStubFull);
364-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
365-
logger.info("Balance:" + afterBalancer);
366363
if (channelFull != null) {
367364
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
368365
}
369366
if (channelFull1 != null) {
370367
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
371368
}
372-
if (channelSolidity != null) {
373-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
374-
}
375369
}
376370

377371

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/isContract/isContractCommand002.java‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class isContractCommand002 {
3333
private final byte[] testNetAccountAddress = PublicMethed.getFinalAddress(testNetAccountKey);
3434
private Long maxFeeLimit = Configuration.getByPath("testng.conf")
3535
.getLong("defaultParameter.maxFeeLimit");
36-
private ManagedChannel channelSolidity = null;
3736

3837
private ManagedChannel channelFull = null;
3938
private WalletGrpc.WalletBlockingStub blockingStubFull = null;
@@ -46,8 +45,6 @@ public class isContractCommand002 {
4645
private String fullnode1 = Configuration.getByPath("testng.conf")
4746
.getStringList("fullnode.ip.list").get(1);
4847

49-
private String soliditynode = Configuration.getByPath("testng.conf")
50-
.getStringList("solidityNode.ip.list").get(0);
5148
byte[] contractAddress = null;
5249
byte[] selfdestructContractAddress = null;
5350

@@ -84,8 +81,8 @@ public void beforeClass() {
8481
}
8582

8683

87-
@Test(enabled = true, description = "selfdestruct contract test isContract Command")
88-
public void test01selfdestructContract() {
84+
@Test(enabled = true, description = "Selfdestruct contract test isContract Command")
85+
public void test01SelfdestructContract() {
8986
Assert.assertTrue(PublicMethed
9087
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
9188
blockingStubFull));
@@ -159,7 +156,7 @@ public void test01selfdestructContract() {
159156
.assertEquals(0, ByteArray.toInt(transactionExtention.getConstantResult(0).toByteArray()));
160157
}
161158

162-
@Test(enabled = true, description = "no constructor test isContract Command")
159+
@Test(enabled = true, description = "No constructor test isContract Command")
163160
public void test02NoConstructorContract() {
164161
Assert.assertTrue(PublicMethed
165162
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
@@ -185,20 +182,15 @@ public void test02NoConstructorContract() {
185182
*/
186183
@AfterClass
187184
public void shutdown() throws InterruptedException {
188-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
189-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
185+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
186+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
190187
blockingStubFull);
191-
PublicMethed.waitProduceNextBlock(blockingStubFull);
192-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
193188
if (channelFull != null) {
194189
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
195190
}
196191
if (channelFull1 != null) {
197192
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
198193
}
199-
if (channelSolidity != null) {
200-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
201-
}
202194
}
203195

204196

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/isContract/isContractCommand003.java‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class isContractCommand003 {
3333
private final byte[] testNetAccountAddress = PublicMethed.getFinalAddress(testNetAccountKey);
3434
private Long maxFeeLimit = Configuration.getByPath("testng.conf")
3535
.getLong("defaultParameter.maxFeeLimit");
36-
private ManagedChannel channelSolidity = null;
3736

3837
private ManagedChannel channelFull = null;
3938
private WalletGrpc.WalletBlockingStub blockingStubFull = null;
@@ -46,8 +45,6 @@ public class isContractCommand003 {
4645
private String fullnode1 = Configuration.getByPath("testng.conf")
4746
.getStringList("fullnode.ip.list").get(1);
4847

49-
private String soliditynode = Configuration.getByPath("testng.conf")
50-
.getStringList("solidityNode.ip.list").get(0);
5148
byte[] contractAddress = null;
5249

5350
ECKey ecKey1 = new ECKey(Utils.getRandom());
@@ -82,7 +79,7 @@ public void beforeClass() {
8279
blockingStubFull1 = WalletGrpc.newBlockingStub(channelFull1);
8380
}
8481

85-
@Test(enabled = true, description = "incorrect address hex test isContract Command")
82+
@Test(enabled = true, description = "Incorrect address hex test isContract Command")
8683
public void test01IncorrectHashContract() {
8784
PublicMethed
8885
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
@@ -162,7 +159,7 @@ public void test01IncorrectHashContract() {
162159
transactionExtention.getResult().getMessage().toStringUtf8());
163160
}
164161

165-
@Test(enabled = true, description = "empty addresses hash test isContract Command")
162+
@Test(enabled = true, description = "Empty addresses hash test isContract Command")
166163
public void test02EmptyAddressHashContract() {
167164
PublicMethed
168165
.sendcoin(contractExcAddress, 10000000000L, testNetAccountAddress, testNetAccountKey,
@@ -247,20 +244,15 @@ public void test02EmptyAddressHashContract() {
247244
*/
248245
@AfterClass
249246
public void shutdown() throws InterruptedException {
250-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
251-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
247+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
248+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
252249
blockingStubFull);
253-
PublicMethed.waitProduceNextBlock(blockingStubFull);
254-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
255250
if (channelFull != null) {
256251
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
257252
}
258253
if (channelFull1 != null) {
259254
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
260255
}
261-
if (channelSolidity != null) {
262-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
263-
}
264256
}
265257

266258

‎src/test/java/stest/tron/wallet/dailybuild/tvmnewcommand/multiValidateSignContract/multiValidateSignContract001.java‎

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ public void beforeClass() {
8282
.usePlaintext(true)
8383
.build();
8484
blockingStubFull1 = WalletGrpc.newBlockingStub(channelFull1);
85-
86-
channelSolidity = ManagedChannelBuilder.forTarget(soliditynode)
87-
.usePlaintext(true)
88-
.build();
89-
blockingStubSolidity = WalletSolidityGrpc.newBlockingStub(channelSolidity);
9085
txid = PublicMethed
9186
.sendcoinGetTransactionId(contractExcAddress, 1000000000L, testNetAccountAddress,
9287
testNetAccountKey,
@@ -104,8 +99,8 @@ public void beforeClass() {
10499
}
105100

106101

107-
@Test(enabled = true, description = "correct signatures and address test multivalidatesign")
108-
public void test01multivalidatesign() {
102+
@Test(enabled = true, description = "Correct data test pure multivalidatesign")
103+
public void test01CorrectData() {
109104
PublicMethed.waitProduceNextBlock(blockingStubFull);
110105
List<Object> signatures = new ArrayList<>();
111106
List<Object> addresses = new ArrayList<>();
@@ -132,9 +127,8 @@ public void test01multivalidatesign() {
132127
}
133128

134129

135-
@Test(enabled = true, description = "incorrect address test multivalidatesign")
136-
public void test02multivalidatesign() {
137-
PublicMethed.waitProduceNextBlock(blockingStubFull);
130+
@Test(enabled = true, description = "Incorrect address test pure multivalidatesign")
131+
public void test02IncorrectAddress() {
138132
List<Object> signatures = new ArrayList<>();
139133
List<Object> addresses = new ArrayList<>();
140134
byte[] hash = Hash.sha3(txid.getBytes());
@@ -159,9 +153,8 @@ public void test02multivalidatesign() {
159153

160154
}
161155

162-
@Test(enabled = true, description = "incorrect signatures test multivalidatesign")
163-
public void test03multivalidatesign() {
164-
PublicMethed.waitProduceNextBlock(blockingStubFull);
156+
@Test(enabled = true, description = "Incorrect signatures test pure multivalidatesign")
157+
public void test03IncorrectSignatures() {
165158
List<Object> signatures = new ArrayList<>();
166159
List<Object> addresses = new ArrayList<>();
167160
byte[] hash = Hash.sha3(txid.getBytes());
@@ -184,8 +177,8 @@ public void test03multivalidatesign() {
184177

185178
}
186179

187-
@Test(enabled = true, description = "incorrect hash test multivalidatesign")
188-
public void test04multivalidatesign() {
180+
@Test(enabled = true, description = "Incorrect hash test pure multivalidatesign")
181+
public void test04IncorrectHash() {
189182
String txid = PublicMethed
190183
.sendcoinGetTransactionId(contractExcAddress, 1000000000L, testNetAccountAddress,
191184
testNetAccountKey,
@@ -227,8 +220,8 @@ public void test04multivalidatesign() {
227220
Assert.assertEquals("SUCCESS", transactionExtention.getResult().getCode().toString());
228221
}
229222

230-
@Test(enabled = true, description = "Extra long addresses and signatures array test multivalidatesign")
231-
public void test05multivalidatesign() {
223+
@Test(enabled = true, description = "Extra long addresses and signatures array test pure multivalidatesign")
224+
public void test05ExtraLongArray() {
232225
PublicMethed.waitProduceNextBlock(blockingStubFull);
233226
List<Object> signatures = new ArrayList<>();
234227
List<Object> addresses = new ArrayList<>();
@@ -262,21 +255,15 @@ public void test05multivalidatesign() {
262255
*/
263256
@AfterClass
264257
public void shutdown() throws InterruptedException {
265-
long beforeBalance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
266-
PublicMethed.sendcoin(testNetAccountAddress, beforeBalance, contractExcAddress, contractExcKey,
258+
long balance = PublicMethed.queryAccount(contractExcKey, blockingStubFull).getBalance();
259+
PublicMethed.sendcoin(testNetAccountAddress, balance, contractExcAddress, contractExcKey,
267260
blockingStubFull);
268-
PublicMethed.waitProduceNextBlock(blockingStubFull);
269-
Long afterBalancer = PublicMethed.queryAccount(contractExcKey, blockingStubFull1).getBalance();
270-
logger.info("Balance:" + afterBalancer);
271261
if (channelFull != null) {
272262
channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
273263
}
274264
if (channelFull1 != null) {
275265
channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
276266
}
277-
if (channelSolidity != null) {
278-
channelSolidity.shutdown().awaitTermination(5, TimeUnit.SECONDS);
279-
}
280267
}
281268

282269
private String parametersString(List<Object> parameters) {

0 commit comments

Comments
 (0)