-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[repository-util] Command line not getting style for repository valid…
…ator class #169
- Loading branch information
1 parent
2071326
commit 76f5dc7
Showing
3 changed files
with
129 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 9 additions & 28 deletions
37
...ry-util/src/test/java/io/fixprotocol/orchestra/repository/FixRepositoryValidatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,30 @@ | ||
package io.fixprotocol.orchestra.repository; | ||
|
||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.FileOutputStream; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class FixRepositoryValidatorTest { | ||
|
||
private FixRepositoryValidator validator; | ||
private io.fixprotocol.orchestra.event.EventListener eventLogger; | ||
|
||
@BeforeAll | ||
public static void setupOnce() { | ||
new File(("target/test")).mkdirs(); | ||
} | ||
|
||
@BeforeEach | ||
public void setUp() throws Exception { | ||
final OutputStream jsonOutputStream = | ||
new FileOutputStream("target/test/repositoryvalidator.json"); | ||
eventLogger = RepositoryValidator.createLogger(jsonOutputStream); | ||
validator = new FixRepositoryValidator(eventLogger); | ||
} | ||
|
||
@AfterEach | ||
public void cleanUp() throws Exception { | ||
eventLogger.close(); | ||
} | ||
|
||
@Test | ||
public void testValidateWithErrors() throws FileNotFoundException { | ||
InputStream inputStream = new FileInputStream("src/test/resources/repositorywitherrors.xml"); | ||
validator.validate(inputStream); | ||
public void testValidateWithErrors() { | ||
RepositoryValidator | ||
.main(new String[] {"-s", "FIX", "-e", "src/test/resources/repositorywitherrors.json", | ||
"src/test/resources/repositorywitherrors.xml"}); | ||
} | ||
|
||
@Disabled | ||
@Test | ||
public void testValidate() throws FileNotFoundException { | ||
InputStream inputStream = new FileInputStream("src/test/resources/OrchestraFIXLatest.xml"); | ||
validator.validate(inputStream); | ||
public void testValidate() { | ||
RepositoryValidator.main(new String[] {"-s", "FIX", "-e", | ||
"src/test/resources/OrchestraFIXLatest.json", "src/test/resources/OrchestraFIXLatest.xml"}); | ||
} | ||
|
||
} |