Skip to content
Browse files

Update test for long-ago refactoring.

  • Loading branch information...
1 parent 1f1af83 commit 80753db7adbe7fba45f8f17834ab10443e4e9b45 @willscott willscott committed Apr 18, 2012
View
19 ...m_f2f/test/edu/washington/cs/oneswarm/f2f/servicesharing/ClientServiceConnectionTest.java
@@ -27,21 +27,17 @@
import edu.washington.cs.oneswarm.f2f.network.FriendConnection;
import edu.washington.cs.oneswarm.f2f.network.QueueManager;
import edu.washington.cs.oneswarm.f2f.network.SearchManager;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ClientServiceConnection;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceChannelEndpoint;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceSharingLoopback;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceSharingManager;
import edu.washington.cs.oneswarm.test.integration.ServiceSharingClientTest;
import edu.washington.cs.oneswarm.test.util.MessageStreamDecoderTestImpl;
import edu.washington.cs.oneswarm.test.util.OneSwarmTestBase;
import edu.washington.cs.oneswarm.test.util.TestUtils;
/**
- * Tests ClientServiceConnection, verifying that data put into its NetworkConnection
- * makes its way to one of its FriendConnections.
+ * Tests ServiceConnections, verifying that data put into its NetworkConnection
+ * makes its way to at least one of the connection endpoints.
*
* @author Krysta
- *
+ *
*/
public class ClientServiceConnectionTest extends OneSwarmTestBase {
@@ -52,7 +48,7 @@
private final static int NUM_FRIENDS = 2;
/* The various layers of data-handling */
- private static ClientServiceConnection clientConn;
+ private static ServiceConnection clientConn;
private static NetworkConnection netConn;
private static List<FriendConnection> friends;
private static MessageStreamDecoderTestImpl decoder;
@@ -108,16 +104,17 @@ private static void setupConnections() {
tcpEndpoint.getConnectionEndpoint(), new OSF2FMessageEncoder(), decoder,
false, false, null);
- clientConn = ClientServiceConnection.getConnectionForTest(netConn);
+ clientConn = new ServiceConnection(true, (short) 0, netConn);
friends = new ArrayList<FriendConnection>();
QueueManager qMgr = new QueueManager();
for (int i = 0; i < NUM_FRIENDS; i++) {
Friend remoteFriend = new Friend("", "Remote " + i, null, false);
FriendConnection friend = FriendConnection.createStubForTests(qMgr, netConn, remoteFriend);
friends.add(friend);
- clientConn.addChannel(friend, new OSF2FHashSearch((byte) 0, 0, 0),
- new OSF2FHashSearchResp((byte) 0, 0, 0, 0));
+ ServiceChannelEndpoint ep = new ServiceChannelEndpoint(friend, new OSF2FHashSearch(
+ (byte) 0, 0, 0), new OSF2FHashSearchResp((byte) 0, 0, 0, 0), true);
+ clientConn.addChannel(ep);
}
}

0 comments on commit 80753db

Please sign in to comment.
Something went wrong with that request. Please try again.