accessing a Class in test directory from a Class in src directory
Hi I have tried out the following. I have source with test and src directories build using maven. I have created a class in my test folder and try to access (create objects, static methods) from a class in my src directory. But importing test class ailed to my src class.
How can I achieve this. I know its not the idea. It shouldn't be available to access class this manner. But I need to know the reason it is blocked. And way to remove that block.
As you have said, accessing a Test class in a Src class is not a good idea.
But it is definitely possible, just ensure src/test/java folder is in the classpath.
If you are using Eclipse IDE, then
right click the project -> Properties -> Java Build Path -> Source
ensure src/test/java folder is added.