<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.mobicents.testsuite</groupId>
		<artifactId>mms-testsuite</artifactId>
		<version>2.0.0.BETA2</version>
	</parent>

	<artifactId>mms-testsuite-gui</artifactId>
	<packaging>jar</packaging>

	<name>Mobicents Media Server Test Suite GUI</name>

	<dependencies>
		<!--
			<dependency> <groupId>${pom.groupId}</groupId>
			<artifactId>mobicents-media-server-constants</artifactId>
			<version>${pom.version}</version> </dependency>
		-->
		<dependency>
			<groupId>jfreechart</groupId>
			<artifactId>jfreechart</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.servers.media</groupId>
			<artifactId>mms-spi</artifactId>
		</dependency>
		<dependency>
			<artifactId>mms-impl</artifactId>
			<groupId>org.mobicents.servers.media</groupId>
		</dependency>
		<dependency>
			<groupId>concurrent</groupId>
			<artifactId>concurrent</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.sip</groupId>
			<artifactId>jain-sip-ri</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.jain</groupId>
			<artifactId>mobicents-mgcp-impl</artifactId>
		</dependency>
		<dependency>
			<groupId>jboss</groupId>
			<artifactId>jboss-system</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jboss</groupId>
			<artifactId>jboss-common</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.appframework</groupId>
			<artifactId>appframework</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.appframework</groupId>
			<artifactId>swing-layout</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.appframework</groupId>
			<artifactId>swing-worker</artifactId>
		</dependency>

		<dependency>
			<groupId>org.mobicents.external.fmj</groupId>
			<artifactId>fmj</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.fmj</groupId>
			<artifactId>mp3spi</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.fmj</groupId>
			<artifactId>tritonus_share</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.fmj</groupId>
			<artifactId>vorbisspi</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.opencsv</groupId>
			<artifactId>opencsv</artifactId>
		</dependency>
		<dependency>
			<groupId>urbanophile</groupId>
			<artifactId>java-getopt</artifactId>
		</dependency>
	</dependencies>


	<build>
		<finalName>${pom.artifactId}-${pom.version}</finalName>

		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>RELEASE</version>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>
								org.mobicents.media.server.load.test.EchoLoadTest
							</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependency-jar</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.mobicents.servers.media</groupId>
									<artifactId>mms-spi</artifactId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										mobicents-media-server-spi.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<artifactId>mms-impl</artifactId>
									<groupId>org.mobicents.servers.media</groupId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										mobicents-media-server-impl.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<artifactId>log4j</artifactId>
									<groupId>log4j</groupId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										log4j.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<artifactId>
										jain-mgcp-ri
									</artifactId>
									<groupId>jain</groupId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jain-mgcp-ri.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>org.mobicents.jain</groupId>
									<artifactId>mobicents-mgcp-impl</artifactId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										mgcp-stack.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<artifactId>concurrent</artifactId>
									<groupId>concurrent</groupId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										concurrent.jar
									</destFileName>
								</artifactItem>


								<artifactItem>
									<groupId>javax.sip</groupId>
									<artifactId>jain-sip-ri</artifactId>
									<version>
										${jain-sip-ri.version}
									</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jain-sip-ri.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>jboss</groupId>
									<artifactId>
										jboss-common
									</artifactId>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jboss-common.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.jspeex
									</groupId>
									<artifactId>jspeex</artifactId>
									<version>0.9.7</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jspeex.jar
									</destFileName>
								</artifactItem>


								<artifactItem>
									<groupId>
										org.mobicents.external.appframework
									</groupId>
									<artifactId>
										appframework
									</artifactId>
									<version>1.0.3</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										appframework.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.appframework
									</groupId>
									<artifactId>
										swing-layout
									</artifactId>
									<version>1.0.3</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										swing-layout.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.appframework
									</groupId>
									<artifactId>
										swing-worker
									</artifactId>
									<version>1.1</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										swing-worker.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.fmj
									</groupId>
									<artifactId>fmj</artifactId>
									<version>1.0</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>fmj.jar</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.fmj
									</groupId>
									<artifactId>mp3spi</artifactId>
									<version>1.9.4</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										mp3spi.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.fmj
									</groupId>
									<artifactId>
										tritonus_share
									</artifactId>
									<version>1.0</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										tritonus_share.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.fmj
									</groupId>
									<artifactId>vorbisspi</artifactId>
									<version>1.0.2</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										vorbisspi.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										org.mobicents.external.opencsv
									</groupId>
									<artifactId>opencsv</artifactId>
									<version>1.8</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										opencsv.jar
									</destFileName>
								</artifactItem>

								<artifactItem>
									<groupId>
										jfree
									</groupId>
									<artifactId>jcommon</artifactId>
									<version>1.0.0</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jcommon.jar
									</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>
										jfree
									</groupId>
									<artifactId>jfreechart</artifactId>
									<version>1.0.0</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										jfreechart.jar
									</destFileName>
								</artifactItem>


								<artifactItem>
									<groupId>urbanophile</groupId>
									<artifactId>java-getopt</artifactId>
									<version>1.0.9</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>
										${project.build.directory}
									</outputDirectory>
									<destFileName>
										java-getopt.jar
									</destFileName>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>

					<!--
						This one is requried to copy all resources - files generated by
						NetBeans in src dir - in case of maven those are nto copied since
						are out of packaging structure
					-->

					<execution>
						<id>copy-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<copy overwrite="true" verbose="true" todir="${project.build.directory}/classes">
									<fileset dir="src/main/java/" includes="**/resources/**" />
								</copy>
								<copy overwrite="true" verbose="true" todir="${project.build.directory}/audio">
									<fileset dir="../web/src/main/webapp/audio" />
								</copy>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-eclipse-plugin</artifactId>
				<groupId>org.mobicents.tools</groupId>
				<version>
					${mobicents.tools.mavenplugin.eclipse.version}
				</version>
				<inherited>false</inherited>
				<executions />
				<configuration>
					<classpathExcludes>
						<exclude>xml-apis:xml-apis</exclude>
						<exclude>jtidy:jtidy</exclude>
					</classpathExcludes>
					<resolveTransitiveDependencies>
						true
					</resolveTransitiveDependencies>
					<eclipseProjectName>
						mobicents-media-server-test-suite
					</eclipseProjectName>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.1</version>
						<inherited>false</inherited>
						<executions>
							<execution>
								<id>ant-script-copy</id>
								<phase>install</phase>
								<inherited>false</inherited>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<copy overwrite="true" todir="${dest.dir}">
											<fileset dir="${basedir}/target">
												<include name="**.jar" />
											</fileset>
										</copy>
										<copy overwrite="true" file="${basedir}/release/README.txt" todir="${dest.dir}" />
										<copy overwrite="true" file="${basedir}/release/build.xml" todir="${dest.dir}">
											<filterset>
												<filter token="JAR.NAME" value="${pom.artifactId}" />
												<filter token="JAR.VERSION" value="${pom.version}" />
											</filterset>
										</copy>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>run</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.1</version>
						<inherited>false</inherited>
						<executions>
							<execution>
								<id>execute-test</id>
								<phase>install</phase>
								<inherited>false</inherited>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<java classname="org.mobicents.media.server.testsuite.gui.MainGUI" fork="true">
											<jvmarg value="-Xms768M" />
											<jvmarg value="-Xmx768M" />
											<classpath>
												<pathelement location="target/${pom.artifactId}-${pom.version}.jar" />
												<pathelement location="target/mobicents-media-server-spi.jar" />
												<pathelement location="target/mobicents-media-server-impl.jar" />
												<pathelement location="target/log4j.jar" />
												<pathelement location="target/mgcp-stack.jar" />
												<pathelement location="target/jain-mgcp-ri.jar" />
												<pathelement location="target/concurrent.jar" />
												<pathelement location="target/mobicents-media-server-constants.jar" />
												<pathelement location="target/jain-sip-ri.jar" />
												<pathelement location="target/jboss-common.jar" />
												<pathelement location="target/jspeex.jar" />
												<pathelement location="target/appframework.jar" />
												<pathelement location="target/swing-layout.jar" />
												<pathelement location="target/swing-worker.jar" />
												<pathelement location="target/fmj.jar" />
												<pathelement location="target/mp3spi.jar" />
												<pathelement location="target/tritonus_share.jar" />
												<pathelement location="target/vorbisspi.jar" />
												<pathelement location="target/opencsv.jar" />
												<pathelement location="target/jcommon.jar" />
												<pathelement location="target/jfreechart.jar" />
												<pathelement location="target/java-getopt.jar" />

											</classpath>
										</java>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>run-cli</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<properties>
				<local.addr>127.0.0.1</local.addr>
				<remote.addr>127.0.0.1</remote.addr>
				<local.port>2428</local.port>
				<remote.port>2427</remote.port>
				<cps>5</cps>
				<max.calls>2000</max.calls>
				<max.concurrent.calls>150</max.concurrent.calls>
				<data.dir>datadump</data.dir>
				<audio.file.url>file:/D:/java/jprojects/mctrunk/servers/media/test-suite/core/target/audio/ulaw_13s.wav</audio.file.url>
				<audio.codec>0 pcmu/8000</audio.codec>
				<test.type>AnnTest</test.type>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.1</version>
						<inherited>false</inherited>
						<executions>
							<execution>
								<id>execute-test</id>
								<phase>install</phase>
								<inherited>false</inherited>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<java classname="org.mobicents.media.server.testsuite.cli.CLIRunner" fork="true">
											<jvmarg value="-Xms768M" />
											<jvmarg value="-Xmx768M" />

											<arg value="--localaddr=${local.addr}" />
											<arg value="--remoteaddr=${remote.addr}" />
											<arg value="--localport=${local.port}" />
											<arg value="--remoteport=${remote.port}" />
											<arg value="--cps=${cps}" />
											<arg value="--datadir=${data.dir}" />
											<arg value="--audiofile=${audio.file.url}" />
											<arg value="--audiocodec='${audio.codec}'" />
											<arg value="--testtype=${test.type}" />

											<!-- SINCE maven takes over cli, THIS IS A MUST -->	
											<arg value="--maxcalls=${max.calls}" />
											<arg value="--concurrentcalls=${max.concurrent.calls}" />



											<classpath>
												<pathelement location="target/${pom.artifactId}-${pom.version}.jar" />
												<pathelement location="target/mobicents-media-server-spi.jar" />
												<pathelement location="target/mobicents-media-server-impl.jar" />
												<pathelement location="target/log4j.jar" />
												<pathelement location="target/mgcp-stack.jar" />
												<pathelement location="target/jain-mgcp-ri.jar" />
												<pathelement location="target/concurrent.jar" />
												<pathelement location="target/mobicents-media-server-constants.jar" />
												<pathelement location="target/jain-sip-ri.jar" />
												<pathelement location="target/jboss-common.jar" />
												<pathelement location="target/jspeex.jar" />
												<pathelement location="target/appframework.jar" />
												<pathelement location="target/swing-layout.jar" />
												<pathelement location="target/swing-worker.jar" />
												<pathelement location="target/fmj.jar" />
												<pathelement location="target/mp3spi.jar" />
												<pathelement location="target/tritonus_share.jar" />
												<pathelement location="target/vorbisspi.jar" />
												<pathelement location="target/opencsv.jar" />
												<pathelement location="target/jcommon.jar" />
												<pathelement location="target/jfreechart.jar" />
												<pathelement location="target/java-getopt.jar" />

											</classpath>
										</java>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>run-cli-usage</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.1</version>
						<inherited>false</inherited>
						<executions>
							<execution>
								<id>execute-test</id>
								<phase>install</phase>
								<inherited>false</inherited>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<java classname="org.mobicents.media.server.testsuite.cli.CLIRunner" fork="true">
											<jvmarg value="-Xms768M" />
											<jvmarg value="-Xmx768M" />

											<arg value="--usage" />

											<classpath>
												<pathelement location="target/${pom.artifactId}-${pom.version}.jar" />
												<pathelement location="target/mobicents-media-server-spi.jar" />
												<pathelement location="target/mobicents-media-server-impl.jar" />
												<pathelement location="target/log4j.jar" />
												<pathelement location="target/mgcp-stack.jar" />
												<pathelement location="target/jain-mgcp-ri.jar" />
												<pathelement location="target/concurrent.jar" />
												<pathelement location="target/mobicents-media-server-constants.jar" />
												<pathelement location="target/jain-sip-ri.jar" />
												<pathelement location="target/jboss-common.jar" />
												<pathelement location="target/jspeex.jar" />
												<pathelement location="target/appframework.jar" />
												<pathelement location="target/swing-layout.jar" />
												<pathelement location="target/swing-worker.jar" />
												<pathelement location="target/fmj.jar" />
												<pathelement location="target/mp3spi.jar" />
												<pathelement location="target/tritonus_share.jar" />
												<pathelement location="target/vorbisspi.jar" />
												<pathelement location="target/opencsv.jar" />
												<pathelement location="target/jcommon.jar" />
												<pathelement location="target/jfreechart.jar" />
												<pathelement location="target/java-getopt.jar" />

											</classpath>
										</java>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
