Junit + getResourceAsStream Returning Null

后端 未结 13 1428
情话喂你
情话喂你 2020-12-15 03:32

Not sure how this is possible. I re-read up on getResourceAsStream and it\'s always returning null.

InputStream source = this.getClass().getResourceAsStream(         


        
13条回答
  •  余生分开走
    2020-12-15 03:33

    Try MyClass.getResourceAsStream().

    Also try putting the test.xml in your classpath. For instance, in an Eclipse web project put text.xml in webcontent/WEB-INF/classes

提交回复
热议问题