Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Test files deploying to Tomcat in Eclipse, how do you stop Eclipse from doing this  RSS feed

 
ranger
Posts: 17344
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So we have a properties file that is in the src and the test resource directories. When we deploy the app to Tomcat running in Eclipse, it takes the test resource files, which is incorrect. Test needs to be a source directory so we can run the tests, but the tests obviously don't run in Tomcat.

Besides using "excludes" in the source, how can you get Eclipse not to deploy the test classes and resource files onto the Tomcat running in Eclipse.

Thanks

Mark
 
Bartender
Posts: 20360
112
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have 2 separate source directories - one for the app and one for the tests. If you want to use Maven's standards, they'd be src/main/java and src/test/java.

Normally Eclipse compiles all classes to a single output directory (by default, it's "bin"). However, you can designate individual output directories on a per-source-directroy basis. That will keep the unit test classes out of the WAR.
 
Mark Spritzler
ranger
Posts: 17344
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:You should have 2 separate source directories - one for the app and one for the tests. If you want to use Maven's standards, they'd be src/main/java and src/test/java.

Normally Eclipse compiles all classes to a single output directory (by default, it's "bin"). However, you can designate individual output directories on a per-source-directroy basis. That will keep the unit test classes out of the WAR.



Thanks everything is already configured that way. But for some reason, it still is taking files from the resource directory for tests and putting into the deployment on Tomcat. Tomcat is being run inside Eclipse, so it is all in a tmp0 directory that Eclipse is making and copying files into that directory.

Mark
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bump. I am having a very similar issue. How did you resolve this?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!