Permalink
Browse files

Testes de aceitação

  • Loading branch information...
1 parent 646546f commit 18737414a18f973bd97fcace329ee05daf15884a @Turini Turini committed Oct 26, 2012
View
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="src" path="src/test"/>
- <classpathentry kind="src" path="src/controller"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
@@ -3,7 +3,6 @@
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test"/>
- <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/controller"/>
<property name="context-root" value="pm-75-leiloes"/>
<property name="java-output-path" value="/pm-75-leiloes/bin"/>
</wb-module>
Binary file not shown.
View
@@ -12,16 +12,22 @@
<pathelement path="${build.dir}/classes/" />
</path>
+ <path id="libs.classpath" path=".">
+ <fileset dir="WebContent/WEB-INF/lib">
+ <include name="*.jar" />
+ </fileset>
+ </path>
+
<target name="compilar">
<mkdir dir="${build.dir}/classes/"/>
<mkdir dir="${build.dir}/classes-teste/"/>
- <javac destdir="${build.dir}/classes/" srcdir="src/main/" debug="true" encoding="UTF-8" />
+ <javac destdir="${build.dir}/classes/" srcdir="src/main/" classpathref="libs.classpath" debug="true" encoding="UTF-8" />
<javac destdir="${build.dir}/classes-teste/" srcdir="src/test/" classpathref="tests.classpath" debug="true" encoding="UTF-8" />
</target>
<target name="executar-os-testes" depends="compilar">
<mkdir dir="${build.dir}/reports" />
- <jacoco:coverage excludes="**/*Test.java">
+ <jacoco:coverage excludes="**/IntegracaoTest.java">
<junit haltonfailure="true" showoutput="true" haltonerror="true" printsummary="true" fork="true" forkmode="once">
<formatter type="plain" />
<classpath location="${build.dir}/classes-teste/" />
@@ -37,21 +43,20 @@
</jacoco:coverage>
</target>
- <target name="executar-os-testes-de-integracao" depends="compilar">
-
- <!-- levantar o tom cat pra subir aqui? -->
-
+ <target name="executar-os-testes-de-integracao" depends="levanta-servidor-tomcat">
<junit haltonfailure="true" showoutput="true" haltonerror="true" printsummary="true" fork="true" forkmode="once">
<formatter type="plain" />
<classpath location="${build.dir}/classes-teste/" />
<classpath refid="tests.classpath" />
+
<batchtest>
<fileset dir="src/test" >
<include name="**/IntegracaoTest.java" />
</fileset>
</batchtest>
<formatter type="brief" usefile="false" />
</junit>
+ <antcall target="derruba-servidor-tomcat"/>
</target>
<target name="relatorio-jacoco" depends="executar-os-testes">
@@ -61,12 +66,9 @@
<executiondata>
<file name="${basedir}/jacoco.exec"/>
</executiondata>
-
<structure name="pm-75-leiloes">
- <classfiles>
- <fileset dir="${build.dir}">
- <exclude name="**/controller/**/*"/>
- </fileset>
+ <classfiles>
+ <fileset dir="${build.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="src/main" />
@@ -77,7 +79,46 @@
</jacoco:report>
</target>
+ <property name="apache.tomcat7" value="apache-tomcat-7.0.32"/>
+
+ <target name="gera-war" depends="executar-os-testes">
+ <war destfile="${apache.tomcat7}/webapps/pm-75-leiloes.war">
+ <classes dir="${build.dir}/classes"/>
+ <zipfileset dir="WebContent" />
+ </war>
+ </target>
+
+ <target name="levanta-servidor-tomcat" depends="derruba-servidor-tomcat, gera-war">
+ <java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true">
+ <classpath path="${apache.tomcat7}/bin/bootstrap.jar:${apache.tomcat7}/bin/tomcat-juli.jar"/>
+ <jvmarg value="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"/>
+ <jvmarg value="-Djava.util.logging.config.file=${apache.tomcat7}/conf/logging.properties"/>
+ <jvmarg value="-Dcatalina.home=${apache.tomcat7}"/>
+ <jvmarg value="-Dcatalina.base=${apache.tomcat7}"/>
+ <jvmarg value="-Djava.io.tmpdir=${apache.tomcat7}/temp"/>
+ <arg line="start"/>
+ </java>
+
+ <waitfor maxwait="2" maxwaitunit="minute" checkevery="3" checkeveryunit="second" timeoutproperty="waittimedout">
+ <http url="http://localhost:7070/pm-75-leiloes/" />
+ </waitfor>
+ <fail if="waittimedout" message="Server is not running or returned an error."/>
+ </target>
+
+ <target name="derruba-servidor-tomcat">
+ <java classname="org.apache.catalina.startup.Bootstrap" fork="true">
+ <classpath path="${apache.tomcat7}/bin/bootstrap.jar:${apache.tomcat7}/bin/tomcat-juli.jar"/>
+ <jvmarg value="-Dcatalina.home=${apache.tomcat7}"/>
+ <arg line="stop"/>
+ </java>
+ </target>
+
<target name="gerar-jar" depends="executar-os-testes">
<jar destfile="pm-75-leiloes.jar" basedir="${build.dir}/classes/" />
</target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+
</project>
View
Binary file not shown.
View
Binary file not shown.
@@ -1,13 +0,0 @@
-package br.com.caelum.leilao.controller;
-
-import br.com.caelum.vraptor.Path;
-import br.com.caelum.vraptor.Resource;
-
-@Resource
-public class IndexController {
-
- @Path("/")
- public void index() {
- }
-
-}

0 comments on commit 1873741

Please sign in to comment.