Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

0.2 tests #32

Open
wants to merge 3 commits into
base: 0.2
Choose a base branch
from
Open
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
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
language: java

jdk:
- oraclejdk8
before-install:
- echo before-install
- pip install --user codecov
install: true
script:
- mvn clean install
- oraclejdk8

notifications:
slack:
secure: "H6eYpuLQatCsKXkgQisjVAx33BiZbA9FZ6KVrdYttjEpaNCH7yZu1/4jcWsLbjwyWi6xbbUYMIYtrjkXbgavFVlhiJ5yAD1KpeVdtMytW1W67oCXGGbG5keHVAXkzxExAQdHzSaoLhERdh0i+STePZu4SuK/ZzmGlfVNZ+pr1EuTdJJ/3Qz1D8nR7Xa+DIW+KZGu4iSRqwQwanl/shhyKZWRkqAB/GTJbeGVMB6Fyogi5xI/YXzFovQaqIcF0zcag0Sv7ja8XiCIlAahkYCAT82wdfM5Fg9VHjVAnUnsFhoADRS2OWr4684rZxBy/lox7RugKRQMUS4J3f2vT9MHN3hvGyfkCAsDxZ/c8lMZIPqv3pUtc4G0S73oTOzslLbGxsZT01nprVg6ZPSYHdpl7/TOfd+71Fr5sd2PnZZH7qGFWkmbDzYuMoGXwML7TV7II84sB9qhq4F8zTNrGdSxsCx1Xcb1nq+pRest7tN3wuRkP6rwIub9jClea4XJb8jOZZ+q5eTT8eBmEkUJGsrMgn2Ynz3he3CbXFVJfoCLfuvxjtTrDNIaZEaQDnkP6iN+wMF2b1JEBOQI+hStNE7/PNQTe+12FL5vrW1r9ocGyeps92xBopohS3Pd0rcgfKKRhm3EHUI2/1WBXlPQLY5ImLLfNYhNKho8mGbuS1DbysQ="
after_sucess:
- codecov

after_success:
- bash <(curl -s https://codecov.io/bash)
10 changes: 0 additions & 10 deletions thunder-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,13 @@
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/main/java</source>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/test/java</source>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,12 @@ public List<PaymentData> lockPaymentsToBeRedeemed (NodeKey nodeKey) {
}

@NotNull
private static List<PaymentData> getPaymentDatas (NodeKey nodeKey, List<PaymentWrapper> payments, boolean sender, PaymentStatus searchFor, PaymentStatus
private static List<PaymentData> getPaymentDatas (
NodeKey nodeKey,
List<PaymentWrapper> payments,
boolean sender,
PaymentStatus searchFor,
PaymentStatus
replaceWith) {
List<PaymentData> paymentList = new ArrayList<>();
for (PaymentWrapper p : payments) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void fullExchange () throws NoSuchProviderException, NoSuchAlgorithmExcep
dbHandler2.addPaymentSecret(paymentData.secret);
paymentHelper1.makePayment(paymentData);

Thread.sleep(100);
TestTools.exchangeMessages(channel12, channel21, LNPaymentAMessage.class);
TestTools.exchangeMessages(channel21, channel12, LNPaymentBMessage.class);
TestTools.exchangeMessages(channel12, channel21, LNPaymentCMessage.class);
Expand Down Expand Up @@ -127,6 +128,7 @@ public void fullExchange () throws NoSuchProviderException, NoSuchAlgorithmExcep
@Test
public void fullExchangeWithAnotherPaymentMidway () throws NoSuchProviderException, NoSuchAlgorithmException, InterruptedException {
paymentHelper1.makePayment(getMockPaymentData(serverObject1.pubKeyServer, serverObject2.pubKeyServer));
Thread.sleep(100);

TestTools.exchangeMessages(channel12, channel21, LNPaymentAMessage.class);
TestTools.exchangeMessages(channel21, channel12, LNPaymentBMessage.class);
Expand All @@ -149,6 +151,7 @@ public void fullExchangeConflict () throws NoSuchProviderException, NoSuchAlgori
dbHandler1.addPaymentSecret(payment2.secret);
dbHandler2.addPaymentSecret(payment1.secret);

Thread.sleep(100);
LNPaymentAMessage messageA1 = (LNPaymentAMessage) channel12.readOutbound();
LNPaymentAMessage messageA2 = (LNPaymentAMessage) channel21.readOutbound();

Expand Down Expand Up @@ -179,6 +182,7 @@ public void fullExchangeConflict () throws NoSuchProviderException, NoSuchAlgori
public void sendWrongMessageShouldDisconnect () throws NoSuchProviderException, NoSuchAlgorithmException, InterruptedException {
paymentHelper1.makePayment(getMockPaymentData(serverObject1.pubKeyServer, serverObject2.pubKeyServer));

Thread.sleep(100);
LNPaymentAMessage messageA = (LNPaymentAMessage) channel12.readOutbound();
channel21.writeInbound(messageA);
LNPaymentBMessage messageB = (LNPaymentBMessage) channel21.readOutbound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AckProcessorImplTest {
fun shouldResendAllMessageAfterTimeout() {
dbHandler1.saveMessage(node2.nodeKey, AckableMessageMock(1), DIRECTION.SENT)
dbHandler1.saveMessage(node2.nodeKey, AckableMessageMock(2), DIRECTION.SENT)
Thread.sleep((Constants.MESSAGE_RESEND_TIME * 1.5).toLong())
Thread.sleep((Constants.MESSAGE_RESEND_TIME * 2).toLong())
assertEquals(1L, (channel1.readOutbound() as AckableMessage).getMessageNumber());
assertEquals(2L, (channel1.readOutbound() as AckableMessage).getMessageNumber());
}
Expand All @@ -76,7 +76,7 @@ class AckProcessorImplTest {
channel1.writeInbound(AckMessageImpl(1))
println(1)
println(" aa " + Constants.MESSAGE_RESEND_TIME)
Thread.sleep((Constants.MESSAGE_RESEND_TIME * 1.1).toLong())
Thread.sleep((Constants.MESSAGE_RESEND_TIME * 1.5).toLong())
println(2)
assertEquals(2L, (channel1.readOutbound() as AckableMessage).getMessageNumber());
assertNull(channel1.readOutbound())
Expand Down