java - How to handle source code with dependencies to different versions of JUnit -
i don't use junit, have 2 bodies of imported source code different libraries , both use junit; however, seem using different version.
for example, 1 imports things junit.runner... , other has org.junit.runners....
i read little bit of junit documentation , appears not follow strict backward compatibility principle , different versions apparently have different features , require different code, there appear no simple way "upgrade" 1 of libraries latest version.
how deal incompatibility? (other throw out tests half inclined do)
junit 3 , junit 4 use separate package hierarchies, junit.framework 3 , org.junit 4. tests utilizing these different versions should able coexist. there problems other libraries if code based using different versions of same mock libraries or helpers hamcrest. hesitant combine these.
keep these 2 bodies of code in separate projects , let each of them run own tests own version of junit. can write script combines 2 sets of classes 1 jar, use uberjar, or whatever. check out available plugins whatever build tool you're using.
especially if you're modifying else's code, discarding tests seems reckless. if don't seem provide value they're better nothing , can improve them gradually.
Comments
Post a Comment