Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runner simplification refactoring #265

Merged
merged 21 commits into from
Jun 29, 2018
Merged

Conversation

malaskowski
Copy link
Contributor

@malaskowski malaskowski commented Jun 21, 2018

Description

Curren AET Runner flow is very complicated with unnecessary creation of threads and Guice DI.

Motivation and Context

Complicated AET Runner implementation makes it harder to understand it and improve. This is the first refactor in a series of changes that I'd like to apply to the AET Runner.
I've tried to introduce as few changes at is possible, there are areas to improve (starting with introducing Java 8 features).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

@malaskowski malaskowski requested a review from wiiitek June 21, 2018 10:32
@Reference
private JmsConnection jmsConnection;

public CollectDispatcher getCollectDispatcher(TimeoutWatch timeoutWatch,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the names of methods in this class?

Currently they have names of getters, but they are NOT getters.

collectionResultsRouter.addChangeObserver(comparisonResultsRouter);
}

void start() throws JMSException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename this method? start could be confusing as is used when working with threads...

Maybe process ?


import com.cognifide.aet.runner.testsuitescope.TestSuiteScoped;
import java.util.concurrent.TimeUnit;

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove whole JAVADOC if we can or write some description. Currently it duplicates class name.

@@ -36,14 +32,14 @@ public synchronized void update() {
* @param acceptedSecondsDifference accepted difference in seconds
* @return true if last update was done more than acceptedSecondsDifference seconds from now
*/
public synchronized boolean isTimedOut(long acceptedSecondsDifference) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for changes in visibility/scope :)

@@ -13,35 +13,26 @@
* or implied. See the License for the specific language governing permissions and limitations under
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes. thanks!

@@ -1,3 +1,11 @@
package com.cognifide.aet.runner.processing;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually have license header at the top of our files. could we have it consistent here?

@@ -69,10 +69,6 @@
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-osgi</artifactId>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you @Skejven !

Actually it looks like guice is referenced also in worker module, but is not used at all there (or am I wrong?).
So we could remove Guice from the worker pom and then also from top-level pom, isn't it?

Then we could remove guice from feature.xml file. That would b great, right?

(there will be only some transitive dependencies to guice from our functional tests that use Bobcat).

Could be done here or in another pull request if you prefer...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @wiiitek for the review.
I will remove Guice dependency in the separate PR.

@malaskowski malaskowski merged commit 819502a into master Jun 29, 2018
@malaskowski malaskowski deleted the feature/aet-runner-refactoring branch June 29, 2018 05:27
@wiiitek wiiitek mentioned this pull request Jun 29, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants