1

I have looked at the other threads and I haven't solved my issue, even it's quite similar . The thing is that I have a test class...

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class WorkflowWebServiceTest {

that loads a Context configuration placed in the same folder, but starting from 'resources'.

test/java/es/in2/signingpad/ws/WorkflowWebServiceTest.java test/resources/es/in2/signingpad/ws/WorkflowWebServiceTest-context.xml

By default, Spring looks at this folder, and intellij recognises that path . In Intellij , just near @contextConfiguration, appears an icon similar to a leaf, that, if it's clicked, it goes to the right file .

The problem is that, when I debug a test method, it says to me that

Caused by: java.io.FileNotFoundException: class path resource [es/in2/signingpad/ws/WorkflowWebServiceTest-context.xml] cannot be opened because it does not exist

Is there any special setup that I'm not taking into account ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Yago
  • 319
  • 1
  • 3
  • 18
  • I have tried to put ... @ContextConfiguration(locations = "classpath:/es/in2/signingpad/ws/WorkflowWebServiceTest-context.xml") but still the same . Intellij recognises the path, but when I try to debug , the same error . – Yago Dec 10 '13 at 12:52
  • could you add some information on your directory structure? – marco.eig Dec 10 '13 at 13:41
  • The directory structure is the following one ... ![enter image description here][1] [1]: http://i.stack.imgur.com/5HW5s.png – Yago Dec 10 '13 at 14:33
  • Sorry for the syntax . I think that the image is visible . – Yago Dec 10 '13 at 14:35
  • have you tried "classpath:es/...."? <- omitting the first slash – marco.eig Dec 10 '13 at 14:49
  • i don't know how to configure Intellij to get this to work. is your build path configured properly? does the resources folder get copied to the target folder (where the compile .class files are located after building)? – marco.eig Dec 10 '13 at 14:52
  • I have tried ... "classpath:es/...." and still the same . The resource folder is not copied to the target folder . Maibe that's the problem . I'm checking the way to add the folder to target files . – Yago Dec 10 '13 at 14:59
  • Ok, I have seen in this forum (http://stackoverflow.com/questions/12324960/intellij-not-seeing-resources-folder) that is a bug of intellij ... There is a bug in Intellij 12 please go to Settings->Compiler and un-check "Use external build" check box - the idea behind it was that it was suppose to run faster with a compiler run in a separate process but in fact there is a bug and when using maven it does not copy resources. – Yago Dec 10 '13 at 15:09

0 Answers0