-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bacb60
commit e955a59
Showing
3 changed files
with
67 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,44 @@ | ||
package at.mep.utiltest; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** Created by Gavri on 2017-05-16. */ | ||
public class UtilTest { | ||
|
||
public void setUpEnvironMent() { | ||
|
||
public static void setUpEnvironMent() { | ||
try { | ||
startMatlab(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
private void setUpFileStructureEnvironment() { | ||
private static void startMatlab() throws IOException { | ||
/* | ||
https://stackoverflow.com/questions/14596599/run-command-prompt-as-administrator | ||
https://stackoverflow.com/questions/16316950/java-junit-how-to-test-if-an-external-program-process-application-is-running | ||
*/ | ||
|
||
String exe = "G:\\Program Files\\MATLAB\\R2016b\\bin\\matlab.exe"; | ||
|
||
// nothing happens | ||
String startUpCmd = "-r fprintf('test')"; | ||
|
||
// still nothing | ||
String startMEP = "at.mep.Start.start('F:\\Coding\\IntelliJ\\matlab-editor-plugin\\out\\artifacts\\MEP_1_14\\CustomProps.properties', 'F:\\Coding\\IntelliJ\\matlab-editor-plugin\\out\\artifacts\\MEP_1_14\\DefaultProps.properties')"; | ||
|
||
// works... at least *yay* | ||
String jdb = "-jdb"; | ||
|
||
List<String> command = new ArrayList<>(5); | ||
command.add(exe); | ||
command.add(jdb); | ||
Process process = new ProcessBuilder(command).start(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
% at.mep.Start.start(... | ||
% 'F:\Coding\IntelliJ\matlab-editor-plugin\out\artifacts\MEP_1_14\CustomProps.properties', ... | ||
% 'F:\Coding\IntelliJ\matlab-editor-plugin\out\artifacts\MEP_1_14\DefaultProps.properties'); | ||
|
||
fprintf('\nUNIT-TEST: wrong startup') | ||
fprintf('\nHOME > Preferences > MATLAB > General > Initial working folder > SPECIFY FOLDER WHERE STARTUP IS LOCATED') | ||
fprintf('\n') | ||
fprintf('\nmake sure that javaclasspath is set correctly') | ||
fprintf('\nedit javaclasspath.txt') | ||
fprintf('\nwinopen(prefdir)') |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package at.mep.utiltest; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class UtilTestTest { | ||
@BeforeEach | ||
void setUp() { | ||
} | ||
|
||
@AfterEach | ||
void tearDown() { | ||
} | ||
|
||
@Test | ||
void startMatlab() { | ||
UtilTest.setUpEnvironMent(); | ||
} | ||
|
||
} |