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

Rerun suite, test, url #412

Merged
merged 209 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
a381d76
start work with rerun, create base for new servlet
plutasnyy Aug 16, 2018
386273c
restored old annotataions, add register servlet
plutasnyy Aug 20, 2018
1526443
prototype
PiteroS678 Aug 20, 2018
2e096a5
communication front - back
PiteroS678 Aug 20, 2018
010593b
added test to payload
PiteroS678 Aug 20, 2018
a6198eb
first version of endpoint to execute rerun
plutasnyy Aug 20, 2018
556f061
merge
plutasnyy Aug 20, 2018
e0bd59b
restored addCors in suite rerun srvlet
plutasnyy Aug 20, 2018
fbd14d9
communication front - back refactor
PiteroS678 Aug 20, 2018
956dcfa
work on rerun servlet
plutasnyy Aug 21, 2018
278d22b
Merge branch 'feature/rerun' of https://github.com/Cognifide/aet into…
plutasnyy Aug 21, 2018
c22ccee
upadted suite executor
plutasnyy Aug 21, 2018
f9d9660
cleared data in received suite
plutasnyy Aug 21, 2018
aa1d99d
small refactor to make servlet human readable
plutasnyy Aug 21, 2018
fd39331
added replacing test in database
plutasnyy Aug 21, 2018
20395cb
refactor
PiteroS678 Aug 22, 2018
48c1563
refactor
PiteroS678 Aug 22, 2018
b421341
license & refactor
PiteroS678 Aug 22, 2018
73b0abd
annotations fix
PiteroS678 Aug 22, 2018
6715f59
SuiteRerun update
PiteroS678 Aug 22, 2018
988f255
fixed clean daara from suite
plutasnyy Aug 22, 2018
c020d2f
changed overriding one test in mongo db from remove and add operation…
plutasnyy Aug 22, 2018
d4b3350
merged with master, updated annotations to 6.0
plutasnyy Aug 23, 2018
f7ca219
removed scr from rest-endpoint and resolved conflicts
plutasnyy Aug 23, 2018
bdf2fb9
merged with history and resolved conflicts
plutasnyy Aug 23, 2018
0765aae
added gson object in reponseAsJson calls
plutasnyy Aug 23, 2018
deb4cc9
resolved conflicts
plutasnyy Aug 23, 2018
140869e
rerun all tests
PiteroS678 Aug 23, 2018
0e9c74a
Merge branch 'feature/rerun' of https://github.com/Cognifide/aet into…
PiteroS678 Aug 23, 2018
fb8e612
rerun button on suite level
PiteroS678 Aug 23, 2018
a00b8a1
rerun button is now properly linked to function
PiteroS678 Aug 23, 2018
130a76b
Added response to client
PiteroS678 Aug 23, 2018
a8de89b
improve rerun to remove orphan artifacts
plutasnyy Aug 23, 2018
ba2cd9d
Merge remote-tracking branch 'origin/feature/rerun' into feature/clea…
plutasnyy Aug 23, 2018
53d9d97
cleaning in cleaner after tests
plutasnyy Aug 23, 2018
ea87d9d
New correlationId & timestamp for suite
PiteroS678 Aug 23, 2018
ee4c2ad
changed returened value by arftifacts dao mock in get artifacts ids
plutasnyy Aug 24, 2018
b5e85cb
added description to getArtifactsId in interfac and changed _id on ID…
plutasnyy Aug 24, 2018
f8d728d
removed unused functionality
plutasnyy Aug 24, 2018
89410ae
refresh fix
PiteroS678 Aug 24, 2018
903b24b
craeted tests for remove artifacts processor test
plutasnyy Aug 27, 2018
8f07000
add default constructor for artifatsDao in remove artifacts processor
plutasnyy Aug 27, 2018
cd9f968
fixed bug with removing all suites exclude first
plutasnyy Aug 27, 2018
130a069
changed way to agregating suites in cleaner, removed one step in router
plutasnyy Aug 27, 2018
94ded09
Merge remote-tracking branch 'origin/feature/rerun' into feature/clea…
plutasnyy Aug 27, 2018
03b8ea3
changed information in log
plutasnyy Aug 27, 2018
2d03479
updated documentation
plutasnyy Aug 27, 2018
05dbffd
removed constructor from SuiteAggregationCounter, added and removed b…
plutasnyy Aug 28, 2018
3e0303d
removed blank line
plutasnyy Aug 28, 2018
0af1cef
removed blank line
plutasnyy Aug 28, 2018
c5d11b1
updated description in metadataDAO
plutasnyy Aug 28, 2018
586cf82
renamed accesibility suite in partials
plutasnyy Aug 28, 2018
87f6567
removed blank line
plutasnyy Aug 28, 2018
3115a95
Merge branch 'feature/rerun' into feature/cleaner-removes-artifacts-a…
plutasnyy Aug 28, 2018
4bfedf0
renamed getArtifactsIds
plutasnyy Aug 28, 2018
1e367f6
renamed shouldBeKept
plutasnyy Aug 28, 2018
af28aa4
renamed parameter of setArftifactsIdToKeep in remove arftifacts proce…
plutasnyy Aug 28, 2018
47acf66
removed line
plutasnyy Aug 28, 2018
c1e494b
changed way to count suites for aggregate
plutasnyy Aug 28, 2018
b72b6ae
add information about rerun to test
plutasnyy Aug 28, 2018
dfd2e0d
updated changelog
plutasnyy Aug 28, 2018
e22bb69
updated changelog
plutasnyy Aug 28, 2018
e5f88e5
updated diagram
plutasnyy Aug 28, 2018
ce37513
reoreded functions in suite class
plutasnyy Aug 29, 2018
91f2305
created decorator pattern for rerun - suite/test/url wrappers
plutasnyy Aug 29, 2018
71c089a
moved wrappers to API module
plutasnyy Aug 30, 2018
82f76e0
craeted interface for strategy
plutasnyy Aug 30, 2018
bdc4bd0
prepared abstarctuion for strategy
plutasnyy Aug 30, 2018
f88ab76
Merge branch 'master' of https://github.com/Cognifide/aet into featur…
tkaik Aug 30, 2018
2b1c330
started work with runner
plutasnyy Aug 30, 2018
521428a
SuiteStatus servlet returns more detailed progress info
tkaik Aug 30, 2018
d7d2fd1
Added rerun status message
Aug 30, 2018
efd6fb2
Fixed reversed compare/collect progress log variables
tkaik Aug 30, 2018
374153f
first working version with new messages in runner
plutasnyy Aug 30, 2018
831ec35
Merge branch 'feature/rerun' of https://github.com/Cognifide/aet into…
plutasnyy Aug 30, 2018
bdee2da
merge
plutasnyy Aug 30, 2018
f443d1c
merge2
plutasnyy Aug 30, 2018
c500017
moved cleaning url direct to RunIndexWrapper
plutasnyy Aug 31, 2018
da0a5b9
add test rerun
plutasnyy Aug 31, 2018
ce07e0b
started work with url rerun
plutasnyy Aug 31, 2018
ad8b522
added rerun one url
plutasnyy Aug 31, 2018
02876c2
testUrl param now has no unicode characters
Aug 31, 2018
5e56e20
added skiping tests
plutasnyy Aug 31, 2018
cb735c3
Merge remote-tracking branch 'origin/feature/rerun' into feature/reru…
plutasnyy Aug 31, 2018
837feb0
removed consolelog
plutasnyy Aug 31, 2018
a59978f
cleaned after rename
plutasnyy Aug 31, 2018
09d6672
more cleaning
plutasnyy Aug 31, 2018
58fd3a3
fixed url for gulp
plutasnyy Aug 31, 2018
50e368d
changed runindexwrapper to factory
plutasnyy Sep 3, 2018
b2a0afd
removed ignore
plutasnyy Sep 3, 2018
93e9436
added dafault value count urls to solve test
plutasnyy Sep 3, 2018
1d6be4e
removed ignore:
plutasnyy Sep 3, 2018
fa10a6e
refactor tests in collect dispatchet test
plutasnyy Sep 3, 2018
5450a7c
removed unused functions
plutasnyy Sep 3, 2018
72b58a8
small refactor in suite rerun
plutasnyy Sep 3, 2018
4c1bcd7
fixed incorrect extension in suite rerun functions
plutasnyy Sep 3, 2018
9a4b71f
fixed gramars
plutasnyy Sep 3, 2018
6ec9096
renamed variables indexedSuite on runIndexWrapper
plutasnyy Sep 4, 2018
79ec038
Merge remote-tracking branch 'origin/master' into feature/rerun-chang…
plutasnyy Sep 4, 2018
a6701df
Merge branch 'feature/rerun' of https://github.com/Cognifide/aet into…
plutasnyy Sep 4, 2018
1146fa3
Merge remote-tracking branch 'origin/master' into feature/rerun
plutasnyy Sep 4, 2018
72aa7fa
Merge remote-tracking branch 'origin/master' into feature/cleaner-rem…
plutasnyy Sep 4, 2018
4972647
Merge branch 'feature/rerun-change-way-to-execute-suite' into feature…
plutasnyy Sep 4, 2018
edd6c5d
refactor processor strategy
plutasnyy Sep 7, 2018
7be20ba
cleaning in suite execution processor strategy
plutasnyy Sep 7, 2018
231ea33
created files for processors tests
plutasnyy Sep 7, 2018
520402d
add tests for run index wrapper
plutasnyy Sep 7, 2018
23bda3a
added test for url run index wrapper
plutasnyy Sep 7, 2018
9b338cd
add tests for test run index wrapper
plutasnyy Sep 7, 2018
54e7c3f
added test for suite suite run index wrapper
plutasnyy Sep 7, 2018
883f833
updated tests for run index wrapper
plutasnyy Sep 7, 2018
c5f892c
moved strategies to directory created specially for theirs
plutasnyy Sep 7, 2018
a98d951
removed unused imports
plutasnyy Sep 7, 2018
cb45bb3
update documentation in test executor
plutasnyy Sep 7, 2018
e954ac7
add documentation about Suite processing
plutasnyy Sep 8, 2018
4dc414d
fixed typos in documentation
plutasnyy Sep 8, 2018
d089a07
Merge remote-tracking branch 'origin/master' into feature/rerun
malaskowski Sep 10, 2018
acf4437
Merge remote-tracking branch 'origin/feature/rerun' into feature/reru…
plutasnyy Sep 10, 2018
6335fb5
add tests for run index wrapper
plutasnyy Sep 10, 2018
3112cd4
add tests for clean url from execution data
plutasnyy Sep 10, 2018
abcaed8
remove unused import
plutasnyy Sep 10, 2018
90ffdf5
add tests for processor strategy
plutasnyy Sep 10, 2018
c9c141d
craeted tests for suite test and url exection processor strategy
plutasnyy Sep 10, 2018
aaf3ab3
removed class
plutasnyy Sep 10, 2018
8d9fcd5
fixed wrong version incrementation
plutasnyy Sep 10, 2018
9f4c22a
Merge remote-tracking branch 'origin/master' into feature/rerun-chang…
plutasnyy Sep 10, 2018
4909046
Merge remote-tracking branch 'origin/master' into feature/rerun
plutasnyy Sep 10, 2018
bc500dc
Merge branch 'feature/rerun-change-way-to-execute-suite' into feature…
plutasnyy Sep 10, 2018
8c1d52a
changed way to update information about url rerun
plutasnyy Sep 11, 2018
648f823
removed usage of not existing function
plutasnyy Sep 11, 2018
0fee1db
start work with frontend
plutasnyy Sep 11, 2018
624da29
fix formatting in RunType
plutasnyy Sep 11, 2018
aeeefc5
changed returned type form test and url to optionals of test and url
plutasnyy Sep 11, 2018
4b66674
renmaed run decorator
plutasnyy Sep 11, 2018
39bb767
add uid
plutasnyy Sep 11, 2018
99959f1
changed usage of strategy in suite executor service
plutasnyy Sep 11, 2018
b72a58b
moved processor strategy mock to test directory
plutasnyy Sep 12, 2018
39c1554
fixed bug: rerun doesnt work because get() function was missing
plutasnyy Sep 12, 2018
fcbb7c2
fixed front end message about rerun
plutasnyy Sep 12, 2018
be44014
add very important brackets
plutasnyy Sep 12, 2018
188ed1a
changed logger name to lowercase
plutasnyy Sep 12, 2018
eac01e3
changed types in wrappers
plutasnyy Sep 12, 2018
4abab31
added h5 to information about rerun
plutasnyy Sep 12, 2018
ab35260
added condition for rerun infiromation on url page
plutasnyy Sep 12, 2018
b47ba4b
changed way to increment suite version
plutasnyy Sep 12, 2018
d915dd3
removed test from information about rerun:
plutasnyy Sep 12, 2018
c98ea26
added karaf endpoint
plutasnyy Sep 12, 2018
02c8c98
fixed typo
plutasnyy Sep 12, 2018
4a9fbf6
changed setting new suite version
plutasnyy Sep 12, 2018
caf218e
fixed / error
plutasnyy Sep 12, 2018
36420f8
fixed typos
plutasnyy Sep 12, 2018
49383c0
renamed wrappers package
plutasnyy Sep 12, 2018
9688e00
removed unused code
plutasnyy Sep 13, 2018
91ed8c4
changed uids in suite test url
plutasnyy Sep 13, 2018
98c81e2
added filters
plutasnyy Sep 13, 2018
f93d800
changed rerun's servlet endpoint
plutasnyy Sep 13, 2018
9028638
rerun button shows on only newest version of suite
plutasnyy Sep 13, 2018
e44f548
chenged uid
plutasnyy Sep 13, 2018
b07fa67
changed formating
plutasnyy Sep 13, 2018
dc50bd5
removed unnecesary casting
plutasnyy Sep 13, 2018
6c648e5
changed couting urls in test run index wrapper
plutasnyy Sep 13, 2018
4d27c1b
removed blank lines
plutasnyy Sep 13, 2018
6b81bba
Merge remote-tracking branch 'origin/master' into feature/rerun
plutasnyy Sep 13, 2018
08bce92
changed formating
plutasnyy Sep 13, 2018
6b8667a
changed urls
plutasnyy Sep 14, 2018
c8451cf
fixed NPE in get filters
plutasnyy Sep 14, 2018
278227b
Merge remote-tracking branch 'origin/master' into feature/cleaner-rem…
plutasnyy Sep 17, 2018
05a60cd
removed EMPTY SET from remove artifacts procesor tests
plutasnyy Sep 17, 2018
f20cf28
Merge branch 'feature/rerun' into feature/cleaner-removes-artifacts-a…
plutasnyy Sep 17, 2018
0c2cd28
added uid for full progress log
plutasnyy Sep 17, 2018
9bc6cde
added <T> for metadata run decorator
plutasnyy Sep 17, 2018
9af85c2
fixed formatting
plutasnyy Sep 17, 2018
5f60048
Merge branch 'milestone/rerun-one-test' into feature/rerun
plutasnyy Sep 17, 2018
74dba89
increase maxparams in eslint
plutasnyy Sep 19, 2018
3e10020
Merge remote-tracking branch 'origin/master' into feature/rerun-chang…
plutasnyy Sep 26, 2018
c97b06c
changed newArray to emptyList in getFilters function in comparator class
plutasnyy Sep 26, 2018
3a2f6ec
added uid to progress log
plutasnyy Sep 26, 2018
5e1c2c3
added parameter to RunIndexWrapper
plutasnyy Sep 26, 2018
dbc5a0d
fixed url in test executor documentation
plutasnyy Sep 26, 2018
4403542
moved static function to helper from basid data servlet
plutasnyy Sep 26, 2018
ad910a5
updated metadatao uid and way to calculate quantity urls in suite run…
plutasnyy Sep 26, 2018
69e6edd
add parameter to metadata run decorator
plutasnyy Sep 26, 2018
5621f56
resolve generic types for runindexwrapper
malaskowski Sep 26, 2018
7eefd43
fixed rerun url path
plutasnyy Sep 26, 2018
cfb375f
fixed type of meta data run in tests
plutasnyy Sep 26, 2018
9b63cd6
added import to artifact srevlet after moved functions to other class
plutasnyy Sep 26, 2018
fa6784d
removed consol logs
plutasnyy Sep 26, 2018
bdbf8eb
minor refactor types, added validation if test exist
plutasnyy Oct 1, 2018
37c8079
added information about rerun after page refresh
plutasnyy Oct 1, 2018
87fede7
Merge remote-tracking branch 'origin/master' into feature/cleaner-rem…
plutasnyy Oct 2, 2018
dedc37c
Merge pull request #337 from Cognifide/feature/rerun
plutasnyy Oct 2, 2018
1878579
merge with milestone/rerun, fixed conflicts
plutasnyy Oct 2, 2018
3143b41
Merge pull request #336 from Cognifide/feature/cleaner-removes-artifa…
plutasnyy Oct 2, 2018
d33ea41
changed description of rerun time under test to more descriptive'
plutasnyy Oct 15, 2018
7fb9c9b
changed css for rerun msg
plutasnyy Oct 15, 2018
b7d12b5
fixed formatting and sctructure of css calss in rerun message
plutasnyy Oct 18, 2018
3a32391
updated changelog
plutasnyy Oct 18, 2018
7ae5857
Merge pull request #395 from Cognifide/feature/minor-frontend-changes…
plutasnyy Oct 23, 2018
7a2bbf2
Merge remote-tracking branch 'origin/master' into milestone/rerun-one…
plutasnyy Oct 23, 2018
537c3c6
updated changelog
plutasnyy Oct 23, 2018
3fd1cb1
updated changelog
plutasnyy Oct 23, 2018
c2ad82f
Merge branch 'master' into milestone/rerun-one-test
plutasnyy Oct 24, 2018
17d9c71
moved setCorerlationID lower
plutasnyy Oct 24, 2018
b3a3eff
Merge branch 'master' of https://github.com/Cognifide/aet into milest…
tkaik Oct 25, 2018
27b5f3f
update docs
malaskowski Oct 25, 2018
df2edf4
changed logger to uppercase and refactored getUrl function in Test class
plutasnyy Oct 29, 2018
741e59f
Merge branch 'milestone/rerun-one-test' of https://github.com/Cognifi…
plutasnyy Oct 29, 2018
bc95428
resolved conflicts
plutasnyy Oct 29, 2018
67955be
fixed changelog
plutasnyy Nov 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to AET will be documented in this file.

## Unreleased
**List of changes that are finished but not yet released in any final version.**
- [PR-412](https://github.com/Cognifide/aet/pull/412) ([PR-336](https://github.com/Cognifide/aet/pull/336), [PR-337](https://github.com/Cognifide/aet/pull/337), [PR-395](https://github.com/Cognifide/aet/pull/395)) - Added rerun functionality for suite, test and url

## Version 3.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.cognifide.aet.communication.api.execution;

import com.cognifide.aet.communication.api.messages.FullProgressLog;
import org.apache.commons.lang3.StringUtils;

/**
Expand All @@ -26,13 +27,20 @@ public class SuiteStatusResult {

private String message;

private FullProgressLog progressLog;

public SuiteStatusResult(ProcessingStatus status) {
this(status, StringUtils.EMPTY);
}

public SuiteStatusResult(ProcessingStatus status, String message) {
this(status, message, null);
}

public SuiteStatusResult(ProcessingStatus status, String message, FullProgressLog progressLog) {
this.status = status;
this.message = message;
this.progressLog = progressLog;
}

/**
Expand All @@ -48,4 +56,8 @@ public ProcessingStatus getStatus() {
public String getMessage() {
return message;
}

public FullProgressLog getProgressLog() {
return progressLog;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public class CollectorJobData extends JobData {
* @param preferredBrowserId - id of preferred browser or null if the default one should be used
*/
public CollectorJobData(String company, String project, String suiteName, String testName,
List<Url> urls,
String proxy, String preferredBrowserId) {
List<Url> urls, String proxy, String preferredBrowserId) {
super(company, project, suiteName, testName);
this.urls = urls;
this.proxy = proxy;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* AET
*
* Copyright (C) 2013 Cognifide Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.cognifide.aet.communication.api.messages;

import java.io.Serializable;
import java.util.Arrays;
import org.apache.commons.lang3.StringUtils;

public class FullProgressLog implements Serializable {

private static final long serialVersionUID = -7331561874304014158L;

private ProgressLog compareLog;
private ProgressLog collectLog;

public FullProgressLog(ProgressLog collectLog, ProgressLog compareLog) {
this.collectLog = collectLog;
this.compareLog = compareLog;
}

public ProgressLog getCompareLog() {
return compareLog;
}

public ProgressLog getCollectLog() {
return collectLog;
}

@Override
public String toString() {
return StringUtils.join(Arrays.asList(compareLog, collectLog), " ::: ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.cognifide.aet.runner.processing;
package com.cognifide.aet.communication.api.messages;

public class ProgressLog {
import java.io.Serializable;

public class ProgressLog implements Serializable {

private static final long serialVersionUID = -3480689780301447508L;

private final String name;

private final int receivedMessagesSuccess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
/**
* Basic message used to send work progress via JMS.
*/
public class ProgressMessage extends TaskMessage<String> {

private static final long serialVersionUID = 490908210242015178L;
public class ProgressMessage extends TaskMessage<FullProgressLog> {
private static final long serialVersionUID = -428855447599621022L;

/**
* @param message - progress message.
*/
public ProgressMessage(String message) {
public ProgressMessage(FullProgressLog message) {
super(MessageType.PROGRESS, message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;

public class Comparator extends Operation implements Commentable, Named {

Expand All @@ -30,7 +31,7 @@ public class Comparator extends Operation implements Commentable, Named {

private ComparatorStepResult stepResult;

private final List<Operation> filters = new ArrayList<>();
private List<Operation> filters = new ArrayList<>();

private String comment;

Expand All @@ -49,6 +50,9 @@ public void setStepResult(ComparatorStepResult stepResult) {
}

public List<Operation> getFilters() {
if(filters == null){

Choose a reason for hiding this comment

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

is it possible to pass the condition?

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 for the review ;)
Unfortunately, it is possible because the model in mongo has null when you saving empty array.
You can find more details here: discussion

return Collections.emptyList();
}
return ImmutableList.copyOf(filters);
}

Expand All @@ -68,6 +72,10 @@ public void setStatistics(Statistics statistics) {
this.statistics = statistics;
}

public void setFilters(List<Operation> filters) {
this.filters = filters;
}

@Override
public void setComment(String comment) {
this.comment = comment;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* AET
*
* Copyright (C) 2013 Cognifide Limited
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.cognifide.aet.communication.api.metadata;

public enum RunType {
SUITE,
TEST,
URL,
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Valid;
Expand All @@ -43,7 +44,8 @@

public class Suite implements Serializable, Commentable, Named, Validatable {

private static final long serialVersionUID = 3602287822306302730L;
private static final long serialVersionUID = -3225670696134184553L;

private static final Gson GSON_FOR_JSON = new GsonBuilder()
.registerTypeHierarchyAdapter(Collection.class, new CollectionSerializer())
.registerTypeHierarchyAdapter(Map.class, new MapSerializer())
Expand All @@ -53,7 +55,7 @@ public class Suite implements Serializable, Commentable, Named, Validatable {
}.getType();

@NotBlank
private final String correlationId;
private String correlationId;

@NotBlank
@Size(max = 30)
Expand Down Expand Up @@ -130,6 +132,17 @@ public List<Test> getTests() {
return tests;
}

public Optional<Test> getTest(String testName){
Test testToReturn = null;
for (Test test: this.tests) {
if(test.getName().equals(testName)){
testToReturn = test;
break;
}
}
return Optional.ofNullable(testToReturn);
}

public boolean addTest(Test test) {
return tests.add(test);
}
Expand Down Expand Up @@ -191,10 +204,14 @@ public String toString() {
.toString();
}

public void setVersion(long version) {
public void setVersion(Long version) {

Choose a reason for hiding this comment

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

is it expected that version could be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,
I remember that it is strongly connected with updating version of a suite. Suite version is null during the first run of and typical run but during rerun, the suite has a version, so I needed to allow on setting empty version and set the same state like in a typical run. I didn't see a better way to set the correct suite's version during the rerun.

this.version = version;
}

public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}

@Override
public void validate(final Set<String> ignoreFields) throws ValidatorException {
Set<ConstraintViolation<Suite>> errors = FluentIterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import com.google.common.base.MoreObjects;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;

public class Test implements Serializable, Commentable, Named {

private static final long serialVersionUID = -220660503633061510L;
private static final long serialVersionUID = 6761670624207862805L;

@NotBlank
private final String name;
Expand All @@ -38,7 +39,7 @@ public class Test implements Serializable, Commentable, Named {

@Valid
@NotNull(message = "Test must have at least one url")
private final Set<Url> urls = new HashSet<>();
private Set<Url> urls = new HashSet<>();

/**
* @param name - name of a test
Expand Down Expand Up @@ -115,4 +116,20 @@ public String toString() {
.add("name", name)
.toString();
}

public Optional<Url> getUrl(String urlName) {
return this.urls.stream()
.filter(url -> url.getName().equals(urlName))
.findFirst();
}

public void setUrls(Set<Url> urls) {
this.urls = urls;
}

public void setRerunUrls() {
for (Url url: this.urls) {
url.setReran();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.cognifide.aet.communication.api.metadata;

import com.cognifide.aet.communication.api.metadata.Suite.Timestamp;
import com.google.common.base.MoreObjects;
import java.io.Serializable;
import java.util.ArrayList;
Expand All @@ -25,7 +26,7 @@

public class Url implements Serializable, Commentable, Named {

private static final long serialVersionUID = -8235442513988955778L;
private static final long serialVersionUID = -8223780516461495807L;

@NotBlank
private final String name;
Expand All @@ -45,6 +46,10 @@ public class Url implements Serializable, Commentable, Named {
@NotNull
private final List<Step> steps = new ArrayList<>();

private boolean isReran;

private Timestamp rerunTimestamp;

public Url(String name, String url, String domain) {
this.name = name;
this.url = url;
Expand Down Expand Up @@ -123,4 +128,10 @@ public boolean equals(Object o) {
public int hashCode() {
return java.util.Objects.hash(name);
}

public void setReran() {
isReran = true;
rerunTimestamp = new Timestamp(System.currentTimeMillis());
}

}
Loading