test/org/ohmage/test/Controller.java
public static void main(final String[] args) throws ApiException {
		OhmageApi api = parseArguments(args);
		if(api == null) {
			return;
		}
		
		ParameterSets.init();

		long start = (new Date()).getTime();
		
		try {
			// Test the configuration API.
			ConfigApiTest configTest = new ConfigApiTest(api);
			configTest.test();
			
			// Test authentication with the admin information.
			AuthenticationApiTest authTest = new AuthenticationApiTest(api);
			authTest.test(adminUsername, adminPassword);
		
			// Now that we know they work, get the hashed password and an 
			// authentication token for the rest of the tests to use.
			//String hashedPassword = api.getHashedPassword(adminUsername, adminPassword, CLIENT);
			String authToken = api.getAuthenticationToken(adminUsername, adminPassword, CLIENT);
			
			// Now, start testing the user APIs.
			UserApiTests userTest = new UserApiTests(api, authToken);
			userTest.test(authToken);
			
			// Now, test the classes.
			ClassApiTest classTest = new ClassApiTest(api, authToken);
			classTest.test(authToken);
			
			// Next, begin testing the documents. Create some, share some, 
			// delete some.
			
			// Test Mobility. Create points, and test the readability and 
			// writability of certain users.
			
			// Test the campaigns. Create some, connect them to classes, test 
			// the readability and writability of users.
			
			// Finally, test the survey responses. Create some, change privacy
			// states, test readability and writability.
			
			// Note: UserApiTests cannot test user/stats/read until there are 
			// Mobility points and survey responses for the current user.
			
			// Note: UserApiTests cannot test user/read until some user(s) has
			// been assigned to classes and campaigns.
		}
		catch(ApiException e) {
			// If any of the tests throw this, we are in a bad way.
			e.printStackTrace();
			return;
		}
		
		long end = (new Date()).getTime();
		
		System.out.println("All tests passed in " + (end - start) + " milliseconds.");
	}
/**
	 * Creates the server connection and runs the tests. Each test is 
	 * responsible for its own tear up and tear down. It will then 
	 * 
	 * @param args The arguments as defined in {@link #printUsage()}.
	 */
Creates the server connection and runs the tests. Each test is
responsible for its own tear up and tear down. It will then

@param args The arguments as defined in  #printUsage().
Creates the server connection and runs the tests . Each test is responsible for its own tear up and tear down . It will then @param args The arguments as defined in #printUsage () .
public static void main(final String[] args) throws ApiException {
		OhmageApi api = parseArguments(args);
		if(api == null) {
			return;
		}
		ParameterSets.init();
		long start = (new Date()).getTime();
		try {
			ConfigApiTest configTest = new ConfigApiTest(api);
			configTest.test();
			AuthenticationApiTest authTest = new AuthenticationApiTest(api);
			authTest.test(adminUsername, adminPassword);
			String authToken = api.getAuthenticationToken(adminUsername, adminPassword, CLIENT);
			UserApiTests userTest = new UserApiTests(api, authToken);
			userTest.test(authToken);
			ClassApiTest classTest = new ClassApiTest(api, authToken);
			classTest.test(authToken);
		}
		catch(ApiException e) {
			e.printStackTrace();
			return;
		}
		long end = (new Date()).getTime();
		System.out.println("All tests passed in " + (end - start) + " milliseconds.");
	}
public static void main ( final String [ ] args ) throws ApiException { OhmageApi api = parseArguments ( args ) ; if ( api == null ) { return ; } ParameterSets . init ( ) ; long start = ( new Date ( ) ) . getTime ( ) ; try { ConfigApiTest configTest = new ConfigApiTest ( api ) ; configTest . test ( ) ; AuthenticationApiTest authTest = new AuthenticationApiTest ( api ) ; authTest . test ( adminUsername , adminPassword ) ; String authToken = api . getAuthenticationToken ( adminUsername , adminPassword , CLIENT ) ; UserApiTests userTest = new UserApiTests ( api , authToken ) ; userTest . test ( authToken ) ; ClassApiTest classTest = new ClassApiTest ( api , authToken ) ; classTest . test ( authToken ) ; } catch ( ApiException e ) { e . printStackTrace ( ) ; return ; } long end = ( new Date ( ) ) . getTime ( ) ; System . out . println ( "All tests passed in " + ( end - start ) + " milliseconds." ) ; }
Creates the server connection and runs the tests.
Creates the server connection and runs the tests .
// Test the configuration API. // Test authentication with the admin information. // Now that we know they work, get the hashed password and an  // authentication token for the rest of the tests to use. //String hashedPassword = api.getHashedPassword(adminUsername, adminPassword, CLIENT); // Now, start testing the user APIs. // Now, test the classes. // Next, begin testing the documents. Create some, share some,  // delete some. // Test Mobility. Create points, and test the readability and  // writability of certain users. // Test the campaigns. Create some, connect them to classes, test  // the readability and writability of users. // Finally, test the survey responses. Create some, change privacy // states, test readability and writability. // Note: UserApiTests cannot test user/stats/read until there are  // Mobility points and survey responses for the current user. // Note: UserApiTests cannot test user/read until some user(s) has // been assigned to classes and campaigns. // If any of the tests throw this, we are in a bad way.