Open alcarraz opened 2 years ago
This is really great.
My only (very minor) comment is that maybe we can use a more specific name for the module, like testbed
, testtools
... something around those lines.
This is really great.
My only (very minor) comment is that maybe we can use a more specific name for the module, like
testbed
,testtools
... something around those lines.
Thank you very much, I don't like the name very much either, maybe test-core
or core-test
but what I really would like is to use is the test fixtures plugin that allows you to define dependencies between module tests.
As it is now we would need a test module per source module, for example, we couldn't put db module tests in this module because it would depend on db module even for modules that don't use jposs-ee-db.
We have core
, perhaps we can call this one testcore
.
Thank you very much, I don't like the name very much either, maybe
test-core
orcore-test
but what I really would like is to use is the test fixtures plugin that allows you to define dependencies between module tests.
That looks very interesting. I've not played with that feature before.
This first commit adds support for injecting a log source, and a mocked MUX for jPOS based application JUnit tests.
It is intended to be used by test classpaths in order to avoid boilerplate for logging or mocked versions of jpos or jPOS-EE components such as
MUX
andDB
objects(currently, only MUX is supported). Actually for jPOS-EE specific components a test module by referenced module maybe necessary to avoid unneeded dependencies.This PR is marked as draft for discussion, specially the classes and annotations names. But if it seems OK, then we can merge it as is
Module for aiding in unit tests
This module provides annotations to inject some mock or frequently needed objects during testing.
For example, it provides an injection for a
Log
object, and aMUX
mock.Log
injection exampleIn the following example, if the logger does not already exist, a default one, that logs to standard output is created with the given
logger
name, and assigned to theLog
instance.MUX
mocking injection exampleThis test class is actually executed in this module's test.