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.

Answers


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.


Need Your Help

PHP execute multiple queries and while loop

php mysql

I am having some difficulty executing multiple queries.

Illustrator add class to svg group

class svg adobe-illustrator

i have searched from hours to find a solution to export a SVG with class on the group element. Is it possible this thing?