Skip to content

Commit

Permalink
Move test from FMUReader to TestReader
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Jan 8, 2024
1 parent dcea39c commit 114496a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
19 changes: 0 additions & 19 deletions fmuReader/src/main/java/fmureader/FMUReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,6 @@ public class FMUReader implements ExternalFormatReader
private static final String MODEL_DESCRIPTION = "modelDescription.xml";
private static final String BUILD_DESCRIPTION = "sources/buildDescription.xml";
private static final String TERMINALS_AND_ICONS = "terminalsAndIcons/terminalsAndIcons.xml";

public static void main(String[] args) throws IOException
{
if (args.length != 1)
{
System.err.println("Usage: FMUReader <fmu file>");
System.exit(1);
}

if (System.getProperty("fmureader.xsd") == null)
{
System.err.println("Usage: property fmureader.xsd must point to FMI schema XSD");
System.exit(1);
}

FMUReader reader = new FMUReader();
char[] vdm = reader.getText(new File(args[0]), Charset.forName("utf8"));
System.out.println(new String(vdm));
}

@Override
public char[] getText(File file, Charset charset) throws IOException
Expand Down
12 changes: 12 additions & 0 deletions fmuReader/src/test/java/fmureader/TestReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ public class TestReader
{
public static void main(String[] args) throws IOException
{
if (args.length != 1)
{
System.err.println("Usage: FMUReader <fmu file>");
System.exit(1);
}

if (System.getProperty("fmureader.xsd") == null)
{
System.err.println("Usage: property fmureader.xsd must point to FMI schema XSD");
System.exit(1);
}

FMUReader reader = new FMUReader();
char[] vdm = reader.getText(new File(args[0]), Charset.forName("utf8"));
System.out.println(new String(vdm));
Expand Down

0 comments on commit 114496a

Please sign in to comment.