ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/45] incubator-ignite git commit: # ignite-117 : skip test for windows
Date Thu, 29 Jan 2015 15:32:46 GMT
# ignite-117 : skip test for windows


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2f4b3487
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2f4b3487
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2f4b3487

Branch: refs/heads/ignite-26
Commit: 2f4b348760989f4aa82a538f8b0b5e441621f9a7
Parents: 0632bb3
Author: Artem SHutak <ashutak@gridgain.com>
Authored: Tue Jan 27 21:44:33 2015 +0300
Committer: Artem SHutak <ashutak@gridgain.com>
Committed: Tue Jan 27 21:44:33 2015 +0300

----------------------------------------------------------------------
 ...GridIpcSharedMemoryNativeLoaderSelfTest.java |  8 +++--
 .../LoadIfLibFileWasCorruptedTestRunner.java    | 36 --------------------
 .../LoadWithCorruptedLibFileTestRunner.java     | 36 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2f4b3487/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
index c15748a..96ae3c5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
@@ -9,9 +9,11 @@ import java.io.InputStreamReader;
 import java.util.Collections;
 
 public class GridIpcSharedMemoryNativeLoaderSelfTest extends TestCase {
-    //TODO linux specific
-    public void testLoadIfLibFileWasCorrupted() throws Exception {
-        Process ps = GridJavaProcess.exec(LoadIfLibFileWasCorruptedTestRunner.class, null,
null, null, null, Collections.<String>emptyList(), null).getProcess();
+
+    public void testLoadWithCorruptedLibFile() throws Exception {
+        if (System.getProperty("os.name").toLowerCase().trim().startsWith("win")) return;
+
+        Process ps = GridJavaProcess.exec(LoadWithCorruptedLibFileTestRunner.class, null,
null, null, null, Collections.<String>emptyList(), null).getProcess();
 
         readStreams(ps);
         int code = ps.waitFor();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2f4b3487/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadIfLibFileWasCorruptedTestRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadIfLibFileWasCorruptedTestRunner.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadIfLibFileWasCorruptedTestRunner.java
deleted file mode 100644
index 544d2c2..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadIfLibFileWasCorruptedTestRunner.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.ignite.internal.util.ipc.shmem;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-public class LoadIfLibFileWasCorruptedTestRunner {
-    public static final String TMP_DIR_FOR_TEST = System.getProperty("user.home");
-    public static final String LOADED_LIB_FILE_NAME = System.mapLibraryName(GridIpcSharedMemoryNativeLoader.libFileName());
-
-    public static void main(String[] args) throws Exception {
-        System.setProperty("java.io.tmpdir", TMP_DIR_FOR_TEST);
-
-        createCorruptedLibFile();
-
-        GridIpcSharedMemoryNativeLoader.load();
-    }
-
-    private static void createCorruptedLibFile() throws IOException {
-        File libFile = new File(System.getProperty("java.io.tmpdir"), LOADED_LIB_FILE_NAME);
-
-        if (libFile.exists() && ! libFile.delete())
-            throw new IllegalStateException("Could not delete loaded lib file.");
-
-        libFile.deleteOnExit();
-
-        if (! libFile.createNewFile())
-            throw new IllegalStateException("Could not create new file.");
-
-        try (FileOutputStream out = new FileOutputStream(libFile)) {
-            out.write("Corrupted file information instead of good info.\n".getBytes());
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2f4b3487/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
new file mode 100644
index 0000000..eec6b76
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/ipc/shmem/LoadWithCorruptedLibFileTestRunner.java
@@ -0,0 +1,36 @@
+package org.apache.ignite.internal.util.ipc.shmem;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+public class LoadWithCorruptedLibFileTestRunner {
+    public static final String TMP_DIR_FOR_TEST = System.getProperty("user.home");
+    public static final String LOADED_LIB_FILE_NAME = System.mapLibraryName(GridIpcSharedMemoryNativeLoader.libFileName());
+
+    public static void main(String[] args) throws Exception {
+        System.setProperty("java.io.tmpdir", TMP_DIR_FOR_TEST);
+
+        createCorruptedLibFile();
+
+        GridIpcSharedMemoryNativeLoader.load();
+    }
+
+    private static void createCorruptedLibFile() throws IOException {
+        File libFile = new File(System.getProperty("java.io.tmpdir"), LOADED_LIB_FILE_NAME);
+
+        if (libFile.exists() && ! libFile.delete())
+            throw new IllegalStateException("Could not delete loaded lib file.");
+
+        libFile.deleteOnExit();
+
+        if (! libFile.createNewFile())
+            throw new IllegalStateException("Could not create new file.");
+
+        try (FileOutputStream out = new FileOutputStream(libFile)) {
+            out.write("Corrupted file information instead of good info.\n".getBytes());
+        }
+    }
+
+
+}


Mime
View raw message