Permalink
Browse files

Adicionando Vraptor e Teste de Integracao

  • Loading branch information...
1 parent 82a4dae commit 506b3dc58e4fa1b9758d33f653d155fa3d2354bb @Turini Turini committed Oct 25, 2012
Showing with 132 additions and 4 deletions.
  1. +2 −0 .classpath
  2. +28 −0 .project.save
  3. +12 −0 .settings/.jsdtscope
  4. +10 −0 .settings/org.eclipse.wst.common.component
  5. +7 −0 .settings/org.eclipse.wst.common.project.facet.core.xml
  6. +1 −0 .settings/org.eclipse.wst.jsdt.ui.superType.container
  7. +1 −0 .settings/org.eclipse.wst.jsdt.ui.superType.name
  8. +3 −0 WebContent/META-INF/MANIFEST.MF
  9. +2 −0 WebContent/META-INF/context.xml
  10. +12 −0 WebContent/WEB-INF/jsp/index/index.jsp
  11. BIN WebContent/WEB-INF/lib/aopalliance.jar
  12. BIN WebContent/WEB-INF/lib/aspectjrt.jar
  13. BIN WebContent/WEB-INF/lib/cglib-nodep-2.1_3.jar
  14. BIN WebContent/WEB-INF/lib/commons-collections-3.2.1.jar
  15. BIN WebContent/WEB-INF/lib/commons-logging.jar
  16. BIN WebContent/WEB-INF/lib/guava-r07.jar
  17. BIN WebContent/WEB-INF/lib/hamcrest-all-1.1.jar
  18. BIN WebContent/WEB-INF/lib/javassist-3.9.0.GA.jar
  19. BIN WebContent/WEB-INF/lib/jstl-api-1.2.jar
  20. BIN WebContent/WEB-INF/lib/jstl-impl-1.2.jar
  21. BIN WebContent/WEB-INF/lib/log4j-1.2.16.jar
  22. BIN WebContent/WEB-INF/lib/mirror-1.5.1.jar
  23. BIN WebContent/WEB-INF/lib/objenesis-1.1.jar
  24. BIN WebContent/WEB-INF/lib/ognl-2.7.3.jar
  25. BIN WebContent/WEB-INF/lib/org.springframework.aop-3.0.5.RELEASE.jar
  26. BIN WebContent/WEB-INF/lib/org.springframework.asm-3.0.5.RELEASE.jar
  27. BIN WebContent/WEB-INF/lib/org.springframework.aspects-3.0.5.RELEASE.jar
  28. BIN WebContent/WEB-INF/lib/org.springframework.beans-3.0.5.RELEASE.jar
  29. BIN WebContent/WEB-INF/lib/org.springframework.context-3.0.5.RELEASE.jar
  30. BIN WebContent/WEB-INF/lib/org.springframework.core-3.0.5.RELEASE.jar
  31. BIN WebContent/WEB-INF/lib/org.springframework.expression-3.0.5.RELEASE.jar
  32. BIN WebContent/WEB-INF/lib/org.springframework.web-3.0.5.RELEASE.jar
  33. BIN WebContent/WEB-INF/lib/paranamer-2.2.jar
  34. BIN WebContent/WEB-INF/lib/scannotation-1.0.2.jar
  35. BIN WebContent/WEB-INF/lib/slf4j-api-1.6.1.jar
  36. BIN WebContent/WEB-INF/lib/slf4j-log4j12-1.6.1.jar
  37. BIN WebContent/WEB-INF/lib/vraptor-3.3.1.jar
  38. BIN WebContent/WEB-INF/lib/xstream-1.3.1.jar
  39. +14 −0 WebContent/WEB-INF/web.xml
  40. +6 −4 build.xml
  41. BIN jacoco.exec
  42. BIN lib/test/selenium-server-standalone-2.22.0.jar
  43. +13 −0 src/controller/br/com/caelum/leilao/controller/IndexController.java
  44. +21 −0 src/test/br/com/caelum/leilao/integracao/IntegracaoTest.java
View
@@ -2,9 +2,11 @@
<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"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="lib" path="lib/test/selenium-server-standalone-2.22.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>pm-75-leiloes</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="pm-75-leiloes">
+ <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>
+</project-modules>
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="wst.jsdt.web"/>
+ <installed facet="java" version="1.7"/>
+ <installed facet="jst.web" version="3.0"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
@@ -0,0 +1 @@
+Window
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/vraptor-blank-project"/>
@@ -0,0 +1,12 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>pm-75-leiloes</title>
+ </head>
+ <body>
+ <span id="mensagem">Aplicação do curso pm-75-leiloes da Caelum!</span>
+ </body>
+</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+ <display-name>pm-75-leiloes</display-name>
+ <filter>
+ <filter-name>vraptor</filter-name>
+ <filter-class>br.com.caelum.vraptor.VRaptor</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>vraptor</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+</web-app>
View
@@ -21,7 +21,7 @@
<target name="executar-os-testes" depends="compilar">
<mkdir dir="${build.dir}/reports" />
- <jacoco:coverage>
+ <jacoco:coverage excludes="**/*Test.java">
<junit haltonfailure="true" showoutput="true" haltonerror="true" printsummary="true" fork="true" forkmode="once">
<formatter type="plain" />
<classpath location="${build.dir}/classes-teste/" />
@@ -41,12 +41,14 @@
<mkdir dir="${build.dir}/jacoco/report"/>
<jacoco:report>
<executiondata>
- <file name="${basedir}/jacoco.exec" />
+ <file name="${basedir}/jacoco.exec"/>
</executiondata>
<structure name="pm-75-leiloes">
<classfiles>
- <fileset dir="${build.dir}"/>
+ <fileset dir="${build.dir}">
+ <exclude name="**/controller/**/*"/>
+ </fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="src/main" />
@@ -60,4 +62,4 @@
<target name="gerar-jar" depends="executar-os-testes">
<jar destfile="pm-75-leiloes.jar" basedir="${build.dir}/classes/" />
</target>
-</project>
+</project>
View
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
+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,0 +1,21 @@
+package br.com.caelum.leilao.integracao;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+public class IntegracaoTest {
+
+ @Test
+ public void deveLocalizarAMensagemDeBoasVindasDoProjeto(){
+ WebDriver driver = new FirefoxDriver();
+ driver.get("http://localhost:8080/pm-75-leiloes/");
+ WebElement mensagaem = driver.findElement(By.id("mensagem"));
+ assertTrue(mensagaem.isDisplayed());
+ assertTrue(mensagaem.getText().equals("Aplicação do curso pm-75-leiloes da Caelum!"));
+ driver.close();
+ }
+}

0 comments on commit 506b3dc

Please sign in to comment.