diff options
author | Jeff Hamilton <jham@android.com> | 2011-06-29 22:01:44 -0500 |
---|---|---|
committer | Jeff Hamilton <jham@android.com> | 2011-08-01 23:26:58 -0500 |
commit | 4a61d3b45e81c0070538f94747a70a49c78f12fa (patch) | |
tree | 4939ec54a0e6527b942126023a393f9c0f85ad35 /tests | |
parent | 5ce39aec169a275e814286372256277819593829 (diff) | |
download | packages_apps_nfc-4a61d3b45e81c0070538f94747a70a49c78f12fa.zip packages_apps_nfc-4a61d3b45e81c0070538f94747a70a49c78f12fa.tar.gz packages_apps_nfc-4a61d3b45e81c0070538f94747a70a49c78f12fa.tar.bz2 |
Remove the binder interface for LLCP.
Change-Id: I8d5fd546ecb07f005322eb5f173975dff7820439
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/nfc/MockLlcpSocket.java | 46 | ||||
-rw-r--r-- | tests/src/com/android/nfc/snep/SnepBasicTests.java | 20 |
2 files changed, 44 insertions, 22 deletions
diff --git a/tests/src/com/android/nfc/MockLlcpSocket.java b/tests/src/com/android/nfc/MockLlcpSocket.java index 4265111..95279a7 100644 --- a/tests/src/com/android/nfc/MockLlcpSocket.java +++ b/tests/src/com/android/nfc/MockLlcpSocket.java @@ -16,26 +16,18 @@ package com.android.nfc; +import android.util.Log; + import java.io.IOException; -import java.nio.ByteBuffer; import java.util.LinkedList; import java.util.List; -import android.util.Log; - -import com.android.internal.nfc.LlcpException; -import com.android.internal.nfc.LlcpSocket; - -public class MockLlcpSocket extends LlcpSocket { +public class MockLlcpSocket implements DeviceHost.LlcpSocket { private static final String TAG = "mockLlcpSocket"; private MockLlcpSocket mPairedSocket; private List<byte[]> mReceivedPackets = new LinkedList<byte[]>(); private boolean mClosed = false; - public MockLlcpSocket() { - super(null, -1); - } - @Override public void close() throws IOException { mClosed = true; @@ -43,7 +35,7 @@ public class MockLlcpSocket extends LlcpSocket { } @Override - public void connect(int sap) throws IOException, LlcpException { + public void connectToSap(int sap) throws IOException { throw new UnsupportedOperationException("Use MockLlcpSocket.bind(client, server)"); } @@ -80,4 +72,34 @@ public class MockLlcpSocket extends LlcpSocket { client.mPairedSocket = server; server.mPairedSocket = client; } + + @Override + public void connectToService(String serviceName) throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public int getRemoteMiu() { + throw new UnsupportedOperationException(); + } + + @Override + public int getRemoteRw() { + throw new UnsupportedOperationException(); + } + + @Override + public int getLocalSap() { + throw new UnsupportedOperationException(); + } + + @Override + public int getLocalMiu() { + throw new UnsupportedOperationException(); + } + + @Override + public int getLocalRw() { + throw new UnsupportedOperationException(); + } }
\ No newline at end of file diff --git a/tests/src/com/android/nfc/snep/SnepBasicTests.java b/tests/src/com/android/nfc/snep/SnepBasicTests.java index bec570d..32b5e64 100644 --- a/tests/src/com/android/nfc/snep/SnepBasicTests.java +++ b/tests/src/com/android/nfc/snep/SnepBasicTests.java @@ -16,17 +16,14 @@ package com.android.nfc.snep; -import java.io.IOException; - import com.android.nfc.MockLlcpSocket; -import com.android.nfc.snep.SnepMessage; import android.nfc.NdefMessage; import android.nfc.NdefRecord; import android.test.AndroidTestCase; import android.util.Log; -import com.android.internal.nfc.LlcpSocket; +import java.io.IOException; /** * Tests the SNEP cleint/server interfaces using a mock LLCP socket. @@ -45,6 +42,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -75,6 +73,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -105,6 +104,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -135,6 +135,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -165,6 +166,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -195,6 +197,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -228,6 +231,7 @@ public class SnepBasicTests extends AndroidTestCase { final SnepMessenger server = new SnepMessenger(false, serverSocket, MIU); new Thread() { + @Override public void run() { try { SnepServer.handleRequest(server, mCallback); @@ -254,13 +258,13 @@ public class SnepBasicTests extends AndroidTestCase { assertEquals(SnepMessage.RESPONSE_SUCCESS, response.getField()); } - private NdefMessage getSmallNdef() { + NdefMessage getSmallNdef() { NdefRecord rec = new NdefRecord(NdefRecord.TNF_ABSOLUTE_URI, NdefRecord.RTD_URI, new byte[0], "http://android.com".getBytes()); return new NdefMessage(new NdefRecord[] { rec }); } - private NdefMessage getNdef(int size) { + NdefMessage getNdef(int size) { StringBuffer string = new StringBuffer(size); for (int i = 0; i < size; i++) { string.append('A' + (i % 26)); @@ -270,10 +274,6 @@ public class SnepBasicTests extends AndroidTestCase { return new NdefMessage(new NdefRecord[] { rec }); } - private class SnepMessageContainer { - SnepMessage message; - } - /** * A SNEP Server implementation that accepts PUT requests for all ndef * messages and responds to GET requests with acceptable length greater |