Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Unit Tests #16

Open
GavriYashar opened this issue Sep 15, 2016 · 1 comment
Open

Write Unit Tests #16

GavriYashar opened this issue Sep 15, 2016 · 1 comment

Comments

@GavriYashar
Copy link
Owner

GavriYashar commented Sep 15, 2016

Seriously I should find a way.

The dependency issue makes it kind of hard to write Unit-Tests, so i should write pseudo tests to run from Matlab.
start Matlab before unit testing, wait until finished then and continue,

Process process = new ProcessBuilder(command).start();

e.g.:

public class MFileTest {
    File testLocation;
    File classExampleFIle;

    public static void runTest() throws Exception {
        MFileTest mFileTest = new MFileTest();
        mFileTest.setUp();
        mFileTest.constructForClassDef();
        mFileTest.tearDown();
    }

    private void setUp() throws Exception {
        String testLocationString = Install.getJarFile().getParent();
        testLocation = new File(testLocationString);
        classExampleFIle = new File(testLocationString + "/ClassExample.m");

        FileUtils.exportResource("/ClassExample.m", classExampleFIle);
    }

    private void tearDown() throws Exception {

    }

    private void constructForClassDef() throws FileNotFoundException {
        InputStream stream = new FileInputStream(classExampleFIle);
        String string = FileUtils.readInputStreamToString(stream);

        MTree mTree = MTree.parse(string);
    }
@GavriYashar
Copy link
Owner Author

GavriYashar commented May 11, 2017

java.awt.Robot;

*.getBounds()
*.getLocationOnScreen()

Written a simple test, when Parsing String to MTree:

java.lang.UnsatisfiedLinkError: com.mathworks.widgets.text.mcode.MTree.nativeParse(Ljava/lang/String;Z)Lcom/mathworks/widgets/text/mcode/MTree;

tried to add all *.jar files to libraries (799).

another hint: nativemlint (is a .dll)

dependencywalker

GavriYashar added a commit that referenced this issue Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant