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
Yakov Zhdanov
committed
Jan 28, 2015
1 parent
f0db0cc
commit c351a7b
Showing
4 changed files
with
68 additions
and
54 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
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
38 changes: 24 additions & 14 deletions
38
...va/org/apache/ignite/internal/util/ipc/shmem/GridIpcSharedMemoryNativeLoaderSelfTest.java
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,36 +1,46 @@ | |||
package org.apache.ignite.internal.util.ipc.shmem; | package org.apache.ignite.internal.util.ipc.shmem; | ||
|
|
||
import junit.framework.TestCase; | import junit.framework.*; | ||
import org.apache.ignite.internal.util.GridJavaProcess; | import org.apache.ignite.internal.util.*; | ||
import org.apache.ignite.internal.util.typedef.internal.*; | |||
|
|
||
import java.io.BufferedReader; | import java.io.*; | ||
import java.io.IOException; | import java.util.*; | ||
import java.io.InputStreamReader; | |||
import java.util.Collections; | |||
|
|
||
public class GridIpcSharedMemoryNativeLoaderSelfTest extends TestCase { | public class GridIpcSharedMemoryNativeLoaderSelfTest extends TestCase { | ||
|
|
||
public void testLoadWithCorruptedLibFile() throws Exception { | public void testLoadWithCorruptedLibFile() throws Exception { | ||
if (System.getProperty("os.name").toLowerCase().trim().startsWith("win")) return; | if (U.isWindows()) | ||
|
return; | ||
Process ps = GridJavaProcess.exec(LoadWithCorruptedLibFileTestRunner.class, null, null, null, null, Collections.<String>emptyList(), null).getProcess(); |
|
||
Process ps = GridJavaProcess.exec( | |||
LoadWithCorruptedLibFileTestRunner.class, | |||
null, | |||
null, | |||
null, | |||
null, | |||
Collections.<String>emptyList(), | |||
null | |||
).getProcess(); | |||
|
|
||
readStreams(ps); | readStreams(ps); | ||
|
|||
int code = ps.waitFor(); | int code = ps.waitFor(); | ||
|
|
||
assertEquals("Returned code have to be 0.", 0, code); | assertEquals("Returned code have to be 0.", 0, code); | ||
} | } | ||
|
|
||
private void readStreams(Process proc) throws IOException { | private void readStreams(Process proc) throws IOException { | ||
BufferedReader stdOut = new BufferedReader(new InputStreamReader(proc.getInputStream())); | BufferedReader stdOut = new BufferedReader(new InputStreamReader(proc.getInputStream())); | ||
|
|||
String s; | String s; | ||
while ((s = stdOut.readLine()) != null) { |
|
||
while ((s = stdOut.readLine()) != null) | |||
System.out.println("OUT>>>>>> " + s); | System.out.println("OUT>>>>>> " + s); | ||
} | |||
|
|
||
BufferedReader errOut = new BufferedReader(new InputStreamReader(proc.getErrorStream())); | BufferedReader errOut = new BufferedReader(new InputStreamReader(proc.getErrorStream())); | ||
while ((s = errOut.readLine()) != null) { |
|
||
while ((s = errOut.readLine()) != null) | |||
System.out.println("ERR>>>>>> " + s); | System.out.println("ERR>>>>>> " + s); | ||
} | |||
} | } | ||
} | } |
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