Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_de
Articles_pt
DevelopmentEnvironme...




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseEclipse_pt


Difference between current version and version 2:

At line 36 changed 2 lines.
!!Add build.xml to Ant View [#3]
Now we need to add the build.xml to Eclipse's Ant View. To do this, go to Window → Show View → Ant. Then click on the first icon in this view (screenshot below) to add AppFuse's build file.
!!Adicione o arquivo build.xml para o Ant View [#3]
Agora precisamos adicionar o arquivo build.xml para o Ant View do Eclipse. Para fazê-lo, devemos acessar Window → Show View → Ant. Então devemos clicar no primeiro ícone desta visão (screenshot abaixo) para adicionar o arquivo build do AppFuse.
At line 41 changed 1 line.
!!Adicione o arquivo build.xml para o Ant View [#4]
!!Rode o Ant [#4]
At line 44 changed 1 line.
Now if you run the "compile" target and then refresh the project (right-click on project → Refresh) you shouldn't see any errors in the "Problems" pane. You should now be able to compile and create classes as you normally would. Sometimes when my imports aren't resolving correctly in Eclipse, I do have to run Project → Clean in Eclipse.
Agora se você rodar o alvo "compile", atualizar o projeto (clique com o botão direito em project → Refresh) e não aparecerá nenhum erro no pane "Problems". Você poderá agora compilar e criar classes como normalmente faria. Algumas vezes quando meus imports não são resolvidos corretamente pelo Eclipse, rodo Project → Clean no Eclipse.
At line 46 changed 1 line.
%%note __NOTE:__ If you're using the internal version of Ant, you may get an error message like the one below:
%%note __NOTA:__ Se você está utilizando a versão interna do Ant, você pode receber uma mensagem de erro como a abaixo:
At line 53 changed 1 line.
This is because there are tasks that require Xerces to be in your Ant classpath [[<a href="http://wiki.apache.org/jakarta-cactus/FrequentlyAskedQuestions">reference</a>]. I added xercesImpl.jar and xml-apis.jar (from my self-installed version of Ant) to Eclipse's Ant classpath to solve this.
Isto é porque existem tasks Ant que necessitam que o Xerces esteja no classpath do Ant [[<a href="http://wiki.apache.org/jakarta-cactus/FrequentlyAskedQuestions">reference</a>]. Adicionei xercesImpl.jar e xml-apis.jar (de minha instalação própria de Ant) para o classpath do Ant do Eclipse para resolver este problema.
At line 55 changed 1 line.
At this point, you should see something similar to the screenshot below.
Neste ponto, você terá algo similar ao screenshot abaixo.
At line 59 changed 2 lines.
!!Run JUnit Tests in Eclipse [#5]
It's also possible to run your JUnit tests in Eclipse. But before running them, you need to run the "war" target. After this target completes, refresh your project.
!!Rode os testes JUnit no Eclipse [#5]
Tmabém é possível você rodar os testes JUnit no Eclipse. Mas antes de rodá-los, você deve rodar o alvo "war". Após o alvo ser completado, atualize seu projeto.
At line 62 changed 1 line.
After you have successfully done so, in Eclipse open a test you'd like to run (i.e. UserDaoTest) and go to Run &rarr; Debug As &rarr; JUnit Test. Note that you may have to run the "db-load" target before you run your tests every so often. I did have the following method in the Base*TestCase class for each layer, but this caused DBUnit to reload the database before every test in a Test class. Removing it reduces the execution time of "test-all" by more than 30 seconds.
Após você fazê-lo com sucesso, abra o teste que deseja rodar no Eclipse (i.e. UserDaoTest) e vá para Run &rarr; Debug As &rarr; JUnit Test. Note que você deve rodar o alvo "db-load" antes de rodar cada teste. Eu ainda tenho o seguinte método na classe Base*TestCase para cada camada, mas isto causa um carregamento da base de dados pelo DBUnit antes de cada teste na classe de Teste. Removendo isto reduz o tempo de execução da task "test-all" em mais de 30 segundos.
At line 71 changed 1 line.
// clear table and insert only sample data
// limpa a tabela e insere apenas os dados de amostra
At line 77 changed 1 line.
If the instructions above don't work for running JUnit tests in Eclipse, I suggest just using the command line - i.e. __ant test-dao -Dtestcase=UserDAO__. Running tests from the command line ''always'' works. ;-)
Se as instruções acima não funcionaram para rodar os testes JUnit no Eclipse, sugiro apenas utilizar a linha de comando - i.e. __ant test-dao -Dtestcase=UserDAO__. Rodar testes da linha de comando ''sempre'' funciona. ;-)
At line 79 changed 2 lines.
!!Tips for Debugging and UI Editing [#6]
For debugging, I use the [Tomcat Plugin|http://www.sysdeo.com/eclipse/tomcatPlugin.html] in Eclipse and set breakpoints. To make the breakpoints work you will need to indicate your source-path using the Eclipse menu {{Window->Preferences}}, select {{Tomcat}}, then {{Source Path}}.
!!Dicas para Depuração e edição de Interface ao Usuário (UI) [#6]
Para depuração, utilizo o [Plugin para Tomcat|http://www.sysdeo.com/eclipse/tomcatPlugin.html] no Eclipse e setar breakpoints. Para fazer os breakpoints funcionarem, será preciso indicar o caminho do código fonte utilizando o menu do Eclipse {{Window->Preferences}}, selecione {{Tomcat}}, então {{Source Path}}.
At line 82 changed 1 line.
For little changes, I use "ant deploy-web" which only takes a couple of seconds. For truly minor tweaks, it's sometimes easier to edit the file in Tomcat's webapps folder. For major design changes, I usually run the app, view source on a page and save it to a "sandbox" folder in the same directory as my project. Then I do a find/replace and change all "/appfuse/" references to "../web/". This allows me to change CSS and JS files and just refresh the file in the sandbox.
Para pequenas mudanças, utilizo "ant deploy-web" que demora apenas alguns segundos. Para mudanças verdadeiramente pequenas, algumas vezes é mais fácil editar o arquivo na pasta de aplicações web do Tomcat. Para mudanças maiores de projeto, geralmente eu rodo a aplicação, vejo o código em uma página e salvo ele em uma pasta "sandbox" no mesmo diretório do meu projeto. Então eu faço find/replace e modifico todas as referências "/appfuse/" para "../web/". Isto me permite trocar arquivos CSS e JS e apenas atualizar o arquivo na sandbox.

Back to AppFuseEclipse_pt, or to the Page History.