jboss-qa / phaser Goto Github PK
View Code? Open in Web Editor NEWA framework which allows to define execution phases.
License: Apache License 2.0
A framework which allows to define execution phases.
License: Apache License 2.0
because I have not found any documentation :)
Allow to process multiple jobs by the Phaser. All phases defined in all jobs will be joined to single execution tree.
This feature allows to define 'parent' jobs with some global execution tasks and 'child' jobs with specific executions.
The benefit of composition over already supported inheritance:
Every annotation should have unique id. Then the annotation can use after="" and before="".
Methods of job class annotated with @BeforeJob will be executed before any ExecutionNode. Similar for @AfterJob.
If we have class like this:
public class TestClass {
@GenerateReport
public void firstTest() {
// test
}
@GenerateReport
public void secondTest() {
// test
}
}
we get two reports per class. We want to have only one with both test cases
Instances can be created in phase processors or job methods and saved to instance registry. Class fields or method parameters will be then injected from that instance registry.
Problem is in using of java reflection field.getType()
. I think that we should use field.getGenericType()
.
If no phase definition for a phase is defined, following phases should be executed too.
For now, if there is no phase definition for a phase, following phases are not executed.
Mayor design problems of InstanceRegistry class is in complete static implementation. It leads to this problems:
new Phaser(builder.build(), JobA.class.newInstance()).run(); // this execution alter InstanceRegistry
new Phaser(builder.build(), JobB.class.newInstance()).run(); // has access to JobA beans
Proposed solution is pass instance of InstanceRegistry when execute phaser (remote static behavior!).
Use case with two separate IR:
InstanceRegistry irA = new BasicInstanceRegistry();
InstanceRegistry irB = new BasicInstanceRegistry();
new Phaser(builder.build(), JobA.class.newInstance()).run(irA);
new Phaser(builder.build(), JobB.class.newInstance()).run(irB);
Use case with shared IR:
InstanceRegistry shared = new BasicInstanceRegistry();
new Phaser(builder.build(), JobA.class.newInstance()).run(shared);
new Phaser(builder.build(), JobB.class.newInstance()).run(shared);
Use case with thread save implementation:
InstanceRegistry shared = new ThreadSafeInstanceRegistry();
// run concurrent
ExecutorService executor = Executors.newFixedThreadPool(30);
Runnable worker1 = new Runnable(){
public void run(){
phaser.run(shared);
}
};
Runnable worker2 = new Runnable(){
public void run(){
phaser.run(shared);
}
};
executor.execute(worker1);
executor.execute(worker2);
executor.shutdown();
Use case with default behavior:
new Phaser(builder.build(), JobA.class.newInstance()).run(); // automatically create new basic instance of IR
new Phaser(builder.build(), JobB.class.newInstance()).run(); // automatically create new basic instance of IR
Double allows easier adding of new phase definition method on the right order - e.g. between already ordered method without the need to reorder.
Allow primitive types too, of course.
There is currently no exception handling.
2 ideas:
Multiple exceptions can then occurs in the Phaser, all of them should be saved and then (after all RunAlways methods) a wrapper exception will be thrown.
Phase definitions with the same order / id, etc are ignored - use List and sort it instead of TreeSet.
polarion-uploader script uses RESULTS_DIR=$(find . -name "surefire-reports"), but now the reports are saved in phaser-reports dir, so it won't be able to find them
@BeforePhase(PhaseAnnotation / null), the same for @AfterPhase
Methods will be executed before / after all phase definitions.
Due to the Bintray sunset the packages are moved to JBoss Public repository https://developer.jboss.org/docs/DOC-15170
Currently it always sets the time to 0.
Currently when test fails, it shows only:
<failure message="test failure">java.lang.reflect.InvocationTargetException</failure>
It would be nice to add support for injection of system properties in script definitions.
First possible solution and easiest is using existing annotation @Inject
. Only what is needed is fill InstanceRegistry
with Property objects.
public class TestJob {
@Inject("sys.property")
private Property property;
...
}
Second possible solution is to create new annotation @Property
which will load value from property register, convert it to target type and set filed.
public class TestJob {
@Property("sys.property")
private Integer property;
@Property("sys.property2")
private String property2;
@Property("sys.projects")
private Set<String> projects;
...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.