├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── config └── checkstyle │ ├── checkstyle.xml │ └── suppressions.xml ├── fix-42-codecs └── README.md ├── fix-44-codecs └── README.md ├── fix-50-codecs └── README.md ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle ├── test-fix-42 └── src │ └── test │ ├── java │ └── uk │ │ └── co │ │ └── real_logic │ │ └── artio │ │ └── acceptance_tests │ │ ├── Fix42ResendRequestChunkSizeAcceptanceTest.java │ │ ├── Fix42SpecAcceptanceTest.java │ │ └── NewOrderSingleClonerImpl.java │ └── resources │ └── custom_definitions │ └── fix42 │ ├── 10_MsgSeqNumGreater.def │ ├── 1a_ValidLogonMsgSeqNumTooHigh.def │ ├── 1e_NotLogonMessage.def │ ├── 2b_MsgSeqNumTooHigh.def │ ├── 2q_MsgTypeNotValid.def │ ├── 2t_FirstThreeFieldsOutOfOrder.def │ ├── 3b_InvalidChecksum.def │ ├── 6_SendTestRequest.def │ ├── SequenceGapFollowedByMessageResent.def │ └── SequenceGapFollowedBySequenceResetWithGapFill.def ├── test-fix-44 └── src │ └── test │ ├── java │ └── uk │ │ └── co │ │ └── real_logic │ │ └── artio │ │ ├── acceptance_tests │ │ ├── Fix44ResendRequestChunkSizeAcceptanceTest.java │ │ ├── Fix44SpecAcceptanceTest.java │ │ ├── NewOrderSingleClonerImpl.java │ │ └── quickfix │ │ │ └── AcceptanceTestMessageCracker.java │ │ ├── integration_tests │ │ ├── AbstractOtfParserTest.java │ │ ├── ApplicationMessageValidationTest.java │ │ ├── DecoderQuickFixIntegrationTest.java │ │ ├── EncoderQuickFixIntegrationTest.java │ │ ├── MessageStringUtil.java │ │ ├── OtfParserQuickFixIntegrationTest.java │ │ ├── OtfParsesBytesFromEncoderTest.java │ │ ├── QuickFixMessageUtil.java │ │ └── SessionMessageValidationTest.java │ │ └── system_tests │ │ ├── FakeQuickFixApplication.java │ │ ├── GatewayToQuickFixSystemTest.java │ │ ├── QuickFixToGatewaySystemTest.java │ │ └── QuickFixUtil.java │ └── resources │ ├── custom_definitions │ └── fix44 │ │ ├── 10_MsgSeqNumGreater.def │ │ ├── 1a_ValidLogonMsgSeqNumTooHigh.def │ │ ├── 1e_NotLogonMessage.def │ │ ├── 2b_MsgSeqNumTooHigh.def │ │ ├── 2q_MsgTypeNotValid.def │ │ ├── 2t_FirstThreeFieldsOutOfOrder.def │ │ ├── 3b_InvalidChecksum.def │ │ ├── 6_SendTestRequest.def │ │ ├── SequenceGapFollowedByMessageResent.def │ │ └── SequenceGapFollowedBySequenceResetWithGapFill.def │ └── validation_dictionary.xml ├── test-fix-50 └── src │ └── test │ ├── java │ └── uk │ │ └── co │ │ └── real_logic │ │ └── artio │ │ └── acceptance_tests │ │ ├── Fix50ResendRequestChunkSizeAcceptanceTest.java │ │ ├── Fix50SessionCustomizationStrategy.java │ │ ├── Fix50SpecAcceptanceTest.java │ │ └── NewOrderSingleClonerImpl.java │ └── resources │ └── custom_definitions │ └── fix50 │ ├── 10_MsgSeqNumGreater.def │ ├── 14a_BadField.def │ ├── 1a_ValidLogonMsgSeqNumTooHigh.def │ ├── 1e_NotLogonMessage.def │ ├── 2b_MsgSeqNumTooHigh.def │ ├── 2q_MsgTypeNotValid.def │ ├── 2t_FirstThreeFieldsOutOfOrder.def │ ├── 3b_InvalidChecksum.def │ ├── 6_SendTestRequest.def │ ├── SequenceGapFollowedByMessageResent.def │ └── SequenceGapFollowedBySequenceResetWithGapFill.def └── test-framework └── src └── test ├── java └── uk │ └── co │ └── real_logic │ └── artio │ └── acceptance_tests │ ├── AbstractFixSpecAcceptanceTest.java │ ├── CustomMatchers.java │ ├── Environment.java │ ├── FakeAcceptanceTestHandler.java │ ├── NewOrderSingleCloner.java │ ├── TestConnection.java │ └── steps │ ├── ConfigureSessionStep.java │ ├── ConnectToServerStep.java │ ├── ExpectDisconnectStep.java │ ├── ExpectMessageStep.java │ ├── InitiateDisconnect.java │ ├── InitiateMessageStep.java │ ├── PrintCommentStep.java │ └── TestStep.java └── resources └── logback.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.bat text eol=crlf 3 | *.cmd text eol=crlf 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | GTAGS 3 | GRTAGS 4 | GPATH 5 | prop 6 | out 7 | 8 | # OS X 9 | .DS_Store 10 | 11 | # intellij 12 | .idea* 13 | *.iml 14 | 15 | # eclipse 16 | .project 17 | .classpath 18 | .settings 19 | 20 | # editors 21 | *.sublime-project 22 | *.sublime-workspace 23 | *~ 24 | *.swp 25 | 26 | # the build 27 | build-local.properties 28 | .gradle 29 | build 30 | 31 | # Benchmark timings 32 | timings.log 33 | 34 | # JVM crash reports 35 | hs_err_pid* 36 | 37 | fix-gateway-system-tests/logs/ 38 | acceptor-logs 39 | initiator-logs 40 | client-logs 41 | test-fix-42/engineCounters 42 | test-fix-44/engineCounters 43 | test-fix-50/engineCounters 44 | 45 | */aeron-archive/ 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Fix Integration Testing Project 2 | =============================== 3 | 4 | Acceptance testing definitions and data dictionary from the quickfix/j project with [Artio](https://github.com/real-logic/artio). 5 | 6 | In order to run tests, do the following: 7 | 8 | ```sh 9 | git clone https://github.com/real-logic/artio.git 10 | cd artio 11 | ./gradlew 12 | cd .. 13 | git clone https://github.com/quickfix-j/quickfixj.git 14 | git clone https://github.com/real-logic/fix-integration.git 15 | cd fix-integration 16 | ./gradlew 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | def quickfixVersion = "1.7.0-SNAPSHOT" 2 | def artioJavaVersion = '1.8' 3 | 4 | defaultTasks 'clean', 'build' 5 | 6 | ext { 7 | group = fixGroup 8 | version = fixVersion 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | mavenLocal() 14 | mavenCentral() 15 | maven { 16 | url "https://repo.marketcetera.org/maven" 17 | } 18 | } 19 | } 20 | 21 | subprojects { 22 | apply plugin: 'java' 23 | apply plugin: 'checkstyle' 24 | 25 | group = fixGroup 26 | version = fixVersion 27 | 28 | checkstyle.toolVersion = "9.3" 29 | 30 | tasks.withType(JavaCompile).configureEach { 31 | sourceCompatibility = artioJavaVersion 32 | targetCompatibility = artioJavaVersion 33 | options.encoding = 'UTF-8' 34 | options.deprecation = true 35 | } 36 | 37 | dependencies { 38 | implementation "uk.co.real-logic:artio-codecs:${fixVersion}" 39 | 40 | testImplementation 'org.hamcrest:hamcrest:2.2' 41 | testImplementation 'org.mockito:mockito-core:4.11.0' 42 | testImplementation 'junit:junit:4.13.2' 43 | testImplementation "org.quickfixj:quickfixj-messages-fix42:${quickfixVersion}" 44 | testImplementation "org.quickfixj:quickfixj-messages-fix44:${quickfixVersion}" 45 | testImplementation "org.quickfixj:quickfixj-messages-fix50:${quickfixVersion}" 46 | testImplementation "org.quickfixj:quickfixj-core:${quickfixVersion}" 47 | testImplementation 'ch.qos.logback:logback-classic:1.2.11' 48 | testImplementation 'org.apache.mina:mina-core:2.1.2' 49 | testImplementation "uk.co.real-logic:artio-core:${fixVersion}" 50 | 51 | testImplementation group: 'uk.co.real-logic', name: 'artio-core', version: "${fixVersion}", classifier: 'tests' 52 | testImplementation group: 'uk.co.real-logic', name: 'artio-system-tests', version: "${fixVersion}", classifier: 'tests' 53 | } 54 | 55 | test { 56 | testLogging { 57 | events 'skipped', 'failed' 58 | showStandardStreams = true 59 | exceptionFormat = 'full' 60 | afterSuite { desc, result -> 61 | if (!desc.parent) { 62 | println "Results: ${result.resultType} (${result.testCount} tests," + 63 | " ${result.successfulTestCount} successes," + 64 | " ${result.failedTestCount} failures," + 65 | " ${result.skippedTestCount} skipped)" 66 | } 67 | } 68 | } 69 | 70 | beforeTest { desc -> 71 | if (System.properties["printTestNames"] != null) { 72 | print "Executing test ${desc.name} [${desc.className}]" 73 | } 74 | } 75 | 76 | afterTest { desc, result -> 77 | if (System.properties["printTestNames"] != null) { 78 | println " with result: ${result.resultType}" 79 | } 80 | } 81 | } 82 | 83 | configurations { 84 | tests 85 | } 86 | 87 | configurations.configureEach { 88 | exclude module: 'artio-session-codecs' 89 | exclude module: 'artio-session-fixt-codecs' 90 | } 91 | 92 | test { 93 | systemProperties( 94 | 'java.net.preferIPv4Stack': true, 95 | 'fix.codecs.reject_unknown_field': true 96 | ) 97 | } 98 | } 99 | 100 | project(':test-framework') { 101 | tasks.register('testJar', Jar) { 102 | dependsOn testClasses 103 | archiveClassifier.set('tests') 104 | archiveBaseName.set("test-${project.archivesBaseName}") 105 | from sourceSets.test.output 106 | } 107 | 108 | artifacts { 109 | archives testJar 110 | tests testJar 111 | } 112 | } 113 | 114 | def getGeneratedDir(project) { 115 | file("${project.buildDir}/generated-src") 116 | } 117 | 118 | configure([project(':fix-42-codecs'), project(':fix-44-codecs'), project(':fix-50-codecs')]) { 119 | def generatedDir = getGeneratedDir(project) 120 | 121 | sourceSets { 122 | generated.java.srcDir generatedDir 123 | } 124 | 125 | compileGeneratedJava { 126 | dependsOn 'generateCodecs' 127 | classpath += sourceSets.main.runtimeClasspath 128 | } 129 | 130 | jar { 131 | from("$buildDir/classes/java/generated") { 132 | include '**/*.class' 133 | } 134 | } 135 | 136 | jar.dependsOn compileGeneratedJava 137 | } 138 | 139 | project(':fix-42-codecs') { 140 | checkstyle { 141 | sourceSets = [] 142 | } 143 | 144 | def generatedDir = getGeneratedDir(project) 145 | 146 | task generateCodecs(type: JavaExec) { 147 | mainClass.set('uk.co.real_logic.artio.dictionary.CodecGenerationTool') 148 | classpath = sourceSets.main.runtimeClasspath 149 | args = [generatedDir, '../../quickfixj/quickfixj-messages/quickfixj-messages-fix42/src/main/resources/FIX42.xml'] 150 | outputs.dir generatedDir 151 | } 152 | } 153 | 154 | project(':fix-44-codecs') { 155 | checkstyle { 156 | sourceSets = [] 157 | } 158 | 159 | def generatedDir = getGeneratedDir(project) 160 | 161 | task generateCodecs(type: JavaExec) { 162 | mainClass.set('uk.co.real_logic.artio.dictionary.CodecGenerationTool') 163 | classpath = sourceSets.main.runtimeClasspath 164 | args = [generatedDir, '../../quickfixj/quickfixj-messages/quickfixj-messages-fix44/src/main/resources/FIX44.xml'] 165 | outputs.dir generatedDir 166 | } 167 | } 168 | 169 | project(':fix-50-codecs') { 170 | checkstyle { 171 | sourceSets = [] 172 | } 173 | 174 | def generatedDir = getGeneratedDir(project) 175 | 176 | task generateCodecs(type: JavaExec) { 177 | mainClass.set('uk.co.real_logic.artio.dictionary.CodecGenerationTool') 178 | classpath = sourceSets.main.runtimeClasspath 179 | args = [generatedDir, '../../quickfixj/quickfixj-messages/quickfixj-messages-fixt11/src/main/resources/FIXT11.xml;' + 180 | '../../quickfixj/quickfixj-messages/quickfixj-messages-fix50sp2/src/main/resources/FIX50SP2.xml'] 181 | outputs.dir generatedDir 182 | } 183 | } 184 | 185 | project(':test-fix-42') { 186 | dependencies { 187 | implementation project(path: ':fix-42-codecs') 188 | testImplementation project(path: ':test-framework', configuration: 'tests') 189 | } 190 | } 191 | 192 | project(':test-fix-44') { 193 | dependencies { 194 | implementation project(path: ':fix-44-codecs') 195 | testImplementation project(path: ':test-framework', configuration: 'tests') 196 | } 197 | } 198 | 199 | project(':test-fix-50') { 200 | dependencies { 201 | implementation project(path: ':fix-50-codecs') 202 | testImplementation project(path: ':test-framework', configuration: 'tests') 203 | } 204 | } 205 | 206 | wrapper { 207 | gradleVersion = '8.1.1' 208 | distributionType = 'ALL' 209 | } 210 | -------------------------------------------------------------------------------- /config/checkstyle/checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 157 | 159 | 160 | 161 | 162 | 163 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /config/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /fix-42-codecs/README.md: -------------------------------------------------------------------------------- 1 | Directory into which codecs are generated. -------------------------------------------------------------------------------- /fix-44-codecs/README.md: -------------------------------------------------------------------------------- 1 | Directory into which the FIX 4.4 codecs are generated. -------------------------------------------------------------------------------- /fix-50-codecs/README.md: -------------------------------------------------------------------------------- 1 | Directory into which the FIXT11,FIX50SP2 codecs are generated. -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | fixVersion=0.91-SNAPSHOT 3 | fixGroup=uk.co.real-logic 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artiofix/fix-integration/e3766434d0ebb52542acc3ebed82f0a9456e5c21/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Use the maximum available, or set MAX_FD != -1 to use that value. 89 | MAX_FD=maximum 90 | 91 | warn () { 92 | echo "$*" 93 | } >&2 94 | 95 | die () { 96 | echo 97 | echo "$*" 98 | echo 99 | exit 1 100 | } >&2 101 | 102 | # OS specific support (must be 'true' or 'false'). 103 | cygwin=false 104 | msys=false 105 | darwin=false 106 | nonstop=false 107 | case "$( uname )" in #( 108 | CYGWIN* ) cygwin=true ;; #( 109 | Darwin* ) darwin=true ;; #( 110 | MSYS* | MINGW* ) msys=true ;; #( 111 | NONSTOP* ) nonstop=true ;; 112 | esac 113 | 114 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 115 | 116 | 117 | # Determine the Java command to use to start the JVM. 118 | if [ -n "$JAVA_HOME" ] ; then 119 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 120 | # IBM's JDK on AIX uses strange locations for the executables 121 | JAVACMD=$JAVA_HOME/jre/sh/java 122 | else 123 | JAVACMD=$JAVA_HOME/bin/java 124 | fi 125 | if [ ! -x "$JAVACMD" ] ; then 126 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 127 | 128 | Please set the JAVA_HOME variable in your environment to match the 129 | location of your Java installation." 130 | fi 131 | else 132 | JAVACMD=java 133 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 134 | 135 | Please set the JAVA_HOME variable in your environment to match the 136 | location of your Java installation." 137 | fi 138 | 139 | # Increase the maximum file descriptors if we can. 140 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 141 | case $MAX_FD in #( 142 | max*) 143 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 144 | # shellcheck disable=SC3045 145 | MAX_FD=$( ulimit -H -n ) || 146 | warn "Could not query maximum file descriptor limit" 147 | esac 148 | case $MAX_FD in #( 149 | '' | soft) :;; #( 150 | *) 151 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 152 | # shellcheck disable=SC3045 153 | ulimit -n "$MAX_FD" || 154 | warn "Could not set maximum file descriptor limit to $MAX_FD" 155 | esac 156 | fi 157 | 158 | # Collect all arguments for the java command, stacking in reverse order: 159 | # * args from the command line 160 | # * the main class name 161 | # * -classpath 162 | # * -D...appname settings 163 | # * --module-path (only if needed) 164 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 165 | 166 | # For Cygwin or MSYS, switch paths to Windows format before running java 167 | if "$cygwin" || "$msys" ; then 168 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 169 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 170 | 171 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 172 | 173 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 174 | for arg do 175 | if 176 | case $arg in #( 177 | -*) false ;; # don't mess with options #( 178 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 179 | [ -e "$t" ] ;; #( 180 | *) false ;; 181 | esac 182 | then 183 | arg=$( cygpath --path --ignore --mixed "$arg" ) 184 | fi 185 | # Roll the args list around exactly as many times as the number of 186 | # args, so each arg winds up back in the position where it started, but 187 | # possibly modified. 188 | # 189 | # NB: a `for` loop captures its iteration list before it begins, so 190 | # changing the positional parameters here affects neither the number of 191 | # iterations, nor the values presented in `arg`. 192 | shift # remove old arg 193 | set -- "$@" "$arg" # push replacement arg 194 | done 195 | fi 196 | 197 | 198 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 199 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 200 | 201 | # Collect all arguments for the java command; 202 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 203 | # shell script including quotes and variable substitutions, so put them in 204 | # double quotes to make sure that they get re-expanded; and 205 | # * put everything else in single quotes, so that it's not re-expanded. 206 | 207 | set -- \ 208 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 209 | -classpath "$CLASSPATH" \ 210 | org.gradle.wrapper.GradleWrapperMain \ 211 | "$@" 212 | 213 | # Stop when "xargs" is not available. 214 | if ! command -v xargs >/dev/null 2>&1 215 | then 216 | die "xargs is not available" 217 | fi 218 | 219 | # Use "xargs" to parse quoted args. 220 | # 221 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 222 | # 223 | # In Bash we could simply go: 224 | # 225 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 226 | # set -- "${ARGS[@]}" "$@" 227 | # 228 | # but POSIX shell has neither arrays nor command substitution, so instead we 229 | # post-process each arg (as a line of input to sed) to backslash-escape any 230 | # character that might be a shell metacharacter, then use eval to reverse 231 | # that process (while maintaining the separation between arguments), and wrap 232 | # the whole thing up as a single "set" statement. 233 | # 234 | # This will of course break if any of these variables contains a newline or 235 | # an unmatched quote. 236 | # 237 | 238 | eval "set -- $( 239 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 240 | xargs -n1 | 241 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 242 | tr '\n' ' ' 243 | )" '"$@"' 244 | 245 | exec "$JAVACMD" "$@" 246 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'fix-44-codecs', 'fix-42-codecs', 'fix-50-codecs', 'test-framework', 'test-fix-42', 'test-fix-44', 'test-fix-50' 2 | -------------------------------------------------------------------------------- /test-fix-42/src/test/java/uk/co/real_logic/artio/acceptance_tests/Fix42ResendRequestChunkSizeAcceptanceTest.java: -------------------------------------------------------------------------------- 1 | package uk.co.real_logic.artio.acceptance_tests; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.junit.runners.Parameterized; 5 | 6 | import java.nio.file.Path; 7 | import java.util.*; 8 | import java.util.function.Supplier; 9 | 10 | @RunWith(Parameterized.class) 11 | public class Fix42ResendRequestChunkSizeAcceptanceTest extends AbstractFixSpecAcceptanceTest 12 | { 13 | @Parameterized.Parameters(name = "Acceptance: {1}") 14 | public static Collection data() 15 | { 16 | return testsFor( 17 | CUSTOM_ROOT_PATH + "/fix42", 18 | QUICKFIX_RESEND_CHUNK_INCLUDE_LIST, 19 | () -> Environment.fix42(new NewOrderSingleClonerImpl(), RESEND_REQUEST_CHUNK_SIZE)); 20 | } 21 | 22 | public Fix42ResendRequestChunkSizeAcceptanceTest( 23 | final Path path, final Path filename, final Supplier environment) 24 | { 25 | super(path, filename, environment); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test-fix-42/src/test/java/uk/co/real_logic/artio/acceptance_tests/Fix42SpecAcceptanceTest.java: -------------------------------------------------------------------------------- 1 | package uk.co.real_logic.artio.acceptance_tests; 2 | 3 | import org.agrona.LangUtil; 4 | import org.junit.runner.RunWith; 5 | import org.junit.runners.Parameterized; 6 | 7 | import java.nio.file.Path; 8 | import java.util.*; 9 | import java.util.function.Supplier; 10 | 11 | @RunWith(Parameterized.class) 12 | public class Fix42SpecAcceptanceTest extends AbstractFixSpecAcceptanceTest 13 | { 14 | private static final String QUICKFIX_4_2_ROOT_PATH = QUICKFIX_SERVER_DEFINITIONS + "/fix42"; 15 | private static final String CUSTOM_4_2_ROOT_PATH = CUSTOM_ROOT_PATH + "/fix42"; 16 | 17 | /** 18 | * banned acceptance tests - not part of the spec we're aiming to support 19 | */ 20 | private static final Set EXCLUDE_LIST = new HashSet<>(Arrays.asList( 21 | "2r_UnregisteredMsgType.def", // how do we validate/configure this? 22 | 23 | "14i_RepeatingGroupCountNotEqual.def", // Is this required? 24 | "14j_OutOfOrderRepeatingGroupMembers.def", // Is this required? 25 | 26 | // Permanent Blacklist: 27 | 28 | // These tests are all run as integration tests using validation 29 | "14b_RequiredFieldMissing.def", // reject messages with required field missing 30 | "14e_IncorrectEnumValue.def", 31 | "14f_IncorrectDataFormat.def", 32 | "14h_RepeatedTag.def", 33 | 34 | // Refer to New Order Single, thus business domain validation. 35 | "19a_PossResendMessageThatHAsAlreadyBeenSent.def", 36 | "19b_PossResendMessageThatHasNotBeenSent.def", 37 | // These tests make new order single behaviour assumptions, we have equivalent unit tests to these that don't 38 | "2f_PossDupOrigSendingTimeTooHigh.def", 39 | "2g_PossDupNoOrigSendingTime.def", 40 | 41 | // Customers have asked for the opposite 42 | "15_HeaderAndBodyFieldsOrderedDifferently.def", 43 | "14g_HeaderBodyTrailerFieldsOutOfOrder.def" 44 | )); 45 | 46 | private static final List QUICKFIX_ACQUIRED_INCLUDE_LIST = Arrays.asList( 47 | "3c_GarbledMessage.def", 48 | "2d_GarbledMessage.def", 49 | "2m_BodyLengthValueNotCorrect.def"); 50 | 51 | private static final List QUICKFIX_INCLUDE_LIST = Arrays.asList( 52 | "1a_ValidLogonWithCorrectMsgSeqNum.def", 53 | "1b_DuplicateIdentity.def", 54 | "1c_InvalidTargetCompID.def", 55 | "1c_InvalidSenderCompID.def", 56 | // TODO: move this to a custom definition, for the modified error message 57 | // "1d_InvalidLogonBadSendingTime.def", 58 | "1d_InvalidLogonWrongBeginString.def", 59 | "1d_InvalidLogonLengthInvalid.def", 60 | "2a_MsgSeqNumCorrect.def", 61 | "2c_MsgSeqNumTooLow.def", 62 | "2e_PossDupAlreadyReceived.def", 63 | "2e_PossDupNotReceived.def", 64 | "2i_BeginStringValueUnexpected.def", 65 | "2k_CompIDDoesNotMatchProfile.def", 66 | "2o_SendingTimeValueOutOfRange.def", 67 | "4a_NoDataSentDuringHeartBtInt.def", 68 | "4b_ReceivedTestRequest.def", 69 | "7_ReceiveRejectMessage.def", 70 | //"8_AdminAndApplicationMessages.def", 71 | "8_OnlyAdminMessages.def", 72 | //"8_OnlyApplicationMessages.def", 73 | "10_MsgSeqNumEqual.def", 74 | "10_MsgSeqNumLess.def", 75 | "11c_NewSeqNoLess.def", 76 | "11a_NewSeqNoGreater.def", 77 | "11b_NewSeqNoEqual.def", 78 | "13b_UnsolicitedLogoutMessage.def", 79 | "14a_BadField.def", // reject messages with invalid field numbers 80 | "14c_TagNotDefinedForMsgType.def", // Tag not defined for this message type - add to set 81 | "14d_TagSpecifiedWithoutValue.def", // Tag specified without a value - needs a check, second set 82 | "QFJ648_NegativeHeartBtInt.def", 83 | "QFJ650_MissingMsgSeqNum.def" 84 | ); 85 | 86 | private static final List CUSTOM_INCLUDE_LIST = Arrays.asList( 87 | "1e_NotLogonMessage.def", // also has wrong target comp id 88 | // Edited logon at the end, sequence number looks invalid: 89 | "2b_MsgSeqNumTooHigh.def", 90 | "1a_ValidLogonMsgSeqNumTooHigh.def", 91 | "2q_MsgTypeNotValid.def", 92 | 93 | // Edited to make messages valid apart from first three fields 94 | "2t_FirstThreeFieldsOutOfOrder.def", 95 | 96 | "10_MsgSeqNumGreater.def", // Added reply to test request that looks valid 97 | "6_SendTestRequest.def", 98 | "3b_InvalidChecksum.def" // Modified to account for resend request with no NewOrderSingle 99 | ); 100 | 101 | @Parameterized.Parameters(name = "Acceptance: {1}") 102 | public static Collection data() 103 | { 104 | try 105 | { 106 | final List tests = new ArrayList<>(); 107 | tests.addAll(fix42Tests()); 108 | tests.addAll(fix42CustomisedTests()); 109 | tests.addAll(fix42AcquiredTests()); 110 | return tests; 111 | } 112 | catch (final Exception e) 113 | { 114 | LangUtil.rethrowUnchecked(e); 115 | return null; 116 | } 117 | } 118 | 119 | private static List fix42CustomisedTests() 120 | { 121 | return testsFor( 122 | CUSTOM_4_2_ROOT_PATH, 123 | CUSTOM_INCLUDE_LIST, 124 | () -> Environment.fix42(null, 0)); 125 | } 126 | 127 | private static List fix42Tests() 128 | { 129 | return testsFor( 130 | QUICKFIX_4_2_ROOT_PATH, 131 | QUICKFIX_INCLUDE_LIST, 132 | () -> Environment.fix42(null, 0)); 133 | } 134 | 135 | private static List fix42AcquiredTests() 136 | { 137 | return testsFor( 138 | QUICKFIX_4_2_ROOT_PATH, 139 | QUICKFIX_ACQUIRED_INCLUDE_LIST, 140 | () -> Environment.fix42(new NewOrderSingleClonerImpl(), 0)); 141 | } 142 | 143 | public Fix42SpecAcceptanceTest( 144 | final Path path, final Path filename, final Supplier environment) 145 | { 146 | super(path, filename, environment); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /test-fix-42/src/test/java/uk/co/real_logic/artio/acceptance_tests/NewOrderSingleClonerImpl.java: -------------------------------------------------------------------------------- 1 | package uk.co.real_logic.artio.acceptance_tests; 2 | 3 | import org.agrona.DirectBuffer; 4 | import uk.co.real_logic.artio.builder.Encoder; 5 | import uk.co.real_logic.artio.builder.NewOrderSingleEncoder; 6 | import uk.co.real_logic.artio.decoder.NewOrderSingleDecoder; 7 | import uk.co.real_logic.artio.util.AsciiBuffer; 8 | import uk.co.real_logic.artio.util.MutableAsciiBuffer; 9 | 10 | public class NewOrderSingleClonerImpl implements NewOrderSingleCloner 11 | { 12 | private final AsciiBuffer asciiBuffer = new MutableAsciiBuffer(); 13 | private final NewOrderSingleDecoder decoder = new NewOrderSingleDecoder(); 14 | private final NewOrderSingleEncoder encoder = new NewOrderSingleEncoder(); 15 | 16 | public Encoder clone(final DirectBuffer buffer, final int offset, final int length) 17 | { 18 | asciiBuffer.wrap(buffer); 19 | decoder.decode(asciiBuffer, offset, length); 20 | 21 | encoder 22 | .clOrdID(decoder.clOrdID(), decoder.clOrdIDLength()) 23 | .handlInst(decoder.handlInst()) 24 | .ordType(decoder.ordType()) 25 | .side(decoder.side()) 26 | .transactTime(decoder.transactTime(), decoder.transactTimeLength()) 27 | .symbol(decoder.symbol(), decoder.symbolLength()); 28 | 29 | if (decoder.hasOrderQty()) 30 | { 31 | encoder.orderQty(decoder.orderQty()); 32 | } 33 | 34 | return encoder; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test-fix-42/src/test/resources/custom_definitions/fix42/10_MsgSeqNumGreater.def: -------------------------------------------------------------------------------- 1 | # GapFill where MsgSeqNum is greater than the expected inbound MsgSeqNum 2 | 3 | iCONNECT 4 | I8=FIX.4.235=A34=149=TW52=