Skip to content

Commit f86e98d

Browse files
committed
[Java] Assert that included type is available via XInclude. PR #649.
1 parent ac38896 commit f86e98d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sbe-tool/src/test/java/uk/co/real_logic/sbe/xml/RelativeXIncludeTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import java.io.File;
1919
import java.net.URL;
2020

21+
import org.junit.Assert;
2122
import org.junit.Test;
2223

2324
import org.xml.sax.InputSource;
25+
2426
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.parse;
2527

2628
public class RelativeXIncludeTest
@@ -29,12 +31,14 @@ public class RelativeXIncludeTest
2931
public void shouldParseFileInSubDir()
3032
throws Exception
3133
{
32-
final ClassLoader classLoader = getClass().getClassLoader();
33-
final URL testResource = classLoader.getResource("sub/basic-schema.xml");
34-
final InputSource is = new InputSource(testResource.openStream());
34+
final URL testResource = getClass().getClassLoader().getResource("sub/basic-schema.xml");
35+
Assert.assertNotNull(testResource);
3536

37+
final InputSource is = new InputSource(testResource.openStream());
3638
final File file = new File(testResource.getFile());
3739
is.setSystemId(file.toPath().toAbsolutePath().getParent().toUri().toString());
38-
parse(is, ParserOptions.DEFAULT);
40+
final MessageSchema messageSchema = parse(is, ParserOptions.DEFAULT);
41+
42+
Assert.assertNotNull(messageSchema.getType("Symbol"));
3943
}
4044
}

0 commit comments

Comments
 (0)