diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 0c0cc21a..c4d96cc6 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -12,15 +12,20 @@ on:
jobs:
build:
- runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ os: [ ubuntu-latest ]
+ java-version: [ 11 ]
+ distro: [ 'zulu', 'temurin' ]
+ runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 11
+ - name: Set up JDK ${{ matrix.java-version }} ${{ matrix.distro }}
uses: actions/setup-java@v2
with:
- java-version: '11'
- distribution: 'adopt'
+ java-version: ${{ matrix.java-version }}
+ distribution: ${{ matrix.distro }}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload package
diff --git a/README.md b/README.md
index 5e4eaa18..eebdb2ba 100644
--- a/README.md
+++ b/README.md
@@ -122,6 +122,9 @@ Data files in this project under `test/resources` are strictly for testing and t
## Build
The project is built with Maven version 3.3 or later.
-The project requires Java 11 or later. Some modules use Java Platform Module System (JPMS).
+This project requires Java 11 or later. It should run on any platform for which a JVM is supported. Some modules use Java Platform Module System (JPMS).
+
+Several open-source JDK implementations are available, including [Eclipse Temurin](https://adoptium.net/) and [Azul Zulu](https://www.azul.com/downloads/?package=jdk).
+
diff --git a/dsl-antlr/pom.xml b/dsl-antlr/pom.xml
index d1dd5b28..545c1e07 100644
--- a/dsl-antlr/pom.xml
+++ b/dsl-antlr/pom.xml
@@ -5,7 +5,7 @@
parent
io.fixprotocol.orchestra
- 1.7.3-SNAPSHOT
+ 1.7.3
4.0.0
dsl-antlr
diff --git a/interfaces-util/pom.xml b/interfaces-util/pom.xml
index 4a9c54ad..6b950f04 100644
--- a/interfaces-util/pom.xml
+++ b/interfaces-util/pom.xml
@@ -5,7 +5,7 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
interfaces-util
${project.groupId}:${project.artifactId}
diff --git a/interfaces/pom.xml b/interfaces/pom.xml
index a422f134..adf039fd 100644
--- a/interfaces/pom.xml
+++ b/interfaces/pom.xml
@@ -5,7 +5,7 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
interfaces
${project.groupId}:${project.artifactId}
diff --git a/message-model/pom.xml b/message-model/pom.xml
index dcca8a94..fcaf016f 100644
--- a/message-model/pom.xml
+++ b/message-model/pom.xml
@@ -5,7 +5,7 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
message-model
${project.groupId}:${project.artifactId}
diff --git a/orchestra-common/pom.xml b/orchestra-common/pom.xml
index cfca35f2..c95119d2 100644
--- a/orchestra-common/pom.xml
+++ b/orchestra-common/pom.xml
@@ -5,7 +5,7 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
orchestra-common
${project.groupId}:${project.artifactId}
diff --git a/orchestra2doc/pom.xml b/orchestra2doc/pom.xml
index 05df5851..4cbb10b2 100644
--- a/orchestra2doc/pom.xml
+++ b/orchestra2doc/pom.xml
@@ -5,7 +5,7 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
orchestra2doc
Generates humanly readable documentation
diff --git a/pom.xml b/pom.xml
index 7144df6f..38eb4714 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,10 +5,10 @@
4.0.0
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
pom
${project.groupId}:${project.artifactId}
- Parent project for FIX Orchestra. Build Java 8 by default, multi-release jar on demand.
+ Parent project for FIX Orchestra
https://github.com/FIXTradingCommunity/fix-orchestra/wiki
2016
@@ -67,10 +67,9 @@
4.9.2
11
1.4
- 1.2.6
- 5.6.1
+ 5.8.0
2.14.1
- 10.5
+ 10.6
1.7.22
4.3.1
2.12.3
diff --git a/repository-util/pom.xml b/repository-util/pom.xml
index 1c3afc5a..d9d9dbee 100644
--- a/repository-util/pom.xml
+++ b/repository-util/pom.xml
@@ -5,14 +5,14 @@
io.fixprotocol.orchestra
parent
- 1.7.3-SNAPSHOT
+ 1.7.3
repository-util
${project.groupId}:${project.artifactId}
Repository utilities
- 1.1.2
+ 1.2.0
diff --git a/repository-util/src/main/java/io/fixprotocol/orchestra/repository/BasicRepositoryValidator.java b/repository-util/src/main/java/io/fixprotocol/orchestra/repository/BasicRepositoryValidator.java
index 7ff3a72b..261a216b 100644
--- a/repository-util/src/main/java/io/fixprotocol/orchestra/repository/BasicRepositoryValidator.java
+++ b/repository-util/src/main/java/io/fixprotocol/orchestra/repository/BasicRepositoryValidator.java
@@ -3,7 +3,6 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
import java.net.URL;
import java.util.Iterator;
import java.util.Objects;
@@ -23,8 +22,6 @@
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -36,8 +33,6 @@
import io.fixprotocol.orchestra.dsl.antlr.Evaluator;
import io.fixprotocol.orchestra.dsl.antlr.ScoreException;
import io.fixprotocol.orchestra.event.EventListener;
-import io.fixprotocol.orchestra.event.EventListenerFactory;
-import io.fixprotocol.orchestra.event.TeeEventListener;
/**
* Validates that an Orchestra repository file conforms to the schema but does not apply
@@ -103,25 +98,7 @@ public Iterator getPrefixes(String arg0) {
}
};
- public static EventListener createLogger(OutputStream jsonOutputStream) {
- final Logger logger = LogManager.getLogger(BasicRepositoryValidator.class);
- final EventListenerFactory factory = new EventListenerFactory();
- TeeEventListener eventListener = null;
- try {
- eventListener = new TeeEventListener();
- final EventListener logEventLogger = factory.getInstance("LOG4J");
- logEventLogger.setResource(logger);
- eventListener.addEventListener(logEventLogger);
- if (jsonOutputStream != null) {
- final EventListener jsonEventLogger = factory.getInstance("JSON");
- jsonEventLogger.setResource(jsonOutputStream);
- eventListener.addEventListener(jsonEventLogger);
- }
- } catch (Exception e) {
- logger.error("Error creating event listener", e);
- }
- return eventListener;
- }
+
protected Predicate isValidBoolean = t -> true;
protected Predicate isValidChar = t -> t.length() == 1;
diff --git a/repository-util/src/main/java/io/fixprotocol/orchestra/repository/RepositoryValidator.java b/repository-util/src/main/java/io/fixprotocol/orchestra/repository/RepositoryValidator.java
index 4a098c06..2d328972 100644
--- a/repository-util/src/main/java/io/fixprotocol/orchestra/repository/RepositoryValidator.java
+++ b/repository-util/src/main/java/io/fixprotocol/orchestra/repository/RepositoryValidator.java
@@ -16,7 +16,12 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.OutputStream;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import io.fixprotocol.orchestra.event.EventListener;
+import io.fixprotocol.orchestra.event.EventListenerFactory;
+import io.fixprotocol.orchestra.event.TeeEventListener;
/**
* Validates an Orchestra repository file
@@ -62,6 +67,7 @@ public Builder style(String style) {
}
public static final String FIX_STYLE = "FIX";
+ final Logger logger = LogManager.getLogger(RepositoryValidator.class);
public static Builder builder() {
return new Builder();
@@ -76,10 +82,8 @@ public static Builder builder() {
* Usage: RepositoryValidator [options] <input-file>
* -e <logfile> name of event log
*
- *
- * @throws Exception if the file to validate cannot be found, read, or parsed
*/
- public static void main(String[] args) throws Exception {
+ public static void main(String[] args) {
final Builder builder = RepositoryValidator.builder();
for (int i = 0; i < args.length;) {
@@ -94,7 +98,7 @@ public static void main(String[] args) throws Exception {
i++;
}
final RepositoryValidator validator = builder.build();
- validator.validate();
+ System.exit(validator.validate() ? 0 : 1);
}
private final String eventFile;
@@ -108,8 +112,7 @@ private RepositoryValidator(Builder builder) {
}
public boolean validate() {
- try (EventListener eventLogger = FixRepositoryValidator
- .createLogger(eventFile != null ? new FileOutputStream(eventFile) : null)) {
+ try (EventListener eventLogger = createLogger(eventFile != null ? new FileOutputStream(eventFile) : null)) {
BasicRepositoryValidator impl;
if (FIX_STYLE.equals(this.style)) {
impl = new FixRepositoryValidator(eventLogger);
@@ -118,9 +121,29 @@ public boolean validate() {
}
return impl.validate(new FileInputStream(inputFile));
} catch (final Exception e) {
- System.err.println(e.getMessage());
+ logger.fatal("RepositoryValidator failed", e);
return false;
}
}
+
+ public static EventListener createLogger(OutputStream jsonOutputStream) {
+ final Logger logger = LogManager.getLogger(RepositoryValidator.class);
+ final EventListenerFactory factory = new EventListenerFactory();
+ TeeEventListener eventListener = null;
+ try {
+ eventListener = new TeeEventListener();
+ final EventListener logEventLogger = factory.getInstance("LOG4J");
+ logEventLogger.setResource(logger);
+ eventListener.addEventListener(logEventLogger);
+ if (jsonOutputStream != null) {
+ final EventListener jsonEventLogger = factory.getInstance("JSON");
+ jsonEventLogger.setResource(jsonOutputStream);
+ eventListener.addEventListener(jsonEventLogger);
+ }
+ } catch (Exception e) {
+ logger.error("Error creating event listener", e);
+ }
+ return eventListener;
+ }
}
diff --git a/repository-util/src/main/java/io/fixprotocol/orchestra/transformers/RepositoryCompressor.java b/repository-util/src/main/java/io/fixprotocol/orchestra/transformers/RepositoryCompressor.java
index 52bab83a..0af1a457 100644
--- a/repository-util/src/main/java/io/fixprotocol/orchestra/transformers/RepositoryCompressor.java
+++ b/repository-util/src/main/java/io/fixprotocol/orchestra/transformers/RepositoryCompressor.java
@@ -38,7 +38,6 @@
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
-import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.purl.dc.elements._1.ObjectFactory;
@@ -91,7 +90,6 @@ public static class Builder {
private Predicate messagePredicate;
private String outputFile;
private String logFile;
- private boolean verbose;
public RepositoryCompressor build() {
return new RepositoryCompressor(this);
@@ -102,11 +100,6 @@ public Builder eventLog(String logFile) {
return this;
}
- public Builder verbose(boolean verbose) {
- this.verbose = verbose;
- return this;
- }
-
Builder inputFile(String inputFile) {
this.inputFile = inputFile;
return this;
@@ -236,11 +229,16 @@ public static Builder builder() {
*
*
* @param args command line arguments
- * @throws Exception if an IO error occurs or a file cannot be parsed
*/
- public static void main(String[] args) throws Exception {
- final RepositoryCompressor compressor = RepositoryCompressor.parseArgs(args).build();
- compressor.compress();
+ public static void main(String[] args) {
+ RepositoryCompressor compressor;
+ try {
+ compressor = RepositoryCompressor.parseArgs(args).build();
+ System.exit(compressor.compress() ? 0 : 1);
+ } catch (ParseException e) {
+ System.err.println(e.getMessage());
+ System.exit(1);
+ }
}
public static Builder parseArgs(String[] args) throws ParseException {
@@ -349,121 +347,127 @@ static Predicate super MessageType> hasFlow() {
private final String outputFile;
private final File logFile;
-
- private final boolean verbose;
-
protected RepositoryCompressor(Builder builder) {
this.inputFile = builder.inputFile;
this.outputFile = builder.outputFile;
this.messagePredicate = builder.messagePredicate;
this.logFile = builder.logFile != null ? new File(builder.logFile) : null;
- this.verbose = builder.verbose;
}
- public void compress() throws Exception {
+ public boolean compress() {
try (InputStream is = new FileInputStream(this.inputFile);
OutputStream os = new FileOutputStream(this.outputFile)) {
- compress(is, os, this.messagePredicate);
+ return compress(is, os, this.messagePredicate);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+
+ return false;
}
}
- private void compress(InputStream is, OutputStream os,
- Predicate super MessageType> messagePredicate) throws JAXBException, IOException {
-
- final Level level = verbose ? Level.DEBUG : Level.ERROR;
- final Repository inRepository = unmarshal(is);
- final Categories categories = inRepository.getCategories();
- isCategoryInSection.setCategories(categories.getCategory());
- final Repository outRepository = new Repository();
- inRepository.copyTo(null, outRepository, AttributeCopyStrategy.INSTANCE);
-
- final ElementOrRefinementContainer metadata =
- (ElementOrRefinementContainer) inRepository.getMetadata().clone();
- final List> literals = metadata.getAny();
- final ObjectFactory objectFactory = new ObjectFactory();
- final SimpleLiteral contributor = new SimpleLiteral();
- contributor.getContent().add("RepositoryCompressor");
- literals.add(objectFactory.createContributor(contributor));
- outRepository.setMetadata(metadata);
-
- if (categories != null) {
- outRepository.setCategories((Categories) categories.clone());
- }
- final Sections sections = inRepository.getSections();
- if (sections != null) {
- outRepository.setSections((Sections) sections.clone());
- }
- final Datatypes datatypes = inRepository.getDatatypes();
- if (datatypes != null) {
- outRepository.setDatatypes((Datatypes) datatypes.clone());
- }
- final Actors actors = inRepository.getActors();
- if (actors != null) {
- outRepository.setActors((Actors) actors.clone());
- }
- final Components components = inRepository.getComponents();
- if (components != null) {
- final Components inComponents = (Components) components.clone();
- componentList = inComponents.getComponent();
- }
- final Groups groups = inRepository.getGroups();
- if (groups != null) {
- final Groups inGroups = (Groups) groups.clone();
- groupList = inGroups.getGroup();
- }
+ private boolean compress(InputStream is, OutputStream os,
+ Predicate super MessageType> messagePredicate) {
+ try {
+ final Repository inRepository = unmarshal(is);
+ final Categories categories = inRepository.getCategories();
+ isCategoryInSection.setCategories(categories.getCategory());
+ final Repository outRepository = new Repository();
+ inRepository.copyTo(null, outRepository, AttributeCopyStrategy.INSTANCE);
+
+ final ElementOrRefinementContainer metadata =
+ (ElementOrRefinementContainer) inRepository.getMetadata().clone();
+ final List> literals = metadata.getAny();
+ final ObjectFactory objectFactory = new ObjectFactory();
+ final SimpleLiteral contributor = new SimpleLiteral();
+ contributor.getContent().add("RepositoryCompressor");
+ literals.add(objectFactory.createContributor(contributor));
+ outRepository.setMetadata(metadata);
+
+ if (categories != null) {
+ outRepository.setCategories((Categories) categories.clone());
+ }
+ final Sections sections = inRepository.getSections();
+ if (sections != null) {
+ outRepository.setSections((Sections) sections.clone());
+ }
+ final Datatypes datatypes = inRepository.getDatatypes();
+ if (datatypes != null) {
+ outRepository.setDatatypes((Datatypes) datatypes.clone());
+ }
+ final Actors actors = inRepository.getActors();
+ if (actors != null) {
+ outRepository.setActors((Actors) actors.clone());
+ }
+ final Components components = inRepository.getComponents();
+ if (components != null) {
+ final Components inComponents = (Components) components.clone();
+ componentList = inComponents.getComponent();
+ }
+ final Groups groups = inRepository.getGroups();
+ if (groups != null) {
+ final Groups inGroups = (Groups) groups.clone();
+ groupList = inGroups.getGroup();
+ }
- final Messages messages = inRepository.getMessages();
- final List messageList;
- if (messages != null) {
- final Messages inMessages = (Messages) messages.clone();
- messageList = inMessages.getMessage();
- } else {
- messageList = Collections.emptyList();
+ final Messages messages = inRepository.getMessages();
+ final List messageList;
+ if (messages != null) {
+ final Messages inMessages = (Messages) messages.clone();
+ messageList = inMessages.getMessage();
+ } else {
+ messageList = Collections.emptyList();
+ }
+ final List filteredMessages =
+ messageList.stream().filter(messagePredicate).collect(Collectors.toList());
+ filteredMessages.forEach(m -> walk(m.getStructure().getComponentRefOrGroupRefOrFieldRef()));
+
+ final List distinctFieldIds =
+ fieldIdList.stream().distinct().collect(Collectors.toList());
+ final Fields inFields = (Fields) inRepository.getFields().clone();
+ final List fieldsWithFlow = inFields.getField().stream()
+ .filter(f -> distinctFieldIds.contains(f.getId())).collect(Collectors.toList());
+ final Fields outFields = new Fields();
+ outFields.getField().addAll(fieldsWithFlow);
+ outRepository.setFields(outFields);
+
+ final List typeList =
+ fieldsWithFlow.stream().map(FieldType::getType).distinct().collect(Collectors.toList());
+ final CodeSets inCodeSets = (CodeSets) inRepository.getCodeSets().clone();
+ final List codeSetsWithFlow = inCodeSets.getCodeSet().stream()
+ .filter(cs -> typeList.contains(cs.getName())).collect(Collectors.toList());
+ final CodeSets outCodeSets = new CodeSets();
+ outCodeSets.getCodeSet().addAll(codeSetsWithFlow);
+ outRepository.setCodeSets(outCodeSets);
+
+ final List distinctComponentsIds =
+ componentIdList.stream().distinct().collect(Collectors.toList());
+ final List componentsWithFlow = componentList.stream()
+ .filter(c -> distinctComponentsIds.contains(c.getId())).collect(Collectors.toList());
+ final Components outComponents = new Components();
+ outComponents.getComponent().addAll(componentsWithFlow);
+ outRepository.setComponents(outComponents);
+
+ final List distinctGroupIds =
+ groupIdList.stream().distinct().collect(Collectors.toList());
+ final List groupWithFlow = groupList.stream()
+ .filter(c -> distinctGroupIds.contains(c.getId())).collect(Collectors.toList());
+ final Groups outGroups = new Groups();
+ outGroups.getGroup().addAll(groupWithFlow);
+ outRepository.setGroups(outGroups);
+
+ final Messages outMessages = new Messages();
+ outMessages.getMessage().addAll(filteredMessages);
+ outRepository.setMessages(outMessages);
+
+ marshal(outRepository, os);
+ return true;
+ } catch (JAXBException e) {
+ logger.fatal("RepositoryCompressor failed", e);
+ return false;
}
- final List filteredMessages =
- messageList.stream().filter(messagePredicate).collect(Collectors.toList());
- filteredMessages.forEach(m -> walk(m.getStructure().getComponentRefOrGroupRefOrFieldRef()));
-
- final List distinctFieldIds =
- fieldIdList.stream().distinct().collect(Collectors.toList());
- final Fields inFields = (Fields) inRepository.getFields().clone();
- final List fieldsWithFlow = inFields.getField().stream()
- .filter(f -> distinctFieldIds.contains(f.getId())).collect(Collectors.toList());
- final Fields outFields = new Fields();
- outFields.getField().addAll(fieldsWithFlow);
- outRepository.setFields(outFields);
-
- final List typeList =
- fieldsWithFlow.stream().map(FieldType::getType).distinct().collect(Collectors.toList());
- final CodeSets inCodeSets = (CodeSets) inRepository.getCodeSets().clone();
- final List codeSetsWithFlow = inCodeSets.getCodeSet().stream()
- .filter(cs -> typeList.contains(cs.getName())).collect(Collectors.toList());
- final CodeSets outCodeSets = new CodeSets();
- outCodeSets.getCodeSet().addAll(codeSetsWithFlow);
- outRepository.setCodeSets(outCodeSets);
-
- final List distinctComponentsIds =
- componentIdList.stream().distinct().collect(Collectors.toList());
- final List componentsWithFlow = componentList.stream()
- .filter(c -> distinctComponentsIds.contains(c.getId())).collect(Collectors.toList());
- final Components outComponents = new Components();
- outComponents.getComponent().addAll(componentsWithFlow);
- outRepository.setComponents(outComponents);
-
- final List distinctGroupIds =
- groupIdList.stream().distinct().collect(Collectors.toList());
- final List groupWithFlow = groupList.stream()
- .filter(c -> distinctGroupIds.contains(c.getId())).collect(Collectors.toList());
- final Groups outGroups = new Groups();
- outGroups.getGroup().addAll(groupWithFlow);
- outRepository.setGroups(outGroups);
-
- final Messages outMessages = new Messages();
- outMessages.getMessage().addAll(filteredMessages);
- outRepository.setMessages(outMessages);
- marshal(outRepository, os);
}
private ComponentType getComponent(BigInteger id) {
diff --git a/repository-util/src/test/java/io/fixprotocol/orchestra/repository/FixRepositoryValidatorTest.java b/repository-util/src/test/java/io/fixprotocol/orchestra/repository/FixRepositoryValidatorTest.java
index 0b01843a..59f6fa48 100644
--- a/repository-util/src/test/java/io/fixprotocol/orchestra/repository/FixRepositoryValidatorTest.java
+++ b/repository-util/src/test/java/io/fixprotocol/orchestra/repository/FixRepositoryValidatorTest.java
@@ -25,7 +25,7 @@ public static void setupOnce() {
public void setUp() throws Exception {
final OutputStream jsonOutputStream =
new FileOutputStream("target/test/repositoryvalidator.json");
- eventLogger = FixRepositoryValidator.createLogger(jsonOutputStream);
+ eventLogger = RepositoryValidator.createLogger(jsonOutputStream);
validator = new FixRepositoryValidator(eventLogger);
}
diff --git a/repository-util/src/test/java/io/fixprotocol/orchestra/transformers/RepositoryCompressorTest.java b/repository-util/src/test/java/io/fixprotocol/orchestra/transformers/RepositoryCompressorTest.java
index 95d03c42..844d9a0c 100644
--- a/repository-util/src/test/java/io/fixprotocol/orchestra/transformers/RepositoryCompressorTest.java
+++ b/repository-util/src/test/java/io/fixprotocol/orchestra/transformers/RepositoryCompressorTest.java
@@ -1,5 +1,6 @@
package io.fixprotocol.orchestra.transformers;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -8,6 +9,10 @@
import org.junit.jupiter.api.Test;
import io.fixprotocol.orchestra.event.EventListener;
import io.fixprotocol.orchestra.repository.FixRepositoryValidator;
+import io.fixprotocol.orchestra.repository.RepositoryValidator;
+import io.fixprotocol.orchestra.transformers.RepositoryCompressor.HasCategory;
+import io.fixprotocol.orchestra.transformers.RepositoryCompressor.HasSection;
+import io.fixprotocol.orchestra.transformers.RepositoryCompressor.NotCategory;
public class RepositoryCompressorTest {
@@ -19,65 +24,78 @@ public static void setupOnce() {
@Test
public void tradeCaptureCategory() throws Exception {
final String outfile = "target/test/tradecapture.xml";
- // Include every category in the "Trade" section except "CrossOrders"
- RepositoryCompressor.main(new String[] {"-i", "src/test/resources/OrchestraFIXLatest.xml", "-o",
- outfile, "--category", "TradeCapture"});
- Assertions.assertTrue(new File(outfile).exists());
+ // Include every category in the "TradeCapture"
+ RepositoryCompressor compressor =
+ RepositoryCompressor.builder().inputFile("src/test/resources/OrchestraFIXLatest.xml")
+ .outputFile(outfile).messagePredicate(new HasCategory("TradeCapture")).build();
+ compressor.compress();
+ assertTrue(new File(outfile).exists());
final EventListener eventLogger =
- FixRepositoryValidator.createLogger(new FileOutputStream("target/test/tradecapture.json"));
+ RepositoryValidator.createLogger(new FileOutputStream("target/test/tradecapture.json"));
final FixRepositoryValidator validator = new FixRepositoryValidator(eventLogger);
- validator.validate(new FileInputStream(new File(outfile)));
+ assertTrue(validator.validate(new FileInputStream(new File(outfile))));
}
@Test
public void sectionExceptCategory() throws Exception {
final String outfile = "target/test/tradeX.xml";
// Include every category in the "Trade" section except "CrossOrders"
- RepositoryCompressor.main(new String[] {"-i", "src/test/resources/OrchestraFIXLatest.xml", "-o",
- outfile, "--section", "Trade", "--notcategory", "CrossOrders"});
+ RepositoryCompressor compressor =
+ RepositoryCompressor.builder().inputFile("src/test/resources/OrchestraFIXLatest.xml")
+ .outputFile(outfile)
+ .messagePredicate(new HasSection("Trade", RepositoryCompressor.isCategoryInSection)
+ .and(new NotCategory("CrossOrders")))
+ .build();
+ compressor.compress();
Assertions.assertTrue(new File(outfile).exists());
final EventListener eventLogger =
- FixRepositoryValidator.createLogger(new FileOutputStream("target/test/tradeX.json"));
+ RepositoryValidator.createLogger(new FileOutputStream("target/test/tradeX.json"));
final FixRepositoryValidator validator = new FixRepositoryValidator(eventLogger);
- validator.validate(new FileInputStream(new File(outfile)));
+ assertTrue(validator.validate(new FileInputStream(new File(outfile))));
}
@Test
public void pretrade() throws Exception {
final String outfile = "target/test/pretrade.xml";
- // Include every category in the "Trade" section except "CrossOrders"
- RepositoryCompressor.main(new String[] {"-i", "src/test/resources/OrchestraFIXLatest.xml", "-o",
- outfile, "--section", "PreTrade"});
- Assertions.assertTrue(new File(outfile).exists());
+ // Include every category in the "PreTrade" section
+ RepositoryCompressor compressor =
+ RepositoryCompressor.builder().inputFile("src/test/resources/OrchestraFIXLatest.xml")
+ .outputFile(outfile).messagePredicate(new HasSection("PreTrade", RepositoryCompressor.isCategoryInSection)).build();
+ compressor.compress();
+ assertTrue(new File(outfile).exists());
final EventListener eventLogger =
- FixRepositoryValidator.createLogger(new FileOutputStream("target/test/pretrade.json"));
+ RepositoryValidator.createLogger(new FileOutputStream("target/test/pretrade.json"));
final FixRepositoryValidator validator = new FixRepositoryValidator(eventLogger);
- validator.validate(new FileInputStream(new File(outfile)));
+ assertTrue(validator.validate(new FileInputStream(new File(outfile))));
}
@Test
public void posttrade() throws Exception {
final String outfile = "target/test/posttrade.xml";
- // Include every category in the "Trade" section except "CrossOrders"
- RepositoryCompressor.main(new String[] {"-i", "src/test/resources/OrchestraFIXLatest.xml", "-o",
- outfile, "--section", "PostTrade"});
+ // Include every category in the "PostTrade" section
+ RepositoryCompressor compressor =
+ RepositoryCompressor.builder().inputFile("src/test/resources/OrchestraFIXLatest.xml")
+ .outputFile(outfile).messagePredicate(new HasSection("PostTrade", RepositoryCompressor.isCategoryInSection)).build();
+ compressor.compress();
Assertions.assertTrue(new File(outfile).exists());
final EventListener eventLogger =
- FixRepositoryValidator.createLogger(new FileOutputStream("target/test/posttrade.json"));
+ RepositoryValidator.createLogger(new FileOutputStream("target/test/posttrade.json"));
final FixRepositoryValidator validator = new FixRepositoryValidator(eventLogger);
- validator.validate(new FileInputStream(new File(outfile)));
+ assertTrue(validator.validate(new FileInputStream(new File(outfile))));
}
@Test
public void session() throws Exception {
final String outfile = "target/test/fixt.xml";
- // Include every category in the "Trade" section except "CrossOrders"
- RepositoryCompressor.main(new String[] {"-i", "src/test/resources/OrchestraFIXLatest.xml", "-o",
- outfile, "--section", "Session"});
+ // Include every category in the "Session" section
+ RepositoryCompressor compressor =
+ RepositoryCompressor.builder().inputFile("src/test/resources/OrchestraFIXLatest.xml")
+ .outputFile(outfile).messagePredicate(new HasSection("Session", RepositoryCompressor.isCategoryInSection)).build();
+ compressor.compress();
Assertions.assertTrue(new File(outfile).exists());
final EventListener eventLogger =
- FixRepositoryValidator.createLogger(new FileOutputStream("target/test/fixt.json"));
+ RepositoryValidator.createLogger(new FileOutputStream("target/test/fixt.json"));
final FixRepositoryValidator validator = new FixRepositoryValidator(eventLogger);
- validator.validate(new FileInputStream(new File(outfile)));
+ assertTrue(validator.validate(new FileInputStream(new File(outfile))));
}
}
diff --git a/repository-util/src/test/resources/OrchestraFIXLatest.xml b/repository-util/src/test/resources/OrchestraFIXLatest.xml
index 5a6617bd..06b6ea4f 100644
--- a/repository-util/src/test/resources/OrchestraFIXLatest.xml
+++ b/repository-util/src/test/resources/OrchestraFIXLatest.xml
@@ -3,19 +3,19 @@
xmlns:fixr="http://fixprotocol.io/2020/orchestra/repository"
xmlns:functx="http://www.functx.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- name="FIX.5.0SP2"
- version="FIX.5.0SP2_EP264">
+ name="FIX.Latest"
+ version="FIX.Latest_EP269">
Orchestra
unified2orchestra.xslt script
FIX Trading Community
- 2020-11-15T21:45:37.62Z
+ 2021-08-14T22:38:48.950856Z
Orchestra schema
FIX Unified Repository
Copyright (c) FIX Protocol Ltd. All Rights Reserved.
-
+
@@ -50,7 +50,7 @@
-
+
@@ -78,7 +78,12 @@
-
+
-
+
-
+
-
+
@@ -1453,7 +1466,7 @@
-
+
@@ -1481,7 +1494,7 @@
-
+
-
+
@@ -1568,7 +1581,7 @@
-
+
@@ -1627,7 +1640,7 @@
-
+
@@ -3471,7 +3484,7 @@
-
+
@@ -3637,7 +3650,7 @@
-
+
@@ -3948,7 +3961,10 @@
-
+
-
+
-
+
-
+
@@ -4431,7 +4452,7 @@
-
+
-
+
-
+
@@ -4677,7 +4701,10 @@
-
+
@@ -4736,7 +4763,7 @@
-
+
-
+
-
+
-
+
@@ -5414,7 +5446,7 @@
-
+
-
+
@@ -5507,7 +5539,7 @@
-
+
-
+
-
+
-
+
-
+
@@ -6546,7 +6584,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -7223,7 +7275,12 @@
-
+
@@ -7473,7 +7530,12 @@
-
+
-
+
-
+
@@ -7624,7 +7692,10 @@
-
+
-
+
-
+
@@ -9668,7 +9745,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -9930,7 +10026,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -12280,16 +12396,19 @@
-
+ updated="FIX.Latest"
+ updatedEP="267">
- Trading session Volume Weighted Average Price (VWAP)
+ Volume Weighted Average Price
+
+
+ VWAP
@@ -12705,6 +12824,66 @@
Previous closing price
+
+
+
+
+
+
+ Threshold limits and price banding
+
+
+ Conveys incremental real time change to pre-configured or previously disseminated pricing thresholds and/or banding parameters.
+
+
+
+
+
+
+ Daily financing value
+
+
+ The financing cost of rolling an analogous total return swap from the previous business day to the current business day. In the context of Adjusted Interest Rate (AIR) futures this is a component of the cleared futures price.
+
+
+
+
+
+
+ Accrued financing value
+
+
+ The total of the daily funding values or amounts from a contract's first day of trading to the current day. In the context of Adjusted Interest Rate (AIR) futures this is a component of the cleared futures price.
+
+
+
+
+
+
+ Time Weighted Average Price
+
+
+ TWAP
@@ -12714,7 +12893,10 @@
-
+
-
+
@@ -13474,7 +13659,12 @@
-
+
@@ -14547,7 +14737,9 @@
value="6"
sort="104"
added="FIX.5.0SP2"
- addedEP="163">
+ addedEP="163"
+ deprecated="FIX.Latest"
+ deprecatedEP="268">
Benchmark
@@ -14563,7 +14755,10 @@
-
+
@@ -14635,7 +14830,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -17611,7 +17877,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -17905,7 +18183,7 @@
-
+
-
+
@@ -17966,7 +18244,7 @@
-
+
-
+
-
+
-
+
-
+
@@ -18585,7 +18871,7 @@
-
+
@@ -18606,7 +18892,10 @@
-
+
-
+
-
+
-
+
-
+
@@ -19199,7 +19502,7 @@
value="T"
group="For all PartyRoles"
sort="17"
- added="FIX.5.0SP2"
+ added="FIX.Latest"
addedEP="262">
@@ -19215,7 +19518,7 @@
value="U"
group="For all PartyRoles"
sort="18"
- added="FIX.5.0SP2"
+ added="FIX.Latest"
addedEP="262">
@@ -19233,7 +19536,12 @@
-
+
-
+
-
+
-
+
-
+
@@ -21152,7 +21469,10 @@
-
+
@@ -21199,7 +21519,10 @@
-
+
-
+
-
+
@@ -21427,7 +21756,7 @@
-
+
@@ -21655,7 +21984,10 @@
-
+
@@ -21994,7 +22326,10 @@
-
+
@@ -22015,7 +22350,7 @@
-
+
-
+
-
+
@@ -22316,7 +22657,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -23680,7 +24039,12 @@
-
+
-
+
@@ -23741,7 +24108,7 @@
-
+
-
+
@@ -23932,7 +24302,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -25290,7 +25705,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -26359,7 +26795,7 @@
id="660006"
value="6"
sort="6"
- added="FIX.5.0SP2"
+ added="FIX.Latest"
addedEP="262">
@@ -26387,7 +26823,7 @@
-
+
-
+
@@ -26485,7 +26924,7 @@
-
+
-
+
-
+
-
+
@@ -27034,7 +27483,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -28819,7 +29303,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -30087,7 +30602,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -31668,7 +32203,10 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+ updated="FIX.Latest"
+ updatedEP="268">
Portfolio trade
+
+
+ Identifies a collection/basket of trades. In the context of bonds (e.g. corporate bonds) these are transacted as a single trade at an aggregate price for the entire portfolio and may be traded all-or-none or most-or-none depending on bilateral agreement.
+ In the context of ESMA RTS 1 Article 2(b), may be used to refer to portfolio trades to distinguish between addressable and non-addressable volume.
+ In the context of Market Model Typology (MMT), use of this value applies to SecondaryTrdType(855) or TertiaryTrdType(2896), and when used for MMT market data publication requires MDEntryType(269) = 2 (Trade).
@@ -32559,13 +33126,15 @@
value="62"
sort="62"
added="FIX.5.0SP2"
- addedEP="163">
+ addedEP="163"
+ updated="FIX.Latest"
+ updatedEP="268">
Dark trade
- A Market Model Typology dark trade might also come from a lit/hybrid book, when an aggressive lit order hits a resting dark order.
+ In the context of Market Model Typology (MMT), a dark trade might also come from a lit/hybrid book (e.g. when an aggressive lit order hits a resting dark order). The use of this value applies to TrdType(828), and when used for MMT market data publication requires MDEntryType(269) = 2 (Trade).
@@ -32587,14 +33156,15 @@
sort="64"
added="FIX.5.0SP2"
addedEP="163"
- updated="FIX.5.0SP2"
- updatedEP="216">
+ updated="FIX.Latest"
+ updatedEP="268">
Benchmark
- For Market Model Typology (MMT) the "benchmark" price depends on a benchmark which has no current price but was derived from a time series such as a VWAP.
+ In the context of ESMA RTS 1 Article 2(a), may be used to refer to benchmark trades.
+ In the context of Market Model Typology (MMT), the "benchmark" price depends on a benchmark which has no current price but was derived from a time series such as a VWAP. The use of this value applies to SecondaryTrdType(855) or TertiaryTrdType(2896), and when used for MMT market data publication requires MDEntryType(269) = 2 (Trade).
@@ -32603,13 +33173,17 @@
value="65"
sort="65"
added="FIX.5.0SP2"
- addedEP="192">
+ addedEP="192"
+ updated="FIX.Latest"
+ updatedEP="268">
Package trade
- Identifies the pseudo-trade of a stream or collection of trades to be cleared and be reported as an atomic unit. The subsequent actual trades reported should not have this value.
+ Identifies the pseudo-trade of a stream or collection of trades to be transacted, cleared and be reported as an atomic unit. The subsequent actual trades reported should not have this value.
+ In the context of ESMA RTS 2 Article 1(1)(b), may be used to refer to package transactions (excluding exchange for physicals).
+ In the context of Market Model Typology (MMT), use of this value applies to TrdType(828), and when used for MMT market data publication requires MDEntryType(269) = 2 (Trade).
@@ -32968,14 +33542,14 @@
- Type of trade.
+ Type of trade assigned to a trade.
Note: several enumerations of this field duplicate the enumerations in TradePriceConditions(1839) field. These may be deprecated from TrdType(828) in the future. TradePriceConditions(1839) is preferred in messages that support it.
-
+
+ addedEP="201"
+ updated="FIX.Latest"
+ updatedEP="269">
Multilateral compression
- A subtype of TrdType(828) = 57 (Netted trade) in order to identify a special case of compression.
+ Used to identify a special case of compression between multiple parties, e.g. for netted or portfolio trades.
@@ -33341,8 +33917,38 @@
-
+
+
+ Trade submitted to venue for clearing and Identifies
+
+
+ Identifies trades brought on a trading venue purely for clearing and settlement purposes.
+
+
+
+
+
+
+ Bilateral compression
+
+
+ Used to identify a special case of compression between two parties, e.g. for netted or portfolio trades.
+
+
+
+
-
+
-
+
@@ -33714,7 +34320,7 @@
-
+
-
+
-
+
@@ -33830,7 +34439,10 @@
-
+
-
+
@@ -33898,7 +34513,10 @@
-
+
-
+
-
+
@@ -34014,7 +34638,10 @@
-
+