Skip to content

Commit

Permalink
Prepared fix for issue #1118.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Oct 24, 2024
1 parent c9f7334 commit 3c18dd1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
2 changes: 2 additions & 0 deletions build-linux.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@
<!-- Copy files required for testing -->
<copy file="${testFolder}/stl2dat_ascii.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/stl2dat_binary.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-NetworkShortcut.lnk" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-Shortcut.lnk" overwrite="true" todir="${targetFolder}"/>

<!-- Compile tests -->
<javac
Expand Down
2 changes: 2 additions & 0 deletions build-macos-arm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@
<!-- Copy files required for testing -->
<copy file="${testFolder}/stl2dat_ascii.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/stl2dat_binary.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-NetworkShortcut.lnk" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-Shortcut.lnk" overwrite="true" todir="${targetFolder}"/>

<!-- Compile tests -->
<javac
Expand Down
2 changes: 2 additions & 0 deletions build-macos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@
<!-- Copy files required for testing -->
<copy file="${testFolder}/stl2dat_ascii.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/stl2dat_binary.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-NetworkShortcut.lnk" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-Shortcut.lnk" overwrite="true" todir="${targetFolder}"/>

<!-- Compile tests -->
<javac
Expand Down
2 changes: 2 additions & 0 deletions build-windows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@
<!-- Copy files required for testing -->
<copy file="${testFolder}/stl2dat_ascii.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/stl2dat_binary.stl" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-NetworkShortcut.lnk" overwrite="true" todir="${targetFolder}"/>
<copy file="${testFolder}/3782.jpg-Shortcut.lnk" overwrite="true" todir="${targetFolder}"/>

<!-- Compile tests -->
<javac
Expand Down
2 changes: 1 addition & 1 deletion test/org/nschmidt/ldparteditor/StlToDatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private UserSettingState createTestUserSettings() {
return userSettings;
}

private String resourcePath(String fileName) {
public static String resourcePath(String fileName) {
URL stlToTest = Thread.currentThread().getContextClassLoader().getResource(fileName);
String resPath = "(none)"; //$NON-NLS-1$
try {
Expand Down
17 changes: 2 additions & 15 deletions test/org/nschmidt/ldparteditor/Win32LnkParserTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.nschmidt.ldparteditor;


import static org.nschmidt.ldparteditor.StlToDatTest.resourcePath;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;

import org.junit.Test;
import org.nschmidt.ldparteditor.text.Win32LnkParser;
Expand All @@ -32,16 +31,4 @@ public void testLinkToFileOnNetwork() {

assertTrue(result.getName().contains("3782.jpg")); //$NON-NLS-1$
}

private String resourcePath(String fileName) {
URL stlToTest = Thread.currentThread().getContextClassLoader().getResource(fileName);
String resPath = "(none)"; //$NON-NLS-1$
try {
resPath = java.nio.file.Paths.get(stlToTest.toURI()).toString();
} catch (URISyntaxException e) {
fail("Resource " + fileName + " was not found."); //$NON-NLS-1$ //$NON-NLS-2$
}

return resPath;
}
}

0 comments on commit 3c18dd1

Please sign in to comment.