Scalatest case that uses a Java Class loads wrong resources?

7 views
Skip to first unread message

Daniel Hilton

unread,
May 4, 2016, 10:41:56 AM5/4/16
to scalatest-users
I've created some test cases, the majority of my code uses scala, however it requires me to get a singleton instance of a Java class in a dependency which loads some properties from a properties file located in src/main/resources (production) and also src/test/resources.

When running scalatest for my class, the initialiser for that java class uses the src/main/resources file and not the src/test/resource like it would when running with JUnit. Is there anything I'm missing?

Bill Venners

unread,
May 4, 2016, 10:46:57 AM5/4/16
to scalate...@googlegroups.com
Hi Daniel,

How are you loading the resource file?

Bill

On Wed, May 4, 2016 at 4:05 AM, 'Daniel Hilton' via scalatest-users <scalate...@googlegroups.com> wrote:
I've created some test cases, the majority of my code uses scala, however it requires me to get a singleton instance of a Java class in a dependency which loads some properties from a properties file located in src/main/resources (production) and also src/test/resources.

When running scalatest for my class, the initialiser for that java class uses the src/main/resources file and not the src/test/resource like it would when running with JUnit. Is there anything I'm missing?

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bill Venners
Artima, Inc.
http://www.artima.com
Reply all
Reply to author
Forward
0 new messages