sudeep87 / uimafit

Automatically exported from code.google.com/p/uimafit
0 stars 0 forks source link

ComponentTestBase - base class for tests #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have committed a Test_ImplBase and removed the now unused Util.java class.  
Test_ImplBase is meant to be a superclass of your test class and provides, free 
of charge, a jCas, a type system, and a token builder which are initialized in 
the setup method.  It is now the superclass of many of our tests.  

Feel free to criticize, complain, etc.  I should have made a ticket first to 
allow for discussion but got rolling with it and decided to commit since it 
only effects the test code and really simplifies things a lot in my opinion.  
Anyways, this change touched a lot of tests because I also went back and made 
sure that we are not unnecessarily instantiating e.g. TypeSystemDescription's.  
I have been meaning to add this for a while and never got to it.  The breaking 
point was the though of having to instantiate TokenBuilder wherever I needed 
it.  

I have one outstanding problem (from point of view) and that is maven thinks 
Test_ImplBase should have a test in it and it fails.  So, I added a dummy test 
to it and now it doesn't complain.  However, this test runs once for each class 
the subclasses it.  It seems the right thing to do is figure out how to make 
maven ignore this class as a test.  The other two options are to leave it as it 
is or rename it to something else (e.g. Tst_ImplBase.)  I would vote for the 
former before the latter - but would prefer to get maven to do the right thing. 
 Any ideas how to do this?

Original issue reported on code.google.com by pvogren@gmail.com on 11 Jun 2010 at 4:04

GoogleCodeExporter commented 8 years ago
It occurred to me this morning that this class is not an _ImplBase and so the 
name should change.  Not sure what to call it - maybe UimaFitTest.

Original comment by pvogren@gmail.com on 11 Jun 2010 at 1:30

GoogleCodeExporter commented 8 years ago
I usually call abstract base classes for test cases XXXTestBase. If you have 
the some XXX in front and Base in the end, Maven should also not think it would 
be a real test case and try to execute it.

It is possible to fine-tune what Maven recognizes as tests via the Surefire 
Maven Plugin.

So I would suggest UimaFitTestBase - or something more specific if there be, 
e.g. ComponentTestBase. I would prefer the latter.

Original comment by richard.eckart on 11 Jun 2010 at 1:34

GoogleCodeExporter commented 8 years ago
I like UimaFitTestBase.  What does "Component" mean in the other name?  

Original comment by pvogren@gmail.com on 11 Jun 2010 at 2:58

GoogleCodeExporter commented 8 years ago

Original comment by pvogren@gmail.com on 11 Jun 2010 at 6:06

GoogleCodeExporter commented 8 years ago
Well, when it provides a CAS and a type system, it seems quite likely that it 
will be used for testing some UIMA component, e.g. a reader or analysis engine. 

Original comment by richard.eckart on 11 Jun 2010 at 8:27

GoogleCodeExporter commented 8 years ago
Works for me.  I will rename ComponentTestBase.

Original comment by pvogren@gmail.com on 11 Jun 2010 at 8:35

GoogleCodeExporter commented 8 years ago
I renamed Test_ImplBase to ComponentTestBase and committed.

Original comment by pvogren@gmail.com on 11 Jun 2010 at 8:46