-
Notifications
You must be signed in to change notification settings - Fork 251
Expand file tree
/
Copy pathtest-jar-integration.sh
More file actions
executable file
·61 lines (49 loc) · 1.5 KB
/
test-jar-integration.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -e
echo "=========================================="
echo "Snappy-Java Integration Test"
echo "=========================================="
# Detect Java version
JAVA_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed 's/^1\.//' | cut -d'.' -f1)
echo "Java version: $JAVA_VERSION"
# Build the JAR
echo ""
echo "Building JAR..."
./sbt package
# Find the JAR
JAR_FILE=$(ls -t target/snappy-java-*.jar | grep -v sources | grep -v javadoc | head -1)
if [ -z "$JAR_FILE" ]; then
echo "ERROR: Could not find snappy-java JAR"
exit 1
fi
echo "Using JAR: $JAR_FILE"
# Create temp directory
TEMP_DIR=$(mktemp -d)
echo ""
echo "Using temp directory: $TEMP_DIR"
# Copy test source
cp src/test/resources/integration/SnappyIntegrationTest.java "$TEMP_DIR/"
# Compile test
echo ""
echo "Compiling test program..."
javac -cp "$JAR_FILE" -d "$TEMP_DIR" "$TEMP_DIR/SnappyIntegrationTest.java"
# Run test WITHOUT --enable-native-access flag
echo ""
echo "=========================================="
echo "Running test (WITHOUT --enable-native-access flag)..."
echo "=========================================="
cd "$TEMP_DIR"
java -cp ".:$OLDPWD/$JAR_FILE" SnappyIntegrationTest 2>&1
EXIT_CODE=$?
cd - > /dev/null
echo ""
echo "=========================================="
if [ $EXIT_CODE -eq 0 ]; then
echo "✓ Test PASSED (exit code: $EXIT_CODE)"
else
echo "✗ Test FAILED (exit code: $EXIT_CODE)"
fi
echo "=========================================="
# Cleanup
rm -rf "$TEMP_DIR"
exit $EXIT_CODE