polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Junit Rules
Date Mon, 12 Jun 2017 04:10:02 GMT
Hi,

I think we should go away from the AbstractPolygeneTest & Co, and redo that
with Junit Rules.
That way we get @Rule and @ClassRule semantics for free.

I made a small test


public class Qi383Test
{
    @Rule
    public PolygeneSingletonRule runtime = new PolygeneSingletonRule()
    {
        @Override
        public void assemble( ModuleAssembly module )
            throws AssemblyException
        {
            module.entities( Car.class );
            new EntityTestAssembler().assemble( module );
        }
    };


and added a "runtime." where ever the previous test case was referencing
fields in the super class.

We could then create additional rules with layered architecture, and then
it should be possible to fit all tests into both single module and layered
set ups, with relatively small effort (I think).

If no one objects violently, I want to make this change before 3.0. Should
be ready today.


Cheers
-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message