diff --git a/build.xml b/build.xml index 13f5e87..093ab53 100644 --- a/build.xml +++ b/build.xml @@ -272,6 +272,18 @@ + + + + + + + + + + * @author Emil Ivov + */ +public class MappingTest + extends Ice +{ + /** + * The Logger used by the TrickleIce + * class and its instances for logging output. + */ + private static final Logger logger + = Logger.getLogger(TrickleIce.class.getName()); + + /** + * Runs a test application that creates an agent, attaches an AWS harvester + * as well as a few allocates streams, generates an SDP and dumps + * it on stdout + * + * @param args none currently handled + * @throws Throwable every now and then. + */ + public static void main(String[] args) throws Throwable + { + //if configured, append a mapping harvester. + String localAddressStr = ""; + String publicAddressStr = ""; + + TransportAddress localAddress; + TransportAddress publicAddress; + + try + { + localAddress + = new TransportAddress(localAddressStr, 9, Transport.UDP); + publicAddress + = new TransportAddress(publicAddressStr, 9, Transport.UDP); + + logger.info("Will append a NAT harvester for " + + localAddress + "=>" + publicAddress); + + } + catch(Exception exc) + { + logger.info("Failed to create a NAT harvester for" + + " local address=" + localAddressStr + + " and public address=" + publicAddressStr); + return; + } + + MappingCandidateHarvester natHarvester + = new MappingCandidateHarvester(publicAddress, localAddress); + + List harvesters + = new ArrayList(); + harvesters.add(natHarvester); + + Agent localAgent = createAgent(2020, false, harvesters); + localAgent.setNominationStrategy( + NominationStrategy.NOMINATE_HIGHEST_PRIO); + + String localSDP = SdpUtils.createSDPDescription(localAgent); + + //wait a bit so that the logger can stop dumping stuff: + Thread.sleep(500); + + logger.info("=================== feed the following" + +" to the remote agent ==================="); + + + logger.info("\n" + localSDP); + + logger.info("======================================" + + "========================================\n"); + } +}