Migrated everything except
- the Bytes utilities class - it's easier to do in Java as with Kotlin byte + byte = int - the demo project, which I'm not sure I'll migrate. Maybe I'll make a new Kotlin Demo application
This commit is contained in:
@ -81,8 +81,8 @@ public class Main {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offerAddresses(List<NetworkAddress> addresses) {
|
||||
LOG.info("Local node registry ignored offered addresses: " + addresses);
|
||||
public void offerAddresses(List<NetworkAddress> nodes) {
|
||||
LOG.info("Local node registry ignored offered addresses: " + nodes);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -14,29 +14,28 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package ch.dissem.bitmessage;
|
||||
package ch.dissem.bitmessage
|
||||
|
||||
import ch.dissem.bitmessage.entity.Plaintext;
|
||||
import ch.dissem.bitmessage.entity.Plaintext
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* Created by chrig on 02.02.2016.
|
||||
* Test listener that allows you to wait for a message in tests.
|
||||
*/
|
||||
public class TestListener implements BitmessageContext.Listener {
|
||||
private CompletableFuture<Plaintext> future = new CompletableFuture<>();
|
||||
class TestListener : BitmessageContext.Listener {
|
||||
private var future = CompletableFuture<Plaintext>()
|
||||
|
||||
@Override
|
||||
public void receive(Plaintext plaintext) {
|
||||
future.complete(plaintext);
|
||||
override fun receive(plaintext: Plaintext) {
|
||||
future.complete(plaintext)
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
future = new CompletableFuture<>();
|
||||
fun reset() {
|
||||
future = CompletableFuture<Plaintext>()
|
||||
}
|
||||
|
||||
public Plaintext get(long timeout, TimeUnit unit) throws Exception {
|
||||
return future.get(timeout, unit);
|
||||
operator fun get(timeout: Long, unit: TimeUnit): Plaintext {
|
||||
return future.get(timeout, unit)
|
||||
}
|
||||
}
|
@ -50,7 +50,7 @@ class TestNodeRegistry implements NodeRegistry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offerAddresses(List<NetworkAddress> addresses) {
|
||||
public void offerAddresses(List<NetworkAddress> nodes) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user