systemtest.java

来自「We intend to develop a wifi enabled p2p 」· Java 代码 · 共 57 行

JAVA
57
字号
/**
 * Filename:		SystemTest.java
 *
 * Test Type:		System Test
 *
 * Description:		Tests the JXTA services used by the application
 *					Classes involved include PeerDiscovery and ServicesApi
 *					  Connects to JXTA services
 *					  Retrieves available nodes
 *					  There should be at least one node available most of the time
 *	 				  except when JXTA services are down
 *
 *					You will be prompted for a JXTA login
 *
 *					Secure Username	: peerrsx
 *					Password		: peerrsx1
 *
 *
 * Project: 		Linux-WIFI Project (Group 38 - CS 329)
 *
 * Submitted by:	Faisal Razzaq (razzaq) and Srinivas Kattragadda (Kattraga)
 *
 * Last Updated On:	3/11/03
 */

package edu.uiuc.cs.cs327.linuxwifi.services;

import java.lang.String;
import junit.framework.*;
import java.util.Vector;

public class SystemTest extends TestCase {

	// object to test
	private ServicesApi servicesApi = null;

	// fixture
	protected void setUp(){
		servicesApi = new ServicesApi(null);
		try{
			// wait 25 seconds to retrieve the nodes before the test method is called
		    Thread.sleep(25000);
		 }
		 catch(InterruptedException e) {;}
		}

	protected void tearDown(){
		servicesApi = null;
		}


	// test number of nodes retrieved
	public void testPeerServices() {
		Vector availableNodesVector = servicesApi.getAvailableNodes();
		Assert.assertTrue(availableNodesVector.size()>0);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?