├── toughday ├── .gitignore ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── adobe │ │ │ └── qe │ │ │ └── toughday │ │ │ ├── internal │ │ │ └── core │ │ │ │ └── benchmarkmocks │ │ │ │ ├── MockProxyFromFactory.java │ │ │ │ ├── MockWorkerSubclass.java │ │ │ │ ├── MockProxyFactory.java │ │ │ │ ├── MockProxy.java │ │ │ │ └── MockDynamicProxyFactory.java │ │ │ ├── api │ │ │ └── core │ │ │ │ └── runnermocks │ │ │ │ ├── MockThrowable.java │ │ │ │ ├── MockTestRunner.java │ │ │ │ └── MockInheritanceTest.java │ │ │ ├── MockTestTwin.java │ │ │ ├── mocks │ │ │ ├── MockRunMap.java │ │ │ └── MockTest.java │ │ │ ├── feeders │ │ │ ├── MockFeederTest2.java │ │ │ └── MockFeederTest.java │ │ │ ├── MockTest.java │ │ │ ├── TestContentPackageIsPresent.java │ │ │ ├── MockTestRequiredField.java │ │ │ ├── MockTestTwoRequiredFields.java │ │ │ └── TestInternalSuiteStructural.java │ └── main │ │ ├── java │ │ └── com │ │ │ └── adobe │ │ │ └── qe │ │ │ └── toughday │ │ │ ├── internal │ │ │ └── core │ │ │ │ ├── config │ │ │ │ ├── ParserArgHelp.java │ │ │ │ ├── ConfigurationParser.java │ │ │ │ ├── ConfigAction.java │ │ │ │ └── parsers │ │ │ │ │ └── yaml │ │ │ │ │ ├── YamlDumpExcludeAction.java │ │ │ │ │ ├── YamlDumpAction.java │ │ │ │ │ ├── YamlDumpAddAction.java │ │ │ │ │ ├── YamlDumpConfigAction.java │ │ │ │ │ ├── YamlAction.java │ │ │ │ │ └── YamlParseAction.java │ │ │ │ ├── SuiteSetup.java │ │ │ │ └── engine │ │ │ │ ├── AsyncEngineWorker.java │ │ │ │ ├── RunMode.java │ │ │ │ ├── PublishMode.java │ │ │ │ └── AsyncTestWorker.java │ │ │ ├── metrics │ │ │ ├── Failed.java │ │ │ ├── Skipped.java │ │ │ ├── Min.java │ │ │ ├── Passed.java │ │ │ ├── Max.java │ │ │ ├── Median.java │ │ │ ├── StdDev.java │ │ │ ├── Name.java │ │ │ ├── RealTP.java │ │ │ ├── Timestamp.java │ │ │ ├── Average.java │ │ │ ├── MetricResultImpl.java │ │ │ └── Percentile.java │ │ │ └── Main.java │ │ └── resources │ │ └── log4j2.yaml └── README.md ├── .gitignore ├── aem-td2-core-tests └── src │ └── main │ ├── resources │ ├── image.png │ └── document.pdf │ └── java │ └── com │ └── adobe │ └── qe │ └── toughday │ └── tests │ ├── samplecontent │ └── SampleContent.java │ └── sequential │ ├── GetHomepageTest.java │ ├── image │ └── DeleteImageTest.java │ ├── search │ └── QueryBuilderTest.java │ └── GetTest.java ├── toughday_sample ├── jcr_root │ ├── content │ │ ├── dam │ │ │ ├── toughday │ │ │ │ ├── _jcr_content │ │ │ │ │ ├── folderThumbnail │ │ │ │ │ └── folderThumbnail.dir │ │ │ │ │ │ └── .content.xml │ │ │ │ ├── fr │ │ │ │ │ ├── _jcr_content │ │ │ │ │ │ ├── folderThumbnail │ │ │ │ │ │ └── folderThumbnail.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ ├── ToughDay.jpeg │ │ │ │ │ │ ├── _jcr_content │ │ │ │ │ │ │ └── renditions │ │ │ │ │ │ │ │ ├── original │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.48.48.png │ │ │ │ │ │ │ │ ├── cq5dam.web.1280.1280.jpeg │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.140.100.png │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.319.319.png │ │ │ │ │ │ │ │ ├── cq5dam.web.1280.1280.jpeg.dir │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.140.100.png.dir │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.319.319.png.dir │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ │ ├── cq5dam.thumbnail.48.48.png.dir │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ │ └── original.dir │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── .content.xml │ │ │ │ ├── ToughDay.jpeg │ │ │ │ │ ├── _jcr_content │ │ │ │ │ │ └── renditions │ │ │ │ │ │ │ ├── original │ │ │ │ │ │ │ ├── cq5dam.thumbnail.48.48.png │ │ │ │ │ │ │ ├── cq5dam.web.1280.1280.jpeg │ │ │ │ │ │ │ ├── cq5dam.thumbnail.140.100.png │ │ │ │ │ │ │ ├── cq5dam.thumbnail.319.319.png │ │ │ │ │ │ │ ├── cq5dam.thumbnail.140.100.png.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ ├── cq5dam.thumbnail.319.319.png.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ ├── cq5dam.thumbnail.48.48.png.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ ├── cq5dam.web.1280.1280.jpeg.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ └── original.dir │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ └── .content.xml │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ ├── toughday │ │ │ └── .content.xml │ │ └── .content.xml │ ├── conf │ │ ├── toughday-templates │ │ │ ├── settings │ │ │ │ ├── wcm │ │ │ │ │ ├── templates │ │ │ │ │ │ ├── toughday-template │ │ │ │ │ │ │ ├── thumbnail.png │ │ │ │ │ │ │ ├── thumbnail.png.dir │ │ │ │ │ │ │ │ ├── _jcr_content │ │ │ │ │ │ │ │ │ └── _dam_thumbnails │ │ │ │ │ │ │ │ │ │ ├── _dam_thumbnail_48.png │ │ │ │ │ │ │ │ │ │ ├── _dam_thumbnail_300.png │ │ │ │ │ │ │ │ │ │ └── _dam_thumbnail_319.png │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ │ ├── policies │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ │ └── structure │ │ │ │ │ │ │ │ └── .content.xml │ │ │ │ │ │ ├── .content.xml │ │ │ │ │ │ └── _rep_policy.xml │ │ │ │ │ ├── .content.xml │ │ │ │ │ └── policies │ │ │ │ │ │ └── _rep_policy.xml │ │ │ │ └── .content.xml │ │ │ └── .content.xml │ │ └── .content.xml │ └── .content.xml └── META-INF │ └── vault │ ├── filter.xml │ ├── properties.xml │ └── definition │ └── .content.xml ├── toughday_tests_sample ├── README.md ├── src │ └── main │ │ └── java │ │ └── com │ │ └── adobe │ │ └── qe │ │ └── toughday │ │ └── tests │ │ ├── Worker.java │ │ ├── EnhancedWorker.java │ │ ├── WorkerProxyFactory.java │ │ ├── AEMHello.java │ │ ├── MyTestRunner.java │ │ ├── MyTestBase.java │ │ ├── CompositeHello.java │ │ └── WorkerProxy.java └── pom.xml ├── ISSUE_TEMPLATE.md ├── toughday_yaml_configs ├── publish.yaml └── toughday.yaml ├── toughday2-api └── src │ ├── main │ └── java │ │ └── com │ │ └── adobe │ │ └── qe │ │ └── toughday │ │ ├── internal │ │ └── core │ │ │ ├── Timestamp.java │ │ │ ├── UUIDTestId.java │ │ │ └── benckmark │ │ │ └── ImmutableResultInfo.java │ │ ├── api │ │ ├── annotations │ │ │ ├── labels │ │ │ │ ├── NotNull.java │ │ │ │ ├── Nullable.java │ │ │ │ ├── ThreadSafe.java │ │ │ │ └── NotThreadSafe.java │ │ │ ├── Tag.java │ │ │ ├── feeders │ │ │ │ ├── FeederGet.java │ │ │ │ └── FeederSet.java │ │ │ ├── Setup.java │ │ │ ├── Before.java │ │ │ ├── Name.java │ │ │ ├── Description.java │ │ │ ├── Internal.java │ │ │ ├── After.java │ │ │ ├── CloneSetup.java │ │ │ ├── ConfigArgGet.java │ │ │ └── ConfigArgSet.java │ │ ├── feeders │ │ │ ├── OutputFeeder.java │ │ │ ├── Feeder.java │ │ │ └── InputFeeder.java │ │ ├── core │ │ │ ├── benchmark │ │ │ │ ├── signatures │ │ │ │ │ ├── Callable.java │ │ │ │ │ ├── VoidCallable.java │ │ │ │ │ ├── InjectTestResultCallable.java │ │ │ │ │ └── VoidInjectTestResultCallable.java │ │ │ │ ├── ResultInfo.java │ │ │ │ ├── ProxyFactory.java │ │ │ │ └── Proxy.java │ │ │ ├── ToughDayException.java │ │ │ ├── ChildTestFailedException.java │ │ │ ├── SkippedTestException.java │ │ │ ├── config │ │ │ │ └── GlobalArgs.java │ │ │ ├── SequentialTest.java │ │ │ ├── NamedObject.java │ │ │ ├── MetricResult.java │ │ │ ├── NamedObjectImpl.java │ │ │ ├── TestId.java │ │ │ └── AssumptionUtils.java │ │ └── runners │ │ │ ├── SequentialTestRunner.java │ │ │ └── CompositeTestRunner.java │ │ └── feeders │ │ ├── IncrementedStringValueFeeder.java │ │ ├── NoopFeeder.java │ │ ├── Base64DecoderFeeder.java │ │ ├── StringValueFeeder.java │ │ └── ListFeeder.java │ └── test │ └── java │ └── com │ └── adobe │ └── qe │ └── toughday │ ├── structural │ ├── TestTDConstraints.java │ ├── TestConfigGetAnnotatedMethod.java │ ├── TestFeederClass.java │ └── TestConstructor.java │ └── LogFileEraser.java ├── README.md ├── CONTRIBUTING.md ├── pom.xml ├── sling-td2 └── pom.xml ├── sling-td2-tests-parent └── pom.xml ├── aem-td2-tests-parent └── pom.xml └── PULL_REQUEST_TEMPLATE.md /toughday/.gitignore: -------------------------------------------------------------------------------- 1 | dependency-reduced-pom.xml 2 | .DS_Store* 3 | */.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | *.proj 4 | target/ 5 | *.class 6 | *.jar 7 | *.log 8 | workspace/ 9 | dependency-reduced-pom.xml 10 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/resources/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/aem-td2-core-tests/src/main/resources/image.png -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/resources/document.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/aem-td2-core-tests/src/main/resources/document.pdf -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/_jcr_content/folderThumbnail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/_jcr_content/folderThumbnail -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/_jcr_content/folderThumbnail: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/_jcr_content/folderThumbnail -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/original: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/original -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/original: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/original -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg -------------------------------------------------------------------------------- /toughday_sample/META-INF/vault/filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png -------------------------------------------------------------------------------- /toughday_tests_sample/README.md: -------------------------------------------------------------------------------- 1 | # Running new tests in toughday2 2 | 3 | https://wiki.corp.adobe.com/display/cq5/How+to+create+and+add+extensions+into+ToughDay 4 | 5 | ``` 6 | java -jar ToughDay.jar --host=localhost --add pathToJarFile/ExtensionFileName.jar --add MyDemoTest 7 | ``` 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Expected Behaviour 2 | 3 | ### Actual Behaviour 4 | 5 | ### Reproduce Scenario (including but not limited to) 6 | 7 | #### Steps to Reproduce 8 | 9 | #### Platform and Version 10 | 11 | #### Sample Code that illustrates the problem 12 | 13 | #### Logs taken while reproducing problem 14 | -------------------------------------------------------------------------------- /toughday_yaml_configs/publish.yaml: -------------------------------------------------------------------------------- 1 | tests: 2 | - add : GetTest 3 | properties: 4 | name : Get1 5 | path : / 6 | weight : 1 7 | - add : GetTest 8 | properties: 9 | name : Get2 10 | path : / 11 | weight : 1 12 | - add : GetHomepageTest 13 | properties: 14 | weight: 1 15 | 16 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_48.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_300.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/toughday2/HEAD/toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/_jcr_content/_dam_thumbnails/_dam_thumbnail_319.png -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/internal/core/Timestamp.java: -------------------------------------------------------------------------------- 1 | package com.adobe.qe.toughday.internal.core; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | public class Timestamp { 7 | public static final String START_TIME = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm").format(new Date()); 8 | 9 | private Timestamp() {} 10 | } 11 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/toughday/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/_jcr_content/renditions/original.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/thumbnail.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.140.100.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.319.319.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/cq5dam.thumbnail.48.48.png.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/_jcr_content/renditions/original.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/_jcr_content/folderThumbnail.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/_jcr_content/folderThumbnail.dir/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Tough Day 2.0 2 | ============= 3 | 4 | Download 5 | ======== 6 | 7 | You can download the latest version from: https://repo.adobe.com/nexus/content/repositories/releases/com/adobe/qe/toughday2 8 | 9 | Usage 10 | ===== 11 | 12 | https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/tough-day.html 13 | https://github.com/adobe/toughday2/wiki 14 | 15 | Development 16 | ========== 17 | 18 | ## Building 19 | $ __mvn clean package__ (using the reactor pom) 20 | 21 | ## Contributing 22 | PRs and issues are welcome, please reade our [CONTRIBUTING guideline](https://github.com/adobe/toughday2/blob/master/CONTRIBUTING.md). 23 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/labels/NotNull.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.labels; 13 | 14 | public @interface NotNull { 15 | } 16 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/labels/Nullable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.labels; 13 | 14 | public @interface Nullable { 15 | } 16 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/labels/ThreadSafe.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.labels; 13 | 14 | public @interface ThreadSafe { 15 | } 16 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/internal/core/benchmarkmocks/MockProxyFromFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benchmarkmocks; 13 | 14 | public class MockProxyFromFactory extends MockProxy { 15 | } 16 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/internal/core/benchmarkmocks/MockWorkerSubclass.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benchmarkmocks; 13 | 14 | 15 | public class MockWorkerSubclass extends MockWorker { 16 | } 17 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/labels/NotThreadSafe.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.labels; 13 | 14 | public @interface NotThreadSafe { 15 | String description() default ""; 16 | } 17 | -------------------------------------------------------------------------------- /toughday_sample/META-INF/vault/properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FileVault Package Properties 5 | admin 6 | toughday_sample 7 | 2016-12-19T15:46:55.529+02:00 8 | admin 9 | 2016-12-19T15:46:55.891+02:00 10 | 2 11 | 2.0 12 | 13 | 2 14 | 15 | 2016-12-19T15:46:55.529+02:00 16 | com.adobe.qe.toughday 17 | admin 18 | 19 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/feeders/OutputFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.feeders; 13 | 14 | public interface OutputFeeder extends Feeder { 15 | void push(T item, Object... keys) throws Exception; 16 | } 17 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/signatures/Callable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark.signatures; 13 | 14 | @FunctionalInterface 15 | public interface Callable { 16 | T call() throws Throwable; 17 | } -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/signatures/VoidCallable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark.signatures; 13 | 14 | @FunctionalInterface 15 | public interface VoidCallable { 16 | void call() throws Throwable; 17 | } -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/ParserArgHelp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config; 13 | 14 | public interface ParserArgHelp { 15 | String name(); 16 | String defaultValue(); 17 | String description(); 18 | } 19 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/SuiteSetup.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core; 13 | 14 | /** 15 | * Common interface for all Suite setup steps. 16 | */ 17 | public interface SuiteSetup { 18 | void setup() throws Exception; 19 | } 20 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/feeders/Feeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.feeders; 13 | 14 | import com.adobe.qe.toughday.api.core.NamedObject; 15 | 16 | public interface Feeder extends NamedObject { 17 | void init() throws Exception; 18 | } 19 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/api/core/runnermocks/MockThrowable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.runnermocks; 13 | 14 | public class MockThrowable extends Throwable { 15 | public MockThrowable(String message) { 16 | super(message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/policies/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/ConfigurationParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config; 13 | 14 | /** 15 | * Common interface for all parsers. 16 | */ 17 | public interface ConfigurationParser { 18 | ConfigParams parse(String[] cmdLineArgs); 19 | } 20 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/Worker.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | public class Worker { 15 | public long doWork() throws Throwable { return doWork(40); } 16 | public long doWork(long millis) throws Throwable { Thread.sleep(millis); return millis; } 17 | } -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/feeders/InputFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.feeders; 13 | 14 | import com.adobe.qe.toughday.api.annotations.labels.Nullable; 15 | 16 | public interface InputFeeder extends Feeder { 17 | @Nullable T get(Object... keys) throws Exception; 18 | } 19 | -------------------------------------------------------------------------------- /toughday2-api/src/test/java/com/adobe/qe/toughday/structural/TestTDConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.structural; 13 | 14 | /** 15 | * We use this class for defining a category of tests that should be runned when users try to create their own extension jar file. 16 | */ 17 | 18 | public class TestTDConstraints { 19 | } 20 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/policies/_rep_policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/_rep_policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/EnhancedWorker.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | public class EnhancedWorker extends Worker { 15 | public long muchWork(long millis) throws Throwable { 16 | doWork(millis); 17 | System.out.println("I am exhausted!"); 18 | return millis; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /toughday_tests_sample/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | 5 | com.adobe.qe 6 | aem-td2-tests-parent 7 | 0.9.3-SNAPSHOT 8 | ../aem-td2-tests-parent/pom.xml 9 | 10 | 11 | com.adobe.qe 12 | toughday2-tests-sample 13 | jar 14 | 0.1.0-SNAPSHOT 15 | 16 | 17 | 18 | Apache License, Version 2.0 19 | https://www.apache.org/licenses/LICENSE-2.0.txt 20 | repo 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/signatures/InjectTestResultCallable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark.signatures; 13 | 14 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 15 | 16 | @FunctionalInterface 17 | public interface InjectTestResultCallable { 18 | T call(TestResult testResult) throws Throwable; 19 | } -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/ConfigAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config; 13 | 14 | import java.util.Map; 15 | 16 | public interface ConfigAction { 17 | String value(); 18 | void apply(ConfigParams configParams, String identifier, Map metaInfo); 19 | String actionParams(); 20 | String actionDescription(); 21 | } -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/signatures/VoidInjectTestResultCallable.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark.signatures; 13 | 14 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 15 | 16 | @FunctionalInterface 17 | public interface VoidInjectTestResultCallable { 18 | void call(TestResult testResult) throws Throwable; 19 | } 20 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Tag.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Target(value = ElementType.TYPE) 21 | public @interface Tag { 22 | String[] tags() default {}; 23 | } 24 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/feeders/FeederGet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.feeders; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Target(value = ElementType.METHOD) 21 | public @interface FeederGet { 22 | String desc() default ""; 23 | } 24 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/ToughDayException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | /** 15 | * Generic ToughDay exception. 16 | */ 17 | public class ToughDayException extends Exception { 18 | public ToughDayException(String message, Throwable throwable) { 19 | super(message, throwable); 20 | } 21 | 22 | public ToughDayException(Throwable throwable) { 23 | super(throwable.getMessage(), throwable); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/ChildTestFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | /** 15 | * Exception for failing composite tests in case a child test fails. 16 | */ 17 | public class ChildTestFailedException extends ToughDayException { 18 | public ChildTestFailedException(String message, Throwable e) { super(message, e);} 19 | 20 | public ChildTestFailedException(Throwable e) { 21 | super(e.getMessage(), e); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Setup.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Hook for doing some setup work before the test clones are created. 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target(value = ElementType.METHOD) 24 | public @interface Setup { 25 | } 26 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Before.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Annotation for executing a method before each run of a test. 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target(value = ElementType.METHOD) 24 | public @interface Before { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /toughday_yaml_configs/toughday.yaml: -------------------------------------------------------------------------------- 1 | globals: 2 | port : 4502 3 | 4 | runmode: 5 | type : normal 6 | waittime : 300 7 | concurrency : 200 8 | 9 | publishmode: 10 | type : simple 11 | 12 | tests: 13 | - add : CreateLiveCopyTreeTest 14 | properties : 15 | name : CreateLiveCopy 16 | weight : 5 17 | base : 5 18 | sourcepagetitle : IAmAPage 19 | 20 | - add : CreateAssetTreeTest 21 | properties : 22 | name : UploadAsset 23 | weight : 5 24 | base : 3 25 | foldertitle : IAmAFolder 26 | assettitle : IAmAnAsset 27 | 28 | - add : DeleteImageTest 29 | properties : 30 | name : DeleteAsset 31 | weight : 5 32 | 33 | - add : QueryBuilderTest 34 | properties : 35 | name : Query 36 | weight : 10 37 | query : type=nt:unstructured&group.1_path=/libs&orderby=@jcr:score&orderby.sort=desc 38 | 39 | - add : GetHomepageTest 40 | properties : 41 | name : GetHomepage 42 | weight : 75 43 | 44 | publishers: 45 | - add : ConsolePublisher 46 | - add : CSVPublisher 47 | properties : 48 | filepath : my_results.csv 49 | append : true 50 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Name.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target(value = ElementType.TYPE) 22 | public @interface Name { 23 | /** 24 | * The name of the test class 25 | * @return 26 | */ 27 | String name(); 28 | } 29 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/java/com/adobe/qe/toughday/tests/samplecontent/SampleContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests.samplecontent; 13 | 14 | public class SampleContent { 15 | 16 | public static final String TOUGHDAY_TEMPLATE = "/conf/toughday-templates/settings/wcm/templates/toughday-template"; 17 | public static final String TOUGHDAY_SITE = "/content/toughday"; 18 | public static final String TOUGHDAY_DAM_FOLDER = "/content/dam/toughday"; 19 | 20 | private SampleContent() { 21 | //no-op 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Description.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Target({ElementType.TYPE}) 21 | public @interface Description { 22 | /** 23 | * The text description of the class 24 | * @return 25 | */ 26 | String desc(); 27 | } 28 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/Internal.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Annotation for classes that need to be excluded from the CLI help. Currently supported: tests and publishers. 21 | */ 22 | @Retention(RetentionPolicy.RUNTIME) 23 | @Target(value = ElementType.TYPE) 24 | public @interface Internal { 25 | } 26 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/WorkerProxyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.benchmark.Benchmark; 16 | import com.adobe.qe.toughday.api.core.benchmark.ProxyFactory; 17 | 18 | public class WorkerProxyFactory implements ProxyFactory { 19 | @Override 20 | public Worker createProxy(Worker target, AbstractTest test, Benchmark benchmark) { 21 | return new WorkerProxy("Such info!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/feeders/IncrementedStringValueFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import java.util.concurrent.atomic.AtomicLong; 15 | 16 | public class IncrementedStringValueFeeder extends StringValueFeeder { 17 | private AtomicLong current = new AtomicLong(0); 18 | 19 | @Override 20 | public String get(Object... keys) throws Exception { 21 | return super.get() + current.getAndIncrement(); 22 | } 23 | 24 | @Override 25 | public void init() throws Exception { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/AEMHello.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.tests.sequential.AEMTestBase; 16 | 17 | public class AEMHello extends AEMTestBase { 18 | @Override 19 | public void test() throws Throwable { 20 | benchmark().measure(this, "CRXDE", getDefaultClient()).doGet("/crx/de"); 21 | } 22 | 23 | @Override 24 | public AbstractTest newInstance() { 25 | return new AEMHello(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/feeders/FeederSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations.feeders; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @Target(value = ElementType.METHOD) 21 | public @interface FeederSet { 22 | boolean required() default true; 23 | String desc() default ""; 24 | boolean allowNoopReplacement() default true; 25 | } 26 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/SkippedTestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | /** 15 | * Exception for skipping tests in case a dependency test failed/was not executed. 16 | */ 17 | public class SkippedTestException extends ToughDayException { 18 | public SkippedTestException(Throwable e) { 19 | super(e.getMessage(), e); 20 | } 21 | 22 | public SkippedTestException(String message, Throwable e) { 23 | super(message, e); 24 | } 25 | 26 | public SkippedTestException(String message) { super(message, null); } 27 | } 28 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Grp-AEM-ToughDay@adobe.com](mailto:Grp-AEM-ToughDay@adobe.com). 10 | 11 | ## Contributor License Agreement 12 | 13 | All third-party contributions to this project must be accompanied by a signed contributor license agreement. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html). You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go! 14 | 15 | ## Code Reviews 16 | 17 | All submissions should come in the form of pull requests and need to be reviewed by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) for more information on sending pull requests. 18 | 19 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when submitting a pull request! 20 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/After.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Annotation for executing a method after each run of a test. 21 | * The method is guaranteed to be called even if the test fails and Exceptions are thrown. 22 | */ 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Target(value = ElementType.METHOD) 25 | public @interface After { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/engine/AsyncEngineWorker.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.engine; 13 | 14 | /** 15 | * Base class for all async workers in engine. 16 | */ 17 | public abstract class AsyncEngineWorker implements Runnable { 18 | private boolean finish = false; 19 | 20 | /** 21 | * Method for correctly shutting down a worker. 22 | */ 23 | public void finishExecution() { 24 | finish = true; 25 | } 26 | 27 | /** 28 | * Method for checking if a worker has finished. 29 | */ 30 | public boolean isFinished() { return finish; } 31 | } 32 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/ResultInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark; 13 | 14 | import com.adobe.qe.toughday.api.annotations.labels.Nullable; 15 | 16 | /** 17 | * A wrapper over the outcome of a test run. 18 | */ 19 | public interface ResultInfo { 20 | /** 21 | * The {@link TestResult} generated 22 | */ 23 | TestResult getTestResult(); 24 | 25 | /** 26 | * (Optional) The return value 27 | */ 28 | @Nullable R getReturnValue(); 29 | 30 | /** 31 | * Any throwable that might have occurred 32 | */ 33 | @Nullable Throwable getThrowable(); 34 | } 35 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlDumpExcludeAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | 15 | import com.adobe.qe.toughday.internal.core.config.Actions; 16 | 17 | /** 18 | * Specifies how the exclude action is dumped when generating a yaml configuration file. 19 | */ 20 | public class YamlDumpExcludeAction extends YamlDumpAction { 21 | 22 | public YamlDumpExcludeAction(String identifier) { 23 | this.action = Actions.EXCLUDE; 24 | this.identifier = identifier; 25 | } 26 | 27 | public String getExclude() { 28 | return identifier; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Failed.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Number of fails.") 18 | public class Failed extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getFailRuns(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%d"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return ""; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Skipped.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Number of skipped runs.") 18 | public class Skipped extends Metric { 19 | @Override 20 | public Object getValue(RunMap.TestStatistics testStatistics) { 21 | return testStatistics.getSkippedRuns(); 22 | } 23 | 24 | @Override 25 | public String getFormat() { 26 | return "%d"; 27 | } 28 | 29 | @Override 30 | public String getUnitOfMeasure() { 31 | return ""; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/engine/RunMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.engine; 13 | 14 | import com.adobe.qe.toughday.api.core.RunMap; 15 | 16 | import java.util.Collection; 17 | import java.util.concurrent.ExecutorService; 18 | 19 | public interface RunMode { 20 | void runTests(Engine engine) throws Exception; 21 | void finishExecutionAndAwait(); 22 | ExecutorService getExecutorService(); 23 | RunContext getRunContext(); 24 | 25 | interface RunContext { 26 | Collection getTestWorkers(); 27 | Collection getRunMaps(); 28 | boolean isRunFinished(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Min.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Lowest duration of test execution.") 18 | public class Min extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getMinDuration(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%d"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return "ms"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Passed.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Number of successful runs.") 18 | public class Passed extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getTotalRuns(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%d"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return ""; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.adobe.qe 5 | toughday2.reactor 6 | pom 7 | 0.1.0-SNAPSHOT 8 | 9 | 10 | 11 | Apache License, Version 2.0 12 | https://www.apache.org/licenses/LICENSE-2.0.txt 13 | repo 14 | 15 | 16 | 17 | 18 | scm:git:git@github.com:adobe/toughday2.git 19 | scm:git:git@github.com:adobe/toughday2.git 20 | https://github.com/adobe/toughday2/ 21 | HEAD 22 | 23 | 24 | 25 | toughday2-api 26 | toughday2-tests-parent 27 | sling-td2 28 | sling-td2-tests-parent 29 | aem-td2-core-tests 30 | toughday_sample 31 | toughday 32 | aem-td2-tests-parent 33 | toughday_tests_sample 34 | 35 | 36 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Max.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Highest duration of test execution.") 18 | public class Max extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getMaxDuration(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%d"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return "ms"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlDumpAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | import com.adobe.qe.toughday.internal.core.config.Actions; 15 | 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | public abstract class YamlDumpAction { 20 | 21 | protected Map properties = new HashMap<>(); 22 | protected String identifier; 23 | protected Actions action; 24 | 25 | public void setProperties(Map properties) { 26 | this.properties = properties; 27 | } 28 | 29 | public Map getProperties() { 30 | return properties; 31 | } 32 | } -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Median.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Computed median duration of all test executions.") 18 | public class Median extends Metric{ 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getMedianDuration(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%d"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return "ms"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/StdDev.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Standard deviation.") 18 | public class StdDev extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getStandardDeviation(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%." + this.getDecimals() + "f"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return "ms"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/config/GlobalArgs.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.config; 13 | 14 | import org.apache.logging.log4j.Level; 15 | 16 | public interface GlobalArgs { 17 | long getDuration(); 18 | long getTimeout(); 19 | String getHost(); 20 | int getPort(); 21 | String getUser(); 22 | String getPassword(); 23 | String getProtocol(); 24 | String getAuthMethod(); 25 | boolean getInstallSampleContent(); 26 | String getContextPath(); 27 | Level getLogLevel(); 28 | boolean getDryRun(); 29 | boolean getSaveConfig(); 30 | boolean getShowSteps(); 31 | boolean getHostValidationEnabled(); 32 | String getLogPath(); 33 | } 34 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/CloneSetup.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Annotation for executing a method once before any runs of any replication (clone) of a test. 21 | * Guaranteed to be executed only once, no matter how many threads have a replica of the test. 22 | * 23 | * @deprecated use {@link Setup} instead 24 | */ 25 | @Deprecated 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(value = ElementType.METHOD) 28 | public @interface CloneSetup { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/SequentialTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | import com.adobe.qe.toughday.api.runners.SequentialTestRunner; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public abstract class SequentialTest extends AbstractTest { 20 | private static final List noChildren = new ArrayList<>(); 21 | 22 | @Override 23 | public List getChildren() { 24 | return noChildren; 25 | } 26 | 27 | @Override 28 | public Class getTestRunnerClass() { 29 | return SequentialTestRunner.class; 30 | } 31 | 32 | public abstract void test() throws Throwable; 33 | } 34 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlDumpAddAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | import com.adobe.qe.toughday.internal.core.config.Actions; 15 | 16 | import java.util.Map; 17 | 18 | /** 19 | * Specifies how the add action is dumped when generating a yaml configuration file. 20 | */ 21 | public class YamlDumpAddAction extends YamlDumpAction { 22 | 23 | public YamlDumpAddAction(String identifier, Map properties) { 24 | this.action = Actions.ADD; 25 | this.identifier = identifier; 26 | this.properties = properties; 27 | } 28 | 29 | public String getAdd() { 30 | return identifier; 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Name.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | import com.adobe.qe.toughday.api.annotations.Internal; 17 | 18 | @Internal 19 | @Description(desc = "The name of the test.") 20 | public class Name extends Metric { 21 | 22 | @Override 23 | public Object getValue(RunMap.TestStatistics testStatistics) { 24 | return testStatistics.getTest().getFullName(); 25 | } 26 | 27 | @Override 28 | public String getFormat() { 29 | return "%s"; 30 | } 31 | 32 | @Override 33 | public String getUnitOfMeasure() { 34 | return ""; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/ConfigArgGet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Use this annotation on a getter to expose it as a configuration property. 21 | * These properties will be automatically picked up, shown in logging or in "dry" runmode 22 | * Supported classes: subtypes of AbstractTest, subtypes of Publisher and 23 | * GlobalArgs. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(value = ElementType.METHOD) 27 | public @interface ConfigArgGet { 28 | String name() default ""; 29 | } 30 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlDumpConfigAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | import com.adobe.qe.toughday.internal.core.config.Actions; 15 | 16 | import java.util.Map; 17 | 18 | /** 19 | * Specifies how the config action is dumped when generating a yaml configuration file. 20 | */ 21 | public class YamlDumpConfigAction extends YamlDumpAction { 22 | 23 | public YamlDumpConfigAction(String identifier, Map properties) { 24 | this.action = Actions.CONFIG; 25 | this.identifier = identifier; 26 | this.properties = properties; 27 | } 28 | 29 | public String getConfig() { 30 | return identifier; 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/RealTP.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | 17 | @Description(desc = "Number of runs divided by elapsed time. Formula: Runs / elapsed execution time.") 18 | public class RealTP extends Metric { 19 | 20 | @Override 21 | public Object getValue(RunMap.TestStatistics testStatistics) { 22 | return testStatistics.getRealThroughput(); 23 | } 24 | 25 | @Override 26 | public String getFormat() { 27 | return "%." + this.getDecimals() + "f"; 28 | } 29 | 30 | @Override 31 | public String getUnitOfMeasure() { 32 | return "rps"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/MockTestTwin.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | public class MockTestTwin extends AbstractTest { 21 | private List noChildren = new ArrayList<>(); 22 | 23 | @Override 24 | public List getChildren() { 25 | return noChildren; 26 | } 27 | 28 | @Override 29 | public Class getTestRunnerClass() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public AbstractTest newInstance() { 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/NamedObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | import com.adobe.qe.toughday.api.annotations.labels.NotNull; 17 | 18 | /** 19 | * As Annotations from Interfaces are not inherited in Java, you'll have to add similar annotations to your implementation.\ 20 | * If your implementation allows this, you can extend {@link NamedObjectImpl} for convenience 21 | */ 22 | public interface NamedObject { 23 | @ConfigArgGet 24 | @NotNull String getName(); 25 | 26 | @ConfigArgSet(required = false, desc = "The name of this object") 27 | void setName(String name); 28 | } 29 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Timestamp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | import com.adobe.qe.toughday.api.annotations.Internal; 17 | 18 | @Internal 19 | @Description(desc = "Timestamp of the last finished test run.") 20 | public class Timestamp extends Metric { 21 | 22 | @Override 23 | public Object getValue(RunMap.TestStatistics testStatistics) { 24 | return testStatistics.getTimestamp(); 25 | } 26 | 27 | @Override 28 | public String getFormat() { 29 | return "%s"; 30 | } 31 | 32 | @Override 33 | public String getUnitOfMeasure() { 34 | return ""; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/MetricResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | public interface MetricResult { 15 | 16 | /** 17 | * Getter for the name of the metric. 18 | * @return 19 | */ 20 | String getName(); 21 | 22 | /** 23 | * Getter for the value of this metric. 24 | */ 25 | T getValue(); 26 | 27 | 28 | /** 29 | * Getter for the format of the result of this metric. For instance, if this metric is going to return a string as 30 | * a result, this method should return "%s". 31 | */ 32 | String getFormat(); 33 | 34 | /** 35 | * Getter fot the unit of measure for the value of this metric. 36 | */ 37 | String getUnitOfMeasure(); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Average.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | 15 | import com.adobe.qe.toughday.api.annotations.Description; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | 18 | @Description(desc = "Computed average duration of all test executions. Formula: Sum (request time) / Runs .") 19 | public class Average extends Metric { 20 | 21 | @Override 22 | public Object getValue(RunMap.TestStatistics testStatistics) { 23 | return testStatistics.getAverageDuration(); 24 | } 25 | 26 | @Override 27 | public String getFormat() { 28 | return "%." + this.getDecimals() + "f"; 29 | } 30 | 31 | @Override 32 | public String getUnitOfMeasure() { 33 | return "ms"; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/MyTestRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | 18 | 19 | public class MyTestRunner extends AbstractTestRunner { 20 | 21 | public MyTestRunner(Class testClass) { 22 | super(testClass); 23 | } 24 | 25 | @Override 26 | protected void run(MyTestBase testObject, RunMap runMap) throws Throwable { 27 | for(int i = 0; i < 10; i++) { 28 | testObject.benchmark().measure(testObject, () -> { 29 | testObject.myTest(); 30 | }); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /toughday_sample/META-INF/vault/definition/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 29 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/mocks/MockRunMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.mocks; 13 | 14 | 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | public class MockRunMap implements RunMap { 23 | private List results = new ArrayList<>(); 24 | 25 | @Override 26 | public void record(TestResult testResult) { 27 | results.add(testResult); 28 | } 29 | 30 | public List getResults() { 31 | return results; 32 | } 33 | 34 | @Override 35 | public TestStatistics getRecord(AbstractTest test) { 36 | return null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/java/com/adobe/qe/toughday/tests/sequential/GetHomepageTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests.sequential; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.annotations.Description; 16 | import com.adobe.qe.toughday.api.annotations.Tag; 17 | import org.apache.http.HttpStatus; 18 | 19 | @Tag(tags = { "author", "publish" }) 20 | @Description(desc = "GET the home page.") 21 | public class GetHomepageTest extends AEMTestBase { 22 | 23 | @Override 24 | public void test() throws Throwable { 25 | benchmark().measure(this, "GET Homepage", getDefaultClient()).doGet("/", HttpStatus.SC_OK); 26 | } 27 | 28 | @Override 29 | public AbstractTest newInstance() { 30 | return new GetHomepageTest(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/NamedObjectImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | 17 | /** 18 | * An extendable implementation of {@link NamedObject} 19 | */ 20 | public class NamedObjectImpl implements NamedObject { 21 | private String name; 22 | 23 | public NamedObjectImpl() { 24 | this.name = this.getClass().getSimpleName(); 25 | } 26 | 27 | @ConfigArgGet 28 | @Override 29 | public String getName() { 30 | return this.name; 31 | } 32 | @ConfigArgSet(required = false, desc = "The name of this object") 33 | @Override 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/MyTestBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | public abstract class MyTestBase extends AbstractTest { 21 | private static final List EMPTY_LIST = new ArrayList<>(); 22 | 23 | @Override 24 | public List getChildren() { 25 | return EMPTY_LIST; 26 | } 27 | 28 | @Override 29 | public Class getTestRunnerClass() { 30 | return MyTestRunner.class; 31 | } 32 | 33 | @Override 34 | public abstract AbstractTest newInstance(); 35 | 36 | public abstract void myTest() throws Throwable; 37 | } 38 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/feeders/NoopFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import com.adobe.qe.toughday.api.core.NamedObjectImpl; 15 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 16 | import com.adobe.qe.toughday.api.feeders.OutputFeeder; 17 | 18 | public final class NoopFeeder extends NamedObjectImpl implements InputFeeder, OutputFeeder { 19 | 20 | public static final NoopFeeder INSTANCE = new NoopFeeder(); 21 | 22 | @Override 23 | public Object get(Object... keys) throws Exception { 24 | //no - op 25 | return null; 26 | } 27 | 28 | @Override 29 | public void push(Object item, Object... keys) throws Exception { 30 | //no - op 31 | } 32 | 33 | @Override 34 | public void init() throws Exception { 35 | //no - op 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/feeders/MockFeederTest2.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | 15 | import com.adobe.qe.toughday.api.annotations.feeders.FeederSet; 16 | import com.adobe.qe.toughday.api.core.AbstractTest; 17 | import com.adobe.qe.toughday.api.core.SequentialTest; 18 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 19 | 20 | public class MockFeederTest2 extends SequentialTest { 21 | 22 | private InputFeeder requiredInputFeeder; 23 | 24 | @FeederSet(required = true) 25 | public void setRequiredInputFeeder(InputFeeder requiredInputFeeder) { 26 | this.requiredInputFeeder = requiredInputFeeder; 27 | } 28 | 29 | 30 | @Override 31 | public void test() throws Throwable { 32 | 33 | } 34 | 35 | @Override 36 | public AbstractTest newInstance() { 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/ProxyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.annotations.labels.Nullable; 16 | 17 | /** 18 | * Use this interface to create proxy factories. Useful when your proxy needs more logic than calling the default constructor 19 | * and the injections provided by the {@link Proxy} interface in order to be constructed. 20 | */ 21 | public interface ProxyFactory { 22 | /** 23 | * Create a new proxy 24 | * 25 | * @param target 26 | * @param test 27 | * @param benchmark 28 | * @return A proxy object. If {@code null} os returned, the default proxy will be used. 29 | */ 30 | @Nullable T createProxy(T target, AbstractTest test, Benchmark benchmark); 31 | } 32 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/runners/SequentialTestRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.runners; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | import com.adobe.qe.toughday.api.core.SequentialTest; 18 | 19 | /** 20 | * Runner for a sequential test. 21 | */ 22 | public class SequentialTestRunner extends AbstractTestRunner { 23 | public SequentialTestRunner(Class testClass) { 24 | super(testClass); 25 | } 26 | 27 | @Override 28 | protected void run(SequentialTest testObject, RunMap runMap) throws Throwable { 29 | testObject.benchmark().measure(testObject, ()->{ 30 | testObject.test(); 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/internal/core/UUIDTestId.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core; 13 | 14 | import com.adobe.qe.toughday.api.core.TestId; 15 | 16 | import java.util.UUID; 17 | 18 | public class UUIDTestId extends TestId { 19 | private UUID id; 20 | 21 | public UUIDTestId() { 22 | this(UUID.randomUUID()); 23 | } 24 | 25 | public UUIDTestId(UUID id) { 26 | this.id = id; 27 | } 28 | 29 | @Override 30 | public boolean equals(TestId testId) { 31 | if(!(testId instanceof UUIDTestId)) 32 | return false; 33 | 34 | return this.id.equals(((UUIDTestId) testId).id); 35 | } 36 | 37 | @Override 38 | public long getHashCode() { 39 | return id.hashCode(); 40 | } 41 | 42 | @Override 43 | public int hashCode() { 44 | return id.hashCode(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/internal/core/benchmarkmocks/MockProxyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benchmarkmocks; 13 | 14 | 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.benchmark.Benchmark; 17 | import com.adobe.qe.toughday.api.core.benchmark.ProxyFactory; 18 | 19 | public class MockProxyFactory implements ProxyFactory { 20 | private boolean invoked; 21 | 22 | @Override 23 | public MockWorker createProxy(MockWorker target, AbstractTest test, Benchmark benchmark) { 24 | invoked = true; 25 | MockProxy mockProxy = new MockProxyFromFactory(); 26 | mockProxy.setBenchmark(benchmark); 27 | mockProxy.setTarget(target); 28 | mockProxy.setTest(test); 29 | return mockProxy; 30 | } 31 | 32 | public boolean isInvoked() { return this.invoked; } 33 | } 34 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/MockTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | import java.util.ArrayList; 17 | import org.apache.logging.log4j.Logger; 18 | 19 | import java.util.List; 20 | 21 | public class MockTest extends AbstractTest { 22 | private List noChildren = new ArrayList<>(); 23 | 24 | @Override 25 | public List getChildren() { 26 | return noChildren; 27 | 28 | } 29 | 30 | @Override 31 | public Class getTestRunnerClass() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public AbstractTest newInstance() { 37 | return new MockTest(); 38 | } 39 | 40 | @Override 41 | public Logger logger() { 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/TestId.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | /** 15 | * Identifies a test in the suite and all its clones 16 | */ 17 | public abstract class TestId { 18 | /** 19 | * Mandatory equals method. 20 | * @param testId the other TestId instance 21 | * @return true if they are equals. false otherwise 22 | */ 23 | public abstract boolean equals(TestId testId); 24 | 25 | /** 26 | * Mandatory method for computing the hash code 27 | * @return the hash code 28 | */ 29 | public abstract long getHashCode(); 30 | 31 | @Override 32 | public boolean equals(Object other) { 33 | if(!(other instanceof TestId)) return false; 34 | return equals((TestId) other); 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return (int) getHashCode(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/TestContentPackageIsPresent.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.internal.core.ReflectionsContainer; 15 | import org.apache.logging.log4j.LogManager; 16 | import org.apache.logging.log4j.core.LoggerContext; 17 | import org.junit.*; 18 | 19 | public class TestContentPackageIsPresent { 20 | 21 | @BeforeClass 22 | public static void beforeAll() { 23 | System.setProperty("logFileName", "."); 24 | } 25 | 26 | @Test 27 | public void test() { 28 | Assert.assertNotNull("Tough Day Content Package is not in jar!", ReflectionsContainer.getInstance().getToughdayContentPackage()); 29 | } 30 | 31 | @After 32 | public void deleteLogs() { 33 | ((LoggerContext) LogManager.getContext(false)).reconfigure(); 34 | LogFileEraser.deteleFiles(((LoggerContext) LogManager.getContext(false)).getConfiguration()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/annotations/ConfigArgSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.annotations; 13 | 14 | import java.lang.annotation.ElementType; 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | 19 | /** 20 | * Use this annotation on a setter that receives a String parameter to expose it as a configuration property. 21 | * These properties will be automatically picked up, shown in help and the they will be called by Configuration 22 | * when the object is instantiated. Supported classes: subtypes of AbstractTest, subtypes of Publisher and 23 | * GlobalArgs. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(value = ElementType.METHOD) 27 | public @interface ConfigArgSet { 28 | boolean required() default true; 29 | String desc() default ""; 30 | String defaultValue() default ""; 31 | int order() default 0; 32 | } 33 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/conf/toughday-templates/settings/wcm/templates/toughday-template/structure/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 17 | 18 | 19 | 23 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/benchmark/Proxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.benchmark; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | 16 | /** 17 | * If your custom proxy implements this interface, the setters from it will be called to inject information into 18 | * your proxy. 19 | * @param Type of the object being proxied 20 | */ 21 | public interface Proxy { 22 | /** 23 | * Method for injecting the test 24 | * @param test 25 | */ 26 | void setTest(AbstractTest test); 27 | 28 | /** 29 | * Method for injecting the target 30 | * @param target 31 | */ 32 | void setTarget(T target); 33 | 34 | /** 35 | * Method for injecting the benchmark object 36 | * @param benchmark 37 | */ 38 | void setBenchmark(Benchmark benchmark); 39 | 40 | /** 41 | * Method for getting the injected benchmark object 42 | * @return 43 | */ 44 | Benchmark benchmark(); 45 | } 46 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/feeders/Base64DecoderFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import com.adobe.qe.toughday.api.annotations.feeders.FeederSet; 15 | import com.adobe.qe.toughday.api.core.NamedObjectImpl; 16 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 17 | 18 | import java.util.Base64; 19 | 20 | public class Base64DecoderFeeder extends NamedObjectImpl implements InputFeeder { 21 | private InputFeeder input; 22 | 23 | @Override 24 | public String get(Object... keys) throws Exception { 25 | String current = input.get(); 26 | if(current == null) { 27 | return null; 28 | } 29 | return new String(Base64.getDecoder().decode(input.get())); 30 | } 31 | 32 | @Override 33 | public void init() throws Exception { 34 | 35 | } 36 | 37 | @FeederSet(desc = "The Base64 Encoded feeder") 38 | public void setInput(InputFeeder input) { 39 | this.input = input; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/MetricResultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.core.MetricResult; 15 | 16 | public class MetricResultImpl implements MetricResult { 17 | 18 | private String name; 19 | private T value; 20 | private String format; 21 | private String unitOfMeasure; 22 | 23 | public MetricResultImpl(String name, T value, String format, String unitOfMeasure) { 24 | this.value = value; 25 | this.format = format; 26 | this.unitOfMeasure = unitOfMeasure; 27 | this.name = name; 28 | } 29 | 30 | @Override 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | @Override 36 | public T getValue() { 37 | return value; 38 | } 39 | 40 | @Override 41 | public String getFormat() { 42 | return format; 43 | } 44 | 45 | @Override 46 | public String getUnitOfMeasure() { 47 | return unitOfMeasure; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/internal/core/benckmark/ImmutableResultInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benckmark; 13 | 14 | import com.adobe.qe.toughday.api.core.benchmark.ResultInfo; 15 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 16 | 17 | public class ImmutableResultInfo implements ResultInfo { 18 | private final TestResult testResult; 19 | private final R returnValue; 20 | private final Throwable throwable; 21 | 22 | public ImmutableResultInfo(TestResult testResult, R returnValue, Throwable throwable) { 23 | this.testResult = testResult; 24 | this.returnValue = returnValue; 25 | this.throwable = throwable; 26 | } 27 | 28 | @Override 29 | public TestResult getTestResult() { 30 | return testResult; 31 | } 32 | 33 | @Override 34 | public R getReturnValue() { 35 | return returnValue; 36 | } 37 | 38 | @Override 39 | public Throwable getThrowable() { 40 | return throwable; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/CompositeHello.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.CompositeTest; 16 | 17 | public class CompositeHello extends CompositeTest { 18 | private HelloWorld test1; 19 | private HelloWorld test2; 20 | private HelloWorld test3; 21 | 22 | public CompositeHello() { 23 | this(true); 24 | } 25 | 26 | public CompositeHello(boolean createChildren) { 27 | if (createChildren) { 28 | this.test1 = new HelloWorld(); 29 | this.test2 = new HelloWorld(); 30 | this.test3 = new HelloWorld(); 31 | 32 | test1.setName("Child1"); 33 | test2.setName("Child2"); 34 | test3.setName("Child3"); 35 | 36 | this.addChild(test1); 37 | this.addChild(test2); 38 | this.addChild(test3); 39 | } 40 | } 41 | 42 | @Override 43 | public AbstractTest newInstance() { 44 | return new CompositeHello(false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/feeders/StringValueFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | import com.adobe.qe.toughday.api.core.NamedObjectImpl; 17 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 18 | 19 | public class StringValueFeeder extends NamedObjectImpl implements InputFeeder { 20 | private String value; 21 | 22 | public StringValueFeeder() {} 23 | 24 | public StringValueFeeder(String value) { 25 | this.value = value; 26 | } 27 | 28 | @ConfigArgSet(required = true,desc = "The value which will be return") 29 | public void setValue(String value) { 30 | this.value = value; 31 | } 32 | 33 | @ConfigArgGet 34 | public String getValue() { 35 | return this.value; 36 | } 37 | 38 | @Override 39 | public void init() throws Exception { 40 | 41 | } 42 | 43 | @Override 44 | public String get(Object... keys) throws Exception { 45 | return this.value; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/MockTestRequiredField.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 17 | import org.apache.logging.log4j.Logger; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | public class MockTestRequiredField extends AbstractTest { 23 | private List noChildren = new ArrayList<>(); 24 | 25 | @Override 26 | public List getChildren() { 27 | return noChildren; 28 | } 29 | 30 | @Override 31 | public Class getTestRunnerClass() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public AbstractTest newInstance() { 37 | return null; 38 | } 39 | 40 | @Override 41 | @ConfigArgSet(required = true) 42 | public AbstractTest setName(String name) { 43 | return super.setName(name); 44 | } 45 | 46 | @Override 47 | public Logger logger() { 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/metrics/Percentile.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.metrics; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Description; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | 18 | @Description(desc = "Percentile.") 19 | public class Percentile extends Metric { 20 | private double value; 21 | 22 | @ConfigArgSet(required = true, desc = "The value at which percentile will be calculated.") 23 | public Percentile setValue(String value) { 24 | this.value = Double.valueOf(value.substring(0,value.length() - 1)); 25 | if (this.name.equals(getClass().getSimpleName())) { 26 | this.name = value + "p"; 27 | } 28 | return this; 29 | } 30 | 31 | @Override 32 | public Object getValue(RunMap.TestStatistics testStatistics) { 33 | return testStatistics.getValueAtPercentile(value); 34 | } 35 | 36 | @Override 37 | public String getFormat() { 38 | return "%d"; 39 | } 40 | 41 | @Override 42 | public String getUnitOfMeasure() { 43 | return "ms"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sling-td2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.adobe.qe 6 | toughday2-tests-parent 7 | 0.9.4-beta 8 | ../toughday2-tests-parent/pom.xml 9 | 10 | 4.0.0 11 | 12 | com.adobe.qe 13 | sling-td2 14 | 0.9.4-SNAPSHOT 15 | 16 | 17 | 18 | Apache License, Version 2.0 19 | https://www.apache.org/licenses/LICENSE-2.0.txt 20 | repo 21 | 22 | 23 | 24 | 25 | scm:git:git@github.com:adobe/toughday2.git 26 | scm:git:git@github.com:adobe/toughday2.git 27 | https://github.com/adobe/toughday2/tree/master/sling-td2 28 | HEAD 29 | 30 | 31 | 32 | 33 | org.apache.sling 34 | org.apache.sling.testing.clients 35 | 1.1.12 36 | 37 | 38 | com.google.guava 39 | guava 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/core/AssumptionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core; 13 | 14 | import java.lang.annotation.Annotation; 15 | import java.lang.reflect.Method; 16 | import java.lang.reflect.Modifier; 17 | 18 | /** 19 | * Class with helpers to validate assumptions about the extensions 20 | */ 21 | public final class AssumptionUtils { 22 | /** 23 | * Validator for methods annotated with test_annotations. 24 | * @param method 25 | * @param annotation 26 | * @return true if the method is valid, false if not. 27 | */ 28 | public static void validateAnnotatedMethod(Method method, Class annotation) { 29 | if(method.getParameterTypes().length != 0) { 30 | throw new AssertionError("Method \"" + method + "\" annotated with " + annotation.getSimpleName() + " cannot have parameters"); 31 | } 32 | 33 | if(!(Modifier.isFinal(method.getModifiers()) || Modifier.isPrivate(method.getModifiers()))) { 34 | throw new AssertionError("Method \"" + method + "\" annotated with " + annotation.getSimpleName() + " must be final or private"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sling-td2-tests-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.qe 7 | toughday2-tests-parent 8 | 0.9.4-beta 9 | ../toughday2-tests-parent/pom.xml 10 | 11 | 12 | com.adobe.qe 13 | sling-td2-tests-parent 14 | 0.9.4-SNAPSHOT 15 | pom 16 | 17 | 18 | 19 | Apache License, Version 2.0 20 | https://www.apache.org/licenses/LICENSE-2.0.txt 21 | repo 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | scm:git:git@github.com:adobe/toughday2.git 30 | scm:git:git@github.com:adobe/toughday2.git 31 | https://github.com/adobe/toughday2/tree/master/aem-td2-tests-parent 32 | HEAD 33 | 34 | 35 | 36 | 37 | com.adobe.qe 38 | sling-td2 39 | 0.9.4-beta 40 | provided 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /aem-td2-tests-parent/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | com.adobe.qe 7 | sling-td2-tests-parent 8 | 0.9.4-beta 9 | ../sling-td2-tests-parent/pom.xml 10 | 11 | 12 | com.adobe.qe 13 | aem-td2-tests-parent 14 | 0.9.4-SNAPSHOT 15 | pom 16 | 17 | 18 | 19 | Apache License, Version 2.0 20 | https://www.apache.org/licenses/LICENSE-2.0.txt 21 | repo 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | scm:git:git@github.com:adobe/toughday2.git 30 | scm:git:git@github.com:adobe/toughday2.git 31 | https://github.com/adobe/toughday2/tree/master/aem-td2-tests-parent 32 | HEAD 33 | 34 | 35 | 36 | 37 | com.adobe.qe 38 | aem-td2-core-tests 39 | 0.9.4-beta 40 | provided 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/MockTestTwoRequiredFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 17 | import org.apache.logging.log4j.Logger; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | public class MockTestTwoRequiredFields extends AbstractTest { 23 | private List noChildren = new ArrayList<>(); 24 | private String mock; 25 | 26 | @Override 27 | public List getChildren() { 28 | return noChildren; 29 | } 30 | 31 | @Override 32 | public Class getTestRunnerClass() { 33 | return null; 34 | } 35 | 36 | @Override 37 | public AbstractTest newInstance() { 38 | return null; 39 | } 40 | 41 | @Override 42 | @ConfigArgSet(required = true) 43 | public AbstractTest setName(String name) { 44 | return super.setName(name); 45 | } 46 | 47 | @ConfigArgSet(required = true) 48 | public AbstractTest setMock(String mock) { 49 | this.mock = mock; 50 | return this; 51 | } 52 | 53 | @Override 54 | public Logger logger() { 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/mocks/MockTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.mocks; 13 | 14 | import com.adobe.qe.toughday.api.annotations.Internal; 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 17 | import org.apache.logging.log4j.Level; 18 | import org.apache.logging.log4j.Logger; 19 | import org.apache.logging.log4j.simple.SimpleLogger; 20 | import org.apache.logging.log4j.util.PropertiesUtil; 21 | 22 | import java.util.List; 23 | 24 | @Internal 25 | public class MockTest extends AbstractTest { 26 | private static Logger logger; 27 | 28 | @Override 29 | public List getChildren() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public Class getTestRunnerClass() { 35 | return null; 36 | } 37 | 38 | @Override 39 | public AbstractTest newInstance() { 40 | return null; 41 | } 42 | 43 | @Override 44 | public Logger logger() { 45 | return getLogger(); 46 | } 47 | 48 | public static Logger getLogger() { 49 | if (logger == null) { 50 | logger = new SimpleLogger("null", Level.INFO, false, false, 51 | false, false, null, 52 | null, new PropertiesUtil("."), null); 53 | } 54 | 55 | return logger; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/api/core/runnermocks/MockTestRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.runnermocks; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.AbstractTestRunner; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | import org.junit.Assert; 18 | 19 | public class MockTestRunner extends AbstractTestRunner { 20 | public static final String BASE_BEFORE_METHOD = "Base Before"; 21 | public static final String SUBCLASS_BEFORE_METHOD = "Subclass Before"; 22 | 23 | public static final String BASE_AFTER_METHOD = "Base After"; 24 | public static final String SUBCLASS_AFTER_METHOD = "Subclass Ater"; 25 | 26 | public static final String BASE_TEST_METHOD = "Base Test Method"; 27 | public static final String SUBCLASS_TEST_METHOD = "Subclass Test Method"; 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param testClass 33 | */ 34 | public MockTestRunner(Class testClass) { 35 | super(testClass); 36 | } 37 | 38 | @Override 39 | protected void run(MockTest testObject, RunMap runMap) throws Throwable { 40 | Assert.assertNotNull("RunMap should not be null at this point", testObject.benchmark().getRunMap()); 41 | testObject.benchmark().measure(testObject, ()-> { 42 | testObject.run(); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/java/com/adobe/qe/toughday/tests/sequential/image/DeleteImageTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests.sequential.image; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.annotations.Description; 16 | import com.adobe.qe.toughday.api.annotations.Tag; 17 | import com.adobe.qe.toughday.api.core.SkippedTestException; 18 | import org.apache.sling.testing.clients.ClientException; 19 | import com.adobe.qe.toughday.tests.sequential.DeletePageTest; 20 | 21 | @Tag(tags = { "author" }) 22 | @Description(desc = "Test for deleting image assets created by the UploadImageTest") 23 | public class DeleteImageTest extends DeletePageTest { 24 | 25 | public DeleteImageTest() { 26 | } 27 | 28 | public DeleteImageTest(String parentPath, boolean force, String title){ 29 | super(parentPath, force, title); 30 | } 31 | 32 | @Override 33 | protected String getNextTitle() throws SkippedTestException { 34 | if (UploadImageTest.lastCreated.get() == null) { 35 | throw new SkippedTestException(new ClientException("No image uploaded(by UploadImageTest). Marking as skipped.")); 36 | } 37 | return UploadImageTest.lastCreated.get().getName(); 38 | } 39 | 40 | @Override 41 | public AbstractTest newInstance() { 42 | return new DeleteImageTest(getParentPath(), getForce(), getTitle()); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/api/runners/CompositeTestRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.runners; 13 | 14 | import com.adobe.qe.toughday.api.core.*; 15 | import com.adobe.qe.toughday.api.core.RunMap; 16 | import com.adobe.qe.toughday.api.core.SkippedTestException; 17 | import com.adobe.qe.toughday.api.core.ChildTestFailedException; 18 | 19 | /** 20 | * Runner for CompositeTest. 21 | */ 22 | public class CompositeTestRunner extends AbstractTestRunner { 23 | 24 | /** 25 | * Constructor 26 | * @param testClass 27 | */ 28 | public CompositeTestRunner(Class testClass) { 29 | super(testClass); 30 | } 31 | 32 | /** 33 | * Method for running the test. 34 | * @param testObject instance of the test to run 35 | * @param runMap the run map in which the benchmark will be recorded. 36 | * @throws Throwable any throwable occurred in the test and was propagated upstream by the implementation runner 37 | */ 38 | @Override 39 | protected void run(CompositeTest testObject, RunMap runMap) throws Throwable { 40 | testObject.benchmark().measure(testObject, () -> { 41 | for (AbstractTest child : testObject.getChildren()) { 42 | AbstractTestRunner runner = RunnersContainer.getInstance().getRunner(child); 43 | runner.runTest(child, runMap); 44 | } 45 | }); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | import com.adobe.qe.toughday.internal.core.config.Actions; 15 | 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | public class YamlAction { 20 | private Actions action; 21 | private String identifier; 22 | private Map testMetaInfo = new HashMap<>(); 23 | 24 | public void setAdd(String identifier) { 25 | this.action = Actions.ADD; 26 | this.identifier = identifier; 27 | } 28 | 29 | public void setConfig(String identifier) { 30 | this.action = Actions.CONFIG; 31 | this.identifier = identifier; 32 | } 33 | 34 | public void setExclude(String identifier) { 35 | this.action = Actions.EXCLUDE; 36 | this.identifier = identifier; 37 | } 38 | 39 | public void setProperties(Map testMetaInfo) { 40 | this.testMetaInfo = testMetaInfo; 41 | } 42 | 43 | public Actions getAction() { 44 | return action; 45 | } 46 | 47 | public String getIdentifier() { 48 | return identifier; 49 | } 50 | 51 | public Map getProperties() { 52 | return testMetaInfo; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return action.value() + " " + identifier; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/config/parsers/yaml/YamlParseAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.config.parsers.yaml; 13 | 14 | 15 | import com.adobe.qe.toughday.internal.core.config.Actions; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | public class YamlParseAction { 21 | private Actions action; 22 | private String identifier; 23 | private Map testMetaInfo = new HashMap<>(); 24 | 25 | public void setAdd(String identifier) { 26 | this.action = Actions.ADD; 27 | this.identifier = identifier; 28 | } 29 | 30 | public void setConfig(String identifier) { 31 | this.action = Actions.CONFIG; 32 | this.identifier = identifier; 33 | } 34 | 35 | public void setExclude(String identifier) { 36 | this.action = Actions.EXCLUDE; 37 | this.identifier = identifier; 38 | } 39 | 40 | public void setProperties(Map testMetaInfo) { 41 | this.testMetaInfo = testMetaInfo; 42 | } 43 | 44 | public Actions getAction() { 45 | return action; 46 | } 47 | 48 | public String getIdentifier() { 49 | return identifier; 50 | } 51 | 52 | public Map getProperties() { 53 | return testMetaInfo; 54 | } 55 | 56 | @Override 57 | public String toString() { 58 | return action.value() + " " + identifier; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/engine/PublishMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.engine; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.MetricResult; 16 | import com.adobe.qe.toughday.api.core.RunMap; 17 | import com.adobe.qe.toughday.internal.core.RunMapImpl; 18 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 19 | 20 | import java.util.Collection; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | public abstract class PublishMode { 25 | protected Engine engine; 26 | protected RunMapImpl globalRunMap; 27 | 28 | public PublishMode() { 29 | this.globalRunMap = new RunMapImpl(); 30 | } 31 | 32 | @Deprecated 33 | public RunMapImpl getGlobalRunMap() { 34 | return globalRunMap; 35 | } 36 | 37 | public RunMapImpl getRunMap() { 38 | return globalRunMap; 39 | } 40 | 41 | public Map aggregateAndReinitialize(RunMap runMap) { 42 | return globalRunMap.aggregateAndReinitialize(runMap); 43 | } 44 | 45 | public void setEngine(Engine engine) { 46 | this.engine = engine; 47 | } 48 | 49 | public abstract void publishIntermediateResults(Map> results); 50 | 51 | public abstract void publishFinalResults(Map> results); 52 | 53 | public abstract void publish(Collection testResults); 54 | } 55 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/api/core/runnermocks/MockInheritanceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.api.core.runnermocks; 13 | 14 | import com.adobe.qe.toughday.api.annotations.After; 15 | import com.adobe.qe.toughday.api.annotations.Before; 16 | 17 | public 18 | 19 | class MockInheritanceTest extends MockTest { 20 | 21 | private boolean failSubclassBefore; 22 | private boolean failSubclassTest; 23 | private boolean failSubclassAfter; 24 | 25 | @Before 26 | public final void subclassBefore() throws MockThrowable { 27 | execute(MockTestRunner.SUBCLASS_BEFORE_METHOD); 28 | if(failSubclassBefore) { throw new MockThrowable(MockTestRunner.SUBCLASS_BEFORE_METHOD); } 29 | } 30 | 31 | public void run() throws MockThrowable { 32 | execute(MockTestRunner.SUBCLASS_TEST_METHOD); 33 | if(failSubclassTest) { throw new MockThrowable(MockTestRunner.SUBCLASS_TEST_METHOD); } 34 | } 35 | 36 | @After 37 | public final void subclassAfter() throws MockThrowable { 38 | execute(MockTestRunner.SUBCLASS_AFTER_METHOD); 39 | if(failSubclassAfter) { throw new MockThrowable(MockTestRunner.SUBCLASS_AFTER_METHOD); } 40 | } 41 | 42 | public void doFailSubclassBefore() { 43 | this.failSubclassBefore = true; 44 | } 45 | 46 | public void doFailSubclassTest() { 47 | this.failSubclassTest = true; 48 | } 49 | 50 | public void doFailSubclassAfter() { 51 | this.failSubclassAfter = true; 52 | } 53 | } -------------------------------------------------------------------------------- /toughday2-api/src/main/java/com/adobe/qe/toughday/feeders/ListFeeder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | import com.adobe.qe.toughday.api.core.NamedObjectImpl; 17 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 18 | import com.google.common.base.Joiner; 19 | 20 | import java.util.ArrayList; 21 | import java.util.Arrays; 22 | import java.util.List; 23 | import java.util.concurrent.atomic.AtomicInteger; 24 | 25 | public class ListFeeder extends NamedObjectImpl implements InputFeeder { 26 | 27 | private List values = new ArrayList<>(); 28 | private AtomicInteger idx = new AtomicInteger(0); 29 | 30 | public void ListFeeder() {} 31 | 32 | public void ListFeeder(List values) { 33 | this.values = values; 34 | } 35 | 36 | @ConfigArgSet(required = true, desc = "Comma separated values, to be returned by the feeder") 37 | public void setValues(String values) { 38 | this.values = Arrays.asList(values.split(",")); 39 | } 40 | 41 | @ConfigArgGet 42 | public String getValues() { 43 | return Joiner.on(",").join(values); 44 | } 45 | 46 | @Override 47 | public String get(Object... keys) throws Exception { 48 | return values.get(idx.getAndUpdate(i -> (i + 1) % values.size())); 49 | } 50 | 51 | @Override 52 | public void init() throws Exception { 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /toughday2-api/src/test/java/com/adobe/qe/toughday/LogFileEraser.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.internal.core.Timestamp; 15 | import org.apache.commons.io.FileUtils; 16 | import org.apache.logging.log4j.LogManager; 17 | import org.apache.logging.log4j.core.Appender; 18 | import org.apache.logging.log4j.core.LoggerContext; 19 | 20 | import java.io.File; 21 | import java.io.IOException; 22 | import java.util.Map; 23 | 24 | public class LogFileEraser { 25 | 26 | private LogFileEraser() {} 27 | 28 | public static void deteleFiles(org.apache.logging.log4j.core.config.Configuration config) { 29 | File folder = new File("logs_" + Timestamp.START_TIME); 30 | 31 | if (folder.exists()) { 32 | if(config.getLoggerContext() != null) { 33 | config.getLoggerContext().reconfigure(); 34 | } 35 | 36 | for (Map.Entry appenderEntry : config.getAppenders().entrySet()) { 37 | appenderEntry.getValue().stop(); 38 | } 39 | 40 | try { 41 | boolean allDeleted = true; 42 | for (File file : folder.listFiles()) { 43 | if (!file.delete()) { 44 | allDeleted = false; 45 | } 46 | } 47 | 48 | if (allDeleted) { 49 | FileUtils.deleteDirectory(folder); 50 | } 51 | } catch (IOException e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /toughday/src/main/resources/log4j2.yaml: -------------------------------------------------------------------------------- 1 | Configuration: 2 | status: warn 3 | shutdownHook: disable 4 | 5 | Appenders: 6 | Console: 7 | name: Console 8 | target: SYSTEM_OUT 9 | PatternLayout: 10 | Pattern: "%d{yyyy-MM-dd HH:mm:ss} %-5p: %m%n" 11 | 12 | RollingFile: 13 | - name: CoreFile 14 | fileName: "${sys:logFileName}/logs_${date:yyyy-MM-dd'T'HH-mm}/toughday.log" 15 | filePattern: "logs/$${date:yyyy-MM}/application-%d{MM-dd-yyyy}-%i.log.gz" 16 | PatternLayout: 17 | Pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p: %m%n" 18 | Policies: 19 | SizeBasedTriggeringPolicy: 20 | size: 250 MB 21 | - name: TestsFile 22 | fileName: "${sys:logFileName}/logs_${date:yyyy-MM-dd'T'HH-mm}/toughday_tests.log" 23 | filePattern: "logs/$${date:yyyy-MM}/application-%d{MM-dd-yyyy}-%i.log.gz" 24 | PatternLayout: 25 | Pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p: %m%n" 26 | Policies: 27 | SizeBasedTriggeringPolicy: 28 | size: 250 MB 29 | Loggers: 30 | Root: 31 | level: info 32 | additivity: false 33 | AppenderRef: 34 | ref: CoreFile 35 | Logger: 36 | - name: com.adobe.qe.toughday.Main 37 | level: info 38 | additivity: false 39 | AppenderRef: 40 | ref: Console 41 | - name: com.adobe.qe.toughday.internal.core 42 | level: info 43 | additivity: false 44 | AppenderRef: 45 | ref: CoreFile 46 | - name: com.adobe.qe.toughday.tests 47 | level: info 48 | additivity: false 49 | AppenderRef: 50 | ref: TestsFile 51 | - name: org.apache 52 | level: info 53 | additivity: false 54 | AppenderRef: 55 | ref: TestsFile 56 | - name: org.reflections.Reflections 57 | level: error 58 | additivity: false 59 | AppenderRef: 60 | ref: CoreFile -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/ToughDay.jpeg/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/internal/core/benchmarkmocks/MockProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benchmarkmocks; 13 | 14 | 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.benchmark.Benchmark; 17 | import com.adobe.qe.toughday.api.core.benchmark.Proxy; 18 | import com.adobe.qe.toughday.api.core.benchmark.ResultInfo; 19 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 20 | 21 | import java.util.Map; 22 | 23 | public class MockProxy extends MockWorker implements Proxy { 24 | private AbstractTest test; 25 | private MockWorker target; 26 | private Benchmark benchmark; 27 | 28 | @Override 29 | public void setTest(AbstractTest test) { 30 | this.test = test; 31 | } 32 | 33 | @Override 34 | public void setTarget(MockWorker target) { 35 | this.target = target; 36 | } 37 | 38 | @Override 39 | public void setBenchmark(Benchmark benchmark) { 40 | this.benchmark = benchmark; 41 | } 42 | 43 | @Override 44 | public Benchmark benchmark() { 45 | return this.benchmark; 46 | } 47 | 48 | 49 | public Object methodWithReturnValue(Long... args) throws Throwable { 50 | ResultInfo resultInfo = benchmark().computeTestResult(test, (TestResult result) -> { 51 | return target.methodWithReturnValue(args); 52 | }); 53 | 54 | benchmark().getRunMap().record(resultInfo.getTestResult()); 55 | if(resultInfo.getThrowable() != null) throw resultInfo.getThrowable(); 56 | return resultInfo.getReturnValue(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /toughday_sample/jcr_root/content/dam/toughday/fr/ToughDay.jpeg/.content.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/internal/core/benchmarkmocks/MockDynamicProxyFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.benchmarkmocks; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.benchmark.Benchmark; 16 | import com.adobe.qe.toughday.api.core.benchmark.ProxyFactory; 17 | import org.mockito.Mockito; 18 | import org.mockito.invocation.InvocationOnMock; 19 | import org.mockito.stubbing.Answer; 20 | 21 | public class MockDynamicProxyFactory implements ProxyFactory { 22 | @Override 23 | public MockWorker createProxy(MockWorker target, AbstractTest test, Benchmark benchmark) { 24 | MockWorker spy = Mockito.spy(target); 25 | 26 | MockProxy proxy = new MockProxy(); 27 | proxy.setTarget(target); 28 | proxy.setTest(test); 29 | proxy.setBenchmark(benchmark); 30 | 31 | try { 32 | Mockito.doAnswer(new Answer() { 33 | @Override 34 | public Object answer(InvocationOnMock invocationOnMock) throws Throwable { 35 | Object[] callArgs = invocationOnMock.getArguments(); 36 | Long[] args = new Long[invocationOnMock.getArguments().length]; 37 | for(int i = 0; i < callArgs.length; i++) { 38 | args[i] =(Long) callArgs[i]; 39 | } 40 | return proxy.methodWithReturnValue(args); 41 | } 42 | }).when(spy).methodWithReturnValue(Mockito.any()); 43 | } catch (Throwable throwable) { 44 | spy = target; 45 | } 46 | 47 | return spy; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/java/com/adobe/qe/toughday/tests/sequential/search/QueryBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests.sequential.search; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.annotations.Description; 16 | import com.adobe.qe.toughday.api.annotations.Tag; 17 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 18 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 19 | import com.adobe.qe.toughday.tests.sequential.AEMTestBase; 20 | 21 | @Tag(tags = { "author" }) 22 | @Description(desc = "Search that uses the Query Builder Json Rest Api") 23 | public class QueryBuilderTest extends AEMTestBase { 24 | private static final String DEFAULT_QUERY = "type=cq:Page&group.1_path=/content&orderby=@jcr:score&orderby.sort=desc"; 25 | private String query = DEFAULT_QUERY; 26 | 27 | public QueryBuilderTest() { 28 | } 29 | 30 | public QueryBuilderTest(String query) { 31 | this.query = query; 32 | } 33 | 34 | @Override 35 | public void test() throws Throwable { 36 | benchmark().measure(this, "RunQuery", getDefaultClient()).doGet("/bin/querybuilder.json?" + query); 37 | } 38 | 39 | @Override 40 | public AbstractTest newInstance() { 41 | return new QueryBuilderTest(query); 42 | } 43 | 44 | @ConfigArgSet(required = false, desc = "Query to be executed by the Query Builder servlet", defaultValue = DEFAULT_QUERY) 45 | public QueryBuilderTest setQuery(String query) { 46 | this.query = query; 47 | return this; 48 | } 49 | 50 | @ConfigArgGet 51 | public String getQuery() { 52 | return this.query; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /toughday2-api/src/test/java/com/adobe/qe/toughday/structural/TestConfigGetAnnotatedMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.structural; 13 | 14 | import com.adobe.qe.toughday.LogFileEraser; 15 | import junit.framework.TestCase; 16 | import junit.framework.TestSuite; 17 | import org.apache.logging.log4j.LogManager; 18 | import org.apache.logging.log4j.core.LoggerContext; 19 | import org.junit.AfterClass; 20 | import org.junit.experimental.categories.Category; 21 | 22 | import java.lang.reflect.Method; 23 | import java.lang.reflect.Modifier; 24 | 25 | @Category(TestTDConstraints.class) 26 | public class TestConfigGetAnnotatedMethod extends TestCase { 27 | private Method TdConfigAnnotatedMethod; 28 | 29 | public TestConfigGetAnnotatedMethod(String testName, Method method) { 30 | super(testName); 31 | this.TdConfigAnnotatedMethod = method; 32 | } 33 | 34 | /** 35 | * Added to supress JUnit warning. 36 | * The actual test suite is created in TestSuiteStructural 37 | * */ 38 | public static TestSuite suite() { return new TestSuite(); } 39 | 40 | public void testModifier() { 41 | assertTrue("ToughDay2 config get method \"" + TdConfigAnnotatedMethod + "\" must be public", 42 | (TdConfigAnnotatedMethod.getModifiers() & Modifier.PUBLIC) != 0); 43 | } 44 | 45 | public void testArguments() { 46 | assertTrue( "ToughDay2 config get method \"" + TdConfigAnnotatedMethod + "\" must have no parameters", 47 | TdConfigAnnotatedMethod.getParameterTypes().length == 0); 48 | } 49 | 50 | @AfterClass 51 | public static void deleteFile() { 52 | LogFileEraser.deteleFiles(((LoggerContext) LogManager.getContext(false)).getConfiguration()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /toughday2-api/src/test/java/com/adobe/qe/toughday/structural/TestFeederClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.structural; 13 | 14 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 15 | import com.adobe.qe.toughday.api.feeders.OutputFeeder; 16 | import junit.framework.TestCase; 17 | import junit.framework.TestSuite; 18 | import net.jodah.typetools.TypeResolver; 19 | import org.junit.Assert; 20 | import org.junit.experimental.categories.Category; 21 | 22 | /** 23 | * Test the constraints of feeder classes 24 | */ 25 | @Category(TestTDConstraints.class) 26 | public class TestFeederClass extends TestCase { 27 | Class classType; 28 | 29 | public TestFeederClass(String testName, Class classType) { 30 | super(testName); 31 | this.classType = classType; 32 | } 33 | 34 | 35 | /** 36 | * Added to supress JUnit warning. 37 | * The actual test suite is created in TestSuiteStructural 38 | * */ 39 | public static TestSuite suite() { return new TestSuite(); } 40 | 41 | public void testClassConstrains() { 42 | if(InputFeeder.class.isAssignableFrom(classType)) { 43 | Assert.assertTrue("Feeder class: \"" + classType + "\" may not use generics", 44 | TypeResolver.resolveRawArgument(InputFeeder.class, classType) != TypeResolver.Unknown.class); 45 | } 46 | if(OutputFeeder.class.isAssignableFrom(classType)) { 47 | Assert.assertTrue("Feeder class: \"" + classType + "\" may not use generics", 48 | TypeResolver.resolveRawArgument(OutputFeeder.class, classType) != TypeResolver.Unknown.class); 49 | } 50 | 51 | Assert.assertTrue("Feeder class: \"" + classType + "\" may not use generics", classType.getTypeParameters().length == 0); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /toughday2-api/src/test/java/com/adobe/qe/toughday/structural/TestConstructor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.structural; 13 | 14 | import com.adobe.qe.toughday.LogFileEraser; 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.internal.core.benckmark.AdHocTest; 17 | import junit.framework.TestCase; 18 | import junit.framework.TestSuite; 19 | import org.apache.logging.log4j.LogManager; 20 | import org.apache.logging.log4j.core.LoggerContext; 21 | import org.junit.AfterClass; 22 | import org.junit.experimental.categories.Category; 23 | 24 | import java.lang.reflect.Constructor; 25 | 26 | @Category(TestTDConstraints.class) 27 | public class TestConstructor extends TestCase { 28 | private Class TdClass; 29 | 30 | public TestConstructor(String testName, Class TDTestClass) { 31 | super(testName); 32 | this.TdClass = TDTestClass; 33 | } 34 | 35 | /** 36 | * Added to supress JUnit warning. 37 | * The actual test suite is created in TestSuiteStructural 38 | * */ 39 | public static TestSuite suite() { return new TestSuite(); } 40 | 41 | public void test() throws NoSuchMethodException { 42 | //The AdHocTest is an exception from the rule 43 | if(TdClass == AdHocTest.class) { 44 | return; 45 | } 46 | 47 | try { 48 | Constructor constructor = TdClass.getConstructor(null); 49 | } catch (NoSuchMethodException e) { 50 | fail("ToughDay2 class \"" + TdClass.getName() + "\" doesn't have a public constructor with no arguments, or it is not public"); 51 | } 52 | } 53 | 54 | @AfterClass 55 | public static void deleteFile() { 56 | LogFileEraser.deteleFiles(((LoggerContext) LogManager.getContext(false)).getConfiguration()); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/internal/core/engine/AsyncTestWorker.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.internal.core.engine; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import org.apache.logging.log4j.LogManager; 16 | import org.apache.logging.log4j.Logger; 17 | 18 | import java.util.concurrent.locks.ReentrantLock; 19 | 20 | /** 21 | * Async worker for running tests. There will be GlobalArgs.Concurrency test workers. 22 | */ 23 | public abstract class AsyncTestWorker extends AsyncEngineWorker { 24 | protected static final Logger LOG = LogManager.getLogger(AsyncTestWorker.class); 25 | protected Thread workerThread; 26 | protected long lastTestStart; 27 | protected AbstractTest currentTest; 28 | protected ReentrantLock mutex; 29 | 30 | /** 31 | * Constructor 32 | */ 33 | public AsyncTestWorker() { 34 | this.mutex = new ReentrantLock(); 35 | } 36 | 37 | /** 38 | * Getter for the thread running this worker. 39 | * @return thread running this worker, if the worker has started running, null otherwise. 40 | */ 41 | public Thread getWorkerThread() { 42 | return workerThread; 43 | } 44 | 45 | /** 46 | * Getter for the nanoTime of the last time a test has started running. 47 | */ 48 | public long getLastTestStart() { 49 | return lastTestStart; 50 | } 51 | 52 | /** 53 | * Getter for the current running test. 54 | * @return the running test, or null if no test has started running. 55 | */ 56 | public AbstractTest getCurrentTest() { return currentTest; } 57 | 58 | /** 59 | * Getter for the mutex that is only unlocked when the test is running. 60 | */ 61 | public ReentrantLock getMutex() { return mutex; } 62 | 63 | public abstract boolean hasExited(); 64 | } 65 | -------------------------------------------------------------------------------- /toughday/src/main/java/com/adobe/qe/toughday/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | 15 | import com.adobe.qe.toughday.internal.core.engine.Engine; 16 | import com.adobe.qe.toughday.internal.core.config.parsers.cli.CliParser; 17 | import com.adobe.qe.toughday.internal.core.config.Configuration; 18 | import org.apache.logging.log4j.LogManager; 19 | import org.apache.logging.log4j.Logger; 20 | 21 | 22 | /** 23 | * Main class. Creates a Configuration and an engine and runs the tests. 24 | */ 25 | public class Main { 26 | private static final Logger LOG; 27 | 28 | static { 29 | System.setProperty("logFileName", "."); 30 | LOG = LogManager.getLogger(Main.class); 31 | } 32 | 33 | public static void main(String[] args) { 34 | 35 | 36 | CliParser cliParser = new CliParser(); 37 | System.out.println(); 38 | 39 | try { 40 | Configuration configuration = null; 41 | try { 42 | configuration = new Configuration(args); 43 | if (cliParser.printHelp(args)) { 44 | System.exit(0); 45 | } 46 | } catch (IllegalArgumentException e) { 47 | LOG.error("Bad configuration: {}", e.getMessage()); 48 | System.out.println(); 49 | System.out.println(); 50 | cliParser.printShortHelp(); 51 | System.exit(1); 52 | } 53 | 54 | Engine engine = new Engine(configuration); 55 | engine.runTests(); 56 | 57 | System.exit(0); 58 | } catch (Throwable t) { 59 | LOG.error("Error encountered: " 60 | + (t.getMessage() != null ? t.getMessage() : "Please check toughday.log for more information.")); 61 | LogManager.getLogger(Engine.class).error("Error encountered", t); 62 | } 63 | System.exit(0); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /aem-td2-core-tests/src/main/java/com/adobe/qe/toughday/tests/sequential/GetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests.sequential; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.annotations.Description; 16 | import com.adobe.qe.toughday.api.annotations.Tag; 17 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 18 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 19 | import org.apache.http.HttpStatus; 20 | 21 | @Tag(tags = { "author", "publish" }) 22 | @Description(desc = "GET a specific page.") 23 | public class GetTest extends AEMTestBase { 24 | 25 | public static final String DEFAULT_PATH = "/crx/de"; 26 | private String path; 27 | 28 | 29 | public GetTest() { 30 | this.path = DEFAULT_PATH; 31 | } 32 | 33 | /** 34 | * Setter for the name 35 | */ 36 | @ConfigArgSet(required = false, defaultValue = DEFAULT_PATH, desc = "The path at which to perform a GET request") 37 | public AbstractTest setPath(String path) { 38 | this.path = path; 39 | return this; 40 | } 41 | 42 | @ConfigArgGet 43 | public String getPath() { 44 | return this.path; 45 | } 46 | 47 | @Override 48 | public void test() throws Throwable { 49 | try { 50 | logger().debug("{}: Trying to GET path={}", Thread.currentThread().getName(), path); 51 | benchmark().measure(this, "GET page", getDefaultClient()).doGet(path, HttpStatus.SC_OK); 52 | } catch (Throwable e) { 53 | logger().warn("{}: Failed to GET path={}", Thread.currentThread().getName(), path); 54 | logger().debug(Thread.currentThread().getName() + ": ERROR :", e); 55 | throw e; 56 | } 57 | } 58 | 59 | @Override 60 | public AbstractTest newInstance() { 61 | GetTest test = new GetTest(); 62 | test.setPath(this.path); 63 | return test; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /toughday_tests_sample/src/main/java/com/adobe/qe/toughday/tests/WorkerProxy.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.tests; 13 | 14 | import com.adobe.qe.toughday.api.core.AbstractTest; 15 | import com.adobe.qe.toughday.api.core.benchmark.Benchmark; 16 | import com.adobe.qe.toughday.api.core.benchmark.Proxy; 17 | import com.adobe.qe.toughday.api.core.benchmark.ResultInfo; 18 | import com.adobe.qe.toughday.api.core.benchmark.TestResult; 19 | 20 | import java.util.Collections; 21 | 22 | public class WorkerProxy extends Worker implements Proxy { 23 | private final String info; 24 | private AbstractTest test; 25 | private Worker target; 26 | private Benchmark benchmark; 27 | 28 | public WorkerProxy(String info) { 29 | this.info = info; 30 | } 31 | 32 | @Override 33 | public long doWork(long millis) throws Throwable { 34 | ResultInfo result = benchmark().computeTestResult(test, (TestResult testResult) -> { 35 | return super.doWork(millis); 36 | }); 37 | 38 | TestResult currentTestResult = result.getTestResult(); 39 | currentTestResult.withData(Collections.singletonMap("sleep", millis)); 40 | benchmark().getRunMap().record(currentTestResult); 41 | 42 | if(result.getThrowable() != null) { throw result.getThrowable(); } 43 | return result.getReturnValue(); 44 | } 45 | 46 | /* ----------------- Proxy Interface implementation --------------------------- */ 47 | @Override 48 | public void setTest(AbstractTest test) { this.test = test; } 49 | 50 | @Override 51 | public void setTarget(Worker target) { this.target = target; } 52 | 53 | @Override 54 | public void setBenchmark(Benchmark benchmark) { this.benchmark = benchmark; } 55 | 56 | @Override 57 | public Benchmark benchmark() { return benchmark; } 58 | /* --------------------------------------------------------------------------- */ 59 | } 60 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/TestInternalSuiteStructural.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday; 13 | 14 | import com.adobe.qe.toughday.api.annotations.ConfigArgGet; 15 | import com.adobe.qe.toughday.api.annotations.ConfigArgSet; 16 | import com.adobe.qe.toughday.internal.core.ReflectionsContainer; 17 | import com.adobe.qe.toughday.metrics.Metric; 18 | import com.adobe.qe.toughday.structural.TestConfigGetAnnotatedMethod; 19 | import com.adobe.qe.toughday.structural.TestConfigSetAnnotatedMethod; 20 | import com.adobe.qe.toughday.structural.TestConstructor; 21 | import junit.framework.TestCase; 22 | import junit.framework.TestSuite; 23 | import org.apache.logging.log4j.LogManager; 24 | import org.apache.logging.log4j.core.LoggerContext; 25 | 26 | import java.io.IOException; 27 | import java.lang.reflect.Method; 28 | 29 | public class TestInternalSuiteStructural extends TestCase { 30 | 31 | public static TestSuite suite() throws IOException { 32 | System.setProperty("logFileName", "."); 33 | 34 | TestSuite suite = new TestSuite(); 35 | 36 | for (Class TDMetricClass : ReflectionsContainer.getSubTypesOf(Metric.class)) { 37 | suite.addTest(new TestConstructor("test", TDMetricClass)); 38 | for (Method method : TDMetricClass.getDeclaredMethods()) { 39 | if (method.getAnnotation(ConfigArgSet.class) != null) { 40 | suite.addTest(new TestConfigSetAnnotatedMethod("testModifier", method)); 41 | suite.addTest(new TestConfigSetAnnotatedMethod("testArguments", method)); 42 | } 43 | if (method.getAnnotation(ConfigArgGet.class) != null) { 44 | suite.addTest(new TestConfigGetAnnotatedMethod("testModifier", method)); 45 | suite.addTest(new TestConfigGetAnnotatedMethod("testArguments", method)); 46 | } 47 | } 48 | 49 | } 50 | 51 | return suite; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /toughday/src/test/java/com/adobe/qe/toughday/feeders/MockFeederTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.qe.toughday.feeders; 13 | 14 | import com.adobe.qe.toughday.api.annotations.feeders.FeederSet; 15 | import com.adobe.qe.toughday.api.core.AbstractTest; 16 | import com.adobe.qe.toughday.api.core.SequentialTest; 17 | import com.adobe.qe.toughday.api.feeders.InputFeeder; 18 | import com.adobe.qe.toughday.api.feeders.OutputFeeder; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | public class MockFeederTest extends SequentialTest { 24 | 25 | private InputFeeder inputFeeder1; 26 | private InputFeeder inputFeeder2; 27 | private OutputFeeder outputFeeder1; 28 | private OutputFeeder outputFeeder2; 29 | 30 | @FeederSet(required = false) 31 | public void setInputFeeder1(InputFeeder inputFeeder1) { 32 | this.inputFeeder1 = inputFeeder1; 33 | } 34 | 35 | public InputFeeder getInputFeeder1() { 36 | return inputFeeder1; 37 | } 38 | 39 | @FeederSet(required = false) 40 | public void setInputFeeder2(InputFeeder inputFeeder2) { 41 | this.inputFeeder2 = inputFeeder2; 42 | } 43 | 44 | public InputFeeder getInputFeeder2() { 45 | return inputFeeder2; 46 | } 47 | 48 | @FeederSet(required = false) 49 | public void setOutputFeeder1(OutputFeeder outputFeeder1) { 50 | this.outputFeeder1 = outputFeeder1; 51 | } 52 | 53 | public OutputFeeder getOutputFeeder1() { 54 | return outputFeeder1; 55 | } 56 | 57 | @FeederSet(required = false) 58 | public void setOutputFeeder2(OutputFeeder outputFeeder2) { 59 | this.outputFeeder2 = outputFeeder2; 60 | } 61 | 62 | public OutputFeeder getOutputFeeder2() { 63 | return outputFeeder2; 64 | } 65 | 66 | @Override 67 | public void test() throws Throwable { 68 | 69 | } 70 | 71 | @Override 72 | public AbstractTest newInstance() { 73 | return null; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /toughday/README.md: -------------------------------------------------------------------------------- 1 | # Deploying to S3 2 | This project is able to deploy the artifact to S3 using the [maven-s3-wagon](https://github.com/jcaddel/maven-s3-wagon) 3 | plugin. In order to use and configure maven for S3 deployment one must get hold of AWS access and secret keys that have 4 | appropriate permission on a S3 bucket. 5 | 6 | ## Configuration 7 | In order to deploy to S3 one must configure it's maven settings with the S3 bucket name and the AWS access key and AWS 8 | secret key. Steps to perform: 9 | 10 | ### Encrypt the AWS secret key 11 | It's recommended to use [Maven Password Encryption](https://maven.apache.org/guides/mini/guide-encryption.html) to 12 | encrypt the AWS secret key (e.g. NpT45lGrl8rjVtPDGWEkAXITxU56P1Hxz) for use in the maven settings.xml file 13 | (like with passwords). 14 | 15 | ``` 16 | $ mvn -ep NpT45lGrl8rjVtPDGWEkAXITxU56P1Hxz 17 | {RHvm+kpJpFAHwMNgOh/293R6l+nr1luTs4X8RmD/PyenjBfXGHedZ8YkhARCO0oCNb/2XyTaujpoFb6mpEUs4A==} 18 | ``` 19 | 20 | ### Modify the settings.xml 21 | Modify your _~/.m2/settings.xml_ file. Add a new `` element. Use your AWS access key for the `` and 22 | the encrypted AWS secret for the ``. 23 | 24 | ``` 25 | 26 | ... 27 | 28 | s3-deploy-repo 29 | AKICIIQBZF123DIIL2BKHQ 30 | {RHvm+kpJpFAHwMNgOh/293R6l+nr1luTs4X8RmD/PyenjBfXGHedZ8YkhARCO0oCNb/2XyTaujpoFb6mpEUs4A==} 31 | Private 32 | 33 | ... 34 | 35 | 36 | ``` 37 | 38 | ## Deploying to S3 39 | Once the configuration is done, one can deploy to S3 using the `deploy:deploy-file` goal: 40 | ``` 41 | mvn deploy:deploy-file -Durl=s3:///big-bear/binaries/toughday -DrepositoryId=s3-deploy-repo -Dfile=target/toughday2-0.2.2-SNAPSHOT.jar -DpomFile=pom.xml 42 | ``` 43 | 44 | ## Deploying a release to S3 45 | AFAIK maven can only deal with one deployment repo at the same time, so it's not possible deploy during the release to 46 | Artifactory and S3 in one go. The workaround is to first run a regular release that deploys to Artifactory, then 47 | checkout the release tag and run the deploy to S3. 48 | 49 | Checkout the release tag (adjust to the release tag chosen during release:prepare step): 50 | ``` 51 | git checkout -b toughday2-0.1.0 tags/toughday2-0.1.0 52 | ``` 53 | 54 | Build: 55 | ``` 56 | mvn clean install 57 | ``` 58 | 59 | Deploy the tag to S3, adjust S3 url accordingly: 60 | ``` 61 | mvn deploy:deploy-file -Durl=s3:///big-bear/binaries/toughday -DrepositoryId=s3-deploy-repo -Dfile=target/toughday2-0.1.0.jar -DpomFile=pom.xml 62 | ``` --------------------------------------------------------------------------------