Browse Source

small test code

JNI-88
Volker Birk 7 years ago
parent
commit
712573b979
  1. 9
      src/AdapterTest.java
  2. 4
      src/Makefile
  3. 14
      src/SyncCallbacks.java

9
src/AdapterTest.java

@ -4,11 +4,18 @@ class AdapterTest {
public static void main(String[] args)
{
System.out.println("running...");
Engine pEp;
try {
Engine e = new Engine();
pEp = new Engine();
}
catch (pEpException e) {
System.out.println("ERROR: cannot initialize engine");
System.exit(1);
}
SyncCallbacks callbacks = new SyncCallbacks();
System.out.println("... shutting down");
}
}

4
src/Makefile

@ -90,8 +90,8 @@ clean:
rm -f throw_pEp_exception.*
rm -f org_pEp_jniadapter_Message.cc org_pEp_jniadapter_Engine.cc
AdapterTest.class: AdapterTest.java
javac -cp $(JAR) $<
AdapterTest.class: AdapterTest.java SyncCallbacks.java
javac -cp .:$(JAR) $< SyncCallbacks.java
test: AdapterTest.class
java AdapterTest

14
src/SyncCallbacks.java

@ -0,0 +1,14 @@
import org.pEp.jniadapter.*;
class SyncCallbacks implements Sync.MessageToSendCallback, Sync.notifyHandshakeCallback {
public void messageToSend(Message message)
{
System.out.println(message.getFrom());
}
public void notifyHandshake(Identity myself, Identity partner, SyncHandshakeSignal signal)
{
}
}
Loading…
Cancel
Save