public NoSuchEntityException( EntityReference identity, Class<?> mixinType, Usecase usecase ) { super( "Could not find entity (" + identity + ") of type " + mixinType.getName() + " in usecase '" + usecase.name() + "'" ); this.identity = identity; this.usecase = usecase; this.mixinTypes = new Class<?>[]{ mixinType }; }
public NoSuchEntityException( EntityReference identity, Class<?>[] mixinTypes, Usecase usecase ) { super( "Could not find entity (" + identity + ") of type " + toString( mixinTypes ) + " in usecase '" + usecase.name() + "'" ); this.identity = identity; this.mixinTypes = mixinTypes; this.usecase = usecase; }
@After @Override public void tearDown() throws Exception { if( module != null && module.isUnitOfWorkActive() ) { while( module.isUnitOfWorkActive() ) { UnitOfWork uow = module.currentUnitOfWork(); if( uow.isOpen() ) { System.err.println( "UnitOfWork not cleaned up:" + uow.usecase().name() ); uow.discard(); } else { throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is: " + uow .usecase() .name() ); } } new Exception( "UnitOfWork not properly cleaned up" ).printStackTrace(); } super.tearDown(); } }
@AfterClass public void tearDown() throws Exception { if( module != null && module.isUnitOfWorkActive() ) { while( module.isUnitOfWorkActive() ) { UnitOfWork uow = module.currentUnitOfWork(); if( uow.isOpen() ) { uow.discard(); } else { throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is" + uow .usecase() .name() ); } } new Exception( "UnitOfWork not properly cleaned up" ).printStackTrace(); } if( application != null ) { application.passivate(); } } }
builder.prototype().user().set( user ); builder.prototype().timestamp().set( System.currentTimeMillis() ); builder.prototype().usecase().set( unitOfWork.usecase().name() ); builder.prototype().version().set( version ); builder.prototype().events().get().addAll( events.getEventValues() );
prototype.usecase().set( uow.usecase().name() ); prototype.version().set( version );