Skip to content
Snippets Groups Projects
Commit efb03d74 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Ensure write error test works even for privileged user.

Fixes #386
parent 1bc5881a
No related branches found
No related tags found
No related merge requests found
...@@ -22,11 +22,6 @@ import java.io.File; ...@@ -22,11 +22,6 @@ import java.io.File;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.PosixFileAttributeView;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermissions;
import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.Rotation;
import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.RotationConvention;
...@@ -239,16 +234,7 @@ public class DumpManagerTest { ...@@ -239,16 +234,7 @@ public class DumpManagerTest {
@Test @Test
public void testWriteError() throws URISyntaxException, IOException { public void testWriteError() throws URISyntaxException, IOException {
try { try {
File dump = tempFolder.newFile(); DumpManager.activate(tempFolder.getRoot());
dump.setReadOnly();
Path path = dump.toPath();
PosixFileAttributes attributes = Files.getFileAttributeView(path, PosixFileAttributeView.class).readAttributes();
System.out.println(PosixFilePermissions.toString(attributes.permissions()) + " " +
attributes.group().getName() + " " + attributes.owner().getName() + " " +
path);
DumpManager.activate(dump);
variousRuggedCalls();
DumpManager.deactivate();
Assert.fail("an exception should have been thrown"); Assert.fail("an exception should have been thrown");
} catch (RuggedException re) { } catch (RuggedException re) {
Assert.assertEquals(RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, re.getSpecifier()); Assert.assertEquals(RuggedMessages.DEBUG_DUMP_ACTIVATION_ERROR, re.getSpecifier());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment