/*
 * This test will first send an instance of InteractionRoot.X with a region that overlaps with the
 * region that listener federate has subscribed to. It will then send another interaction with a
 * region that doesn't overlap with the listener (and validate that the interaction isnt' recevied)
 */
void SendInteractionWithRegionTest::testSendROInteractionWithRegion()
{
	// send an interaction with a region that overlaps with the subscribed region
	try
	{
		defaultFederate->rtiamb->sendInteractionWithRegion( xHandle, *phvps, "NA", *senderRegion );
	}
	catch( RTI::Exception &e )
	{
		failTest( "Unexpected exception while sending RO interaction: %s", e._reason );
	}
	
	// validate that the interaction is received
	validateReceivedRO();
	
	// send an interaction with a region that DOESN'T overlap
	try
	{
		defaultFederate->rtiamb->sendInteractionWithRegion( xHandle, *phvps, "NA", *senderRegionOOB );
	}
	catch( RTI::Exception &e )
	{
		failTest( "Unexpected exception while sending RO interaction: %s", e._reason );
	}
	
	// validate that the interaction is NOT received
	listenerFederate->fedamb->waitForROInteractionTimeout( xHandle );
}
Esempio n. 2
0
///////////////////////////////////////////
// TEST: (valid) testSendROInteraction() //
///////////////////////////////////////////
void SendInteractionTest::testSendROInteraction()
{
	try
	{
		defaultFederate->rtiamb->sendInteraction( yHandle, *phvps, "NA" );
	}
	catch( RTI::Exception &e )
	{
		failTest( "Unexpected exception while sending RO interaction: %s", e._reason );
	}
	
	validateReceivedRO();
}