JBoss Community

TestSuite - renaming and repackaging

created by Stefano Maestri in IronJacamar Development - View the full discussion

Hi all,

 

during my refactoring of our test suite I'm wondering if we can make some renaming and repackaging of our test:

 

  • Remove .test package to have test classes in the same namespace of classes under test
  • Try to remove also unit namespace where it is there
  • We are running as Junit test only classes ending with TestCase. It is a quite usual and classic choice, but it is limiting the opportunity of selecting more self describing name for classes as for method in a BDD style. IOW it would be great to make us free of selecting not only the name of the method (for example shouldDoSomething), but also class name. In a BDD style it would be used to define more than one test stressing a class undertest, verifying in each test different aspect/behavior of class under test. Using a classic pet example we could have 2 different test for class Cat named for example as CatShouldBeAHunter (with methods shouldCatchMouses, shouldEatAnimals etc) and CatShouldBeDomesticAnaimal (with method shouldLoveMe, shouldMakeDisaster and so on :) ). To do that we should refactor also our build to consider every classes in the src/test as test case, apart of course some explicit exclusion. This explicit exclusion will be for support/mock class which should be put into a specific package (support or mock is a good name IMHO) and/or using a suffix in their name.
  • At the moment I'll leave every test ala TCK (i.e. org.jboss.jca.test.core.spec.chapter* packages in core module) as is. They are totally different kind of test and should not be considered as unit ones.

 

Any comment is more than welcome

 

S.

Reply to this message by going to Community

Start a new discussion in IronJacamar Development at Community