| 1 |
package org.astrogrid.samp; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.util.Random; |
| 5 |
import java.util.logging.Level; |
| 6 |
import java.util.logging.Logger; |
| 7 |
import junit.framework.TestCase; |
| 8 |
import org.astrogrid.samp.test.CalcStorm; |
| 9 |
import org.astrogrid.samp.test.Calculator; |
| 10 |
import org.astrogrid.samp.test.HubTester; |
| 11 |
import org.astrogrid.samp.xmlrpc.StandardTestProfile; |
| 12 |
|
| 13 |
/** |
| 14 |
* Hub test case. |
| 15 |
* Most of the hard work is done by the hub test classes which are part of |
| 16 |
* the Java SAMP distribution itself, which know how to put a third-party |
| 17 |
* hub through its paces. |
| 18 |
* This class mainly just starts up a hub and invokes those tests. |
| 19 |
* |
| 20 |
* @author Mark Taylor |
| 21 |
* @since 29 Jul 2008 |
| 22 |
*/ |
| 23 |
public class HubTest extends TestCase { |
| 24 |
|
| 25 |
protected void setUp() throws IOException { |
| 26 |
Logger.getLogger( "org.astrogrid.samp" ).setLevel( Level.SEVERE ); |
| 27 |
} |
| 28 |
|
| 29 |
public void testHubTester() throws Exception { |
| 30 |
Random random = new Random( 23 ); |
| 31 |
TestProfile[] profiles = TestProfile.createTestProfiles( random ); |
| 32 |
for ( int i = 0; i < profiles.length; i++ ) { |
| 33 |
TestProfile profile = profiles[ i ]; |
| 34 |
profile.startHub(); |
| 35 |
new HubTester( profile ).run(); |
| 36 |
new CalcStorm( profile, random, 8, 8, Calculator.RANDOM_MODE ) |
| 37 |
.run(); |
| 38 |
profile.stopHub(); |
| 39 |
} |
| 40 |
} |
| 41 |
} |