@ -23,9 +23,9 @@ public class EnvironmentTest {
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".jnilib" ) ;
isEqualTo ( ".jnilib" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-osx.jnilib" ) ;
isEqualTo ( "librocksdbjni-osx.jnilib" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.dylib" ) ;
isEqualTo ( "librocksdbjni.dylib" ) ;
}
}
@ -35,9 +35,9 @@ public class EnvironmentTest {
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".jnilib" ) ;
isEqualTo ( ".jnilib" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-osx.jnilib" ) ;
isEqualTo ( "librocksdbjni-osx.jnilib" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.dylib" ) ;
isEqualTo ( "librocksdbjni.dylib" ) ;
}
}
@ -48,27 +48,27 @@ public class EnvironmentTest {
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux32.so" ) ;
isEqualTo ( "librocksdbjni-linux32.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
// UNIX
// UNIX
setEnvironmentClassFields ( "Unix" , "32" ) ;
setEnvironmentClassFields ( "Unix" , "32" ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux32.so" ) ;
isEqualTo ( "librocksdbjni-linux32.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
// AIX
// AIX
setEnvironmentClassFields ( "aix" , "32" ) ;
setEnvironmentClassFields ( "aix" , "32" ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux32.so" ) ;
isEqualTo ( "librocksdbjni-linux32.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
}
}
@ -78,27 +78,27 @@ public class EnvironmentTest {
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux64.so" ) ;
isEqualTo ( "librocksdbjni-linux64.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
// UNIX
// UNIX
setEnvironmentClassFields ( "Unix" , "x64" ) ;
setEnvironmentClassFields ( "Unix" , "x64" ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux64.so" ) ;
isEqualTo ( "librocksdbjni-linux64.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
// AIX
// AIX
setEnvironmentClassFields ( "aix" , "x64" ) ;
setEnvironmentClassFields ( "aix" , "x64" ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . isWindows ( ) ) . isFalse ( ) ;
assertThat ( Environment . getJniLibraryExtension ( ) ) .
assertThat ( Environment . getJniLibraryExtension ( ) ) .
isEqualTo ( ".so" ) ;
isEqualTo ( ".so" ) ;
assertThat ( Environment . getJniLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getJniLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni-linux64.so" ) ;
isEqualTo ( "librocksdbjni-linux64.so" ) ;
assertThat ( Environment . getSharedLibraryName ( "rocksdb" ) ) .
assertThat ( Environment . getSharedLibraryFile Name ( "rocksdb" ) ) .
isEqualTo ( "librocksdbjni.so" ) ;
isEqualTo ( "librocksdbjni.so" ) ;
}
}
@ -111,13 +111,13 @@ public class EnvironmentTest {
@Test ( expected = UnsupportedOperationException . class )
@Test ( expected = UnsupportedOperationException . class )
public void failWinJniLibraryName ( ) {
public void failWinJniLibraryName ( ) {
setEnvironmentClassFields ( "win" , "x64" ) ;
setEnvironmentClassFields ( "win" , "x64" ) ;
Environment . getJniLibraryName ( "rocksdb" ) ;
Environment . getJniLibraryFile Name ( "rocksdb" ) ;
}
}
@Test ( expected = UnsupportedOperationException . class )
@Test ( expected = UnsupportedOperationException . class )
public void failWinSharedLibrary ( ) {
public void failWinSharedLibrary ( ) {
setEnvironmentClassFields ( "win" , "x64" ) ;
setEnvironmentClassFields ( "win" , "x64" ) ;
Environment . getSharedLibraryName ( "rocksdb" ) ;
Environment . getSharedLibraryFile Name ( "rocksdb" ) ;
}
}
private void setEnvironmentClassFields ( String osName ,
private void setEnvironmentClassFields ( String osName ,