TestBaseUtils refactoring

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

TestBaseUtils refactoring

Anton Solovev
Hello guys,

I think there is a sense to tear apart TestBaseUtils into a number of util classes which it keeps them.
Because some test classes can't extend this base test class, but need in its result checkers

Best,
Anton


Reply | Threaded
Open this post in threaded view
|

Re: TestBaseUtils refactoring

伍翀(云邪)
Hi Anton,

Thanks for bringing up this discussion.

I think TestBaseUtils is a util class not a base class to extend.
All the methods in TestBaseUtils are static, that means we can
use any method directly without extend it.

Thanks, Jark

> 在 2017年1月26日,上午7:46,Anton Solovev <[hidden email]> 写道:
>
> Hello guys,
>
> I think there is a sense to tear apart TestBaseUtils into a number of util classes which it keeps them.
> Because some test classes can't extend this base test class, but need in its result checkers
>
> Best,
> Anton
>
>

Reply | Threaded
Open this post in threaded view
|

Re: TestBaseUtils refactoring

Jinkui Shi
hi, all

UT and CT have clear boundary and consensus of opinion:
1. UT and CT separated.  surefire plugin have two different execution for CT and UT
2. Temporary file creating and destroy should be unified with TemporaryFolder.
     FLINK-5546 has change the java.io <http://java.io/>.tmpdir to target directory.
     I think Stephan or other committer can replace temporary file management with TemporaryFolder  in one issue or several sub-issues. There are so many test file need to be corrected.
3. should have clearly test suffix. For example: *.Test.java, *.Suite.scala used for UT; *ITCase.java, *ITSuite.scala used for Scala.  FLINK-5546 has add java UT include clearly.

IMO, TestBaseUtils’ responsibility is not clear, suggesting:
1. correct the tmp file creating with TemporaryFolder
2. all the static field should be modify, should not be final
3. what’s the responsibility of TestBaseUtils, use as base unit test or as base util class of unit class? Util class should not be extends by unit test class.

Best,
Jinkui Shi

> On Jan 26, 2017, at 11:37, Jark Wu <[hidden email]> wrote:
>
> Hi Anton,
>
> Thanks for bringing up this discussion.
>
> I think TestBaseUtils is a util class not a base class to extend.
> All the methods in TestBaseUtils are static, that means we can
> use any method directly without extend it.
>
> Thanks, Jark
>
>> 在 2017年1月26日,上午7:46,Anton Solovev <[hidden email]> 写道:
>>
>> Hello guys,
>>
>> I think there is a sense to tear apart TestBaseUtils into a number of util classes which it keeps them.
>> Because some test classes can't extend this base test class, but need in its result checkers
>>
>> Best,
>> Anton
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: TestBaseUtils refactoring

Stephan Ewen
In reply to this post by 伍翀(云邪)
@Anton - I agree, that class is pretty ugly and mostly leftover code.

+1 for tearing it apart (and dropping as much code of it as possible in the
process)

On Thu, Jan 26, 2017 at 4:37 AM, Jark Wu <[hidden email]> wrote:

> Hi Anton,
>
> Thanks for bringing up this discussion.
>
> I think TestBaseUtils is a util class not a base class to extend.
> All the methods in TestBaseUtils are static, that means we can
> use any method directly without extend it.
>
> Thanks, Jark
>
> > 在 2017年1月26日,上午7:46,Anton Solovev <[hidden email]> 写道:
> >
> > Hello guys,
> >
> > I think there is a sense to tear apart TestBaseUtils into a number of
> util classes which it keeps them.
> > Because some test classes can't extend this base test class, but need in
> its result checkers
> >
> > Best,
> > Anton
> >
> >
>
>