mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-09 15:14:27 +02:00
Add guard for the other OSes
This commit is contained in:
parent
f8327ae087
commit
a00267a687
@ -17,7 +17,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class SnappyHadoopCompatibleOutputStreamTest
|
public class SnappyHadoopCompatibleOutputStreamTest
|
||||||
{
|
{
|
||||||
|
|
||||||
private static File tempNativeLibFolder;
|
private static File tempNativeLibFolder;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
@ -80,6 +79,14 @@ public class SnappyHadoopCompatibleOutputStreamTest
|
|||||||
@Test
|
@Test
|
||||||
public void testXerialCompressionHadoopDecompressionCodec() throws Exception
|
public void testXerialCompressionHadoopDecompressionCodec() throws Exception
|
||||||
{
|
{
|
||||||
|
String os = OSInfo.getOSName();
|
||||||
|
String arch = OSInfo.getArchName();
|
||||||
|
if(!((os.equals("Linux") || os.equals("Mac")) && arch.equals("x86_64"))) {
|
||||||
|
// This test works only in Linux/Mac x86_64
|
||||||
|
System.err.println("SnappyHadoopCompatibleOutputStreamTest works only in 64-bit Linux/Mac");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
File inputFile = File.createTempFile("TEST_hadoop_compatibility", ".txt");
|
File inputFile = File.createTempFile("TEST_hadoop_compatibility", ".txt");
|
||||||
File snappyFile = File.createTempFile("TEST_hadoop_compatibility", ".snappy");
|
File snappyFile = File.createTempFile("TEST_hadoop_compatibility", ".snappy");
|
||||||
InputStream snappyInput = null;
|
InputStream snappyInput = null;
|
||||||
@ -97,6 +104,7 @@ public class SnappyHadoopCompatibleOutputStreamTest
|
|||||||
|
|
||||||
compress(inputFile, snappyFile);
|
compress(inputFile, snappyFile);
|
||||||
|
|
||||||
|
// Test using Hadoop's Snappy Codec
|
||||||
if (tempNativeLibFolder != null) {
|
if (tempNativeLibFolder != null) {
|
||||||
SnappyCodec hadoopCodec = new SnappyCodec();
|
SnappyCodec hadoopCodec = new SnappyCodec();
|
||||||
hadoopCodec.setConf(new Configuration());
|
hadoopCodec.setConf(new Configuration());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user