Skip to content

Commit

Permalink
Revert "Issue mozilla-mobile#10335: Use Java 11."
Browse files Browse the repository at this point in the history
This reverts commit 224d220.
  • Loading branch information
csadilek authored and Grisha Kruglov committed Sep 11, 2021
1 parent 1fb6be9 commit db914c5
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ tasks:
# Note: This task is built server side without the context or tooling that
# exist in tree so we must hard code the hash
image:
mozillareleases/taskgraph:decision-mobile-7bc4ebab06c2d922a59bd01d414e6880db406312fd8a5da852eff706a7494e01@sha256:3913399822ef678f5d4acdbd3f27954f661ecd5a2563da206066923fe1f62333
mozillareleases/taskgraph:decision-mobile-682fbaa1ef17e70ddfe3457da3eaf8e776c4a20fe5bfbdbeba0641fd5bceae2a@sha256:bbb2613aaab79d17e590fbd78c072d0643be40fd1237195703f84280ecc3b302

maxRunTime: 1800

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import okhttp3.mockwebserver.RecordedRequest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
Expand Down Expand Up @@ -71,7 +70,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithDuplicatedCacheControlRequestHeaders() {
val headerMap = mapOf("Cache-Control" to "no-cache, no-store")
mockRequest(headerMap)
Expand All @@ -81,7 +79,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithDuplicatedCacheControlResponseHeaders() {
val responseHeaderMap = mapOf(
"Cache-Control" to "no-cache, no-store",
Expand All @@ -93,7 +90,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200OverridingDefaultHeaders() {
val headerMap = mapOf(
"Accept" to "text/html",
Expand All @@ -107,7 +103,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithGzippedBody() {
val responseHeaderMap = mapOf("Content-Encoding" to "gzip")
mockRequest()
Expand All @@ -117,7 +112,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithHeaders() {
val requestHeaders = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
Expand All @@ -133,7 +127,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithReadTimeout() {
mockRequest()
mockResponse(200)
Expand All @@ -147,7 +140,6 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get200WithStringBody() {
mockRequest()
mockResponse(200, body = "Hello World")
Expand Down Expand Up @@ -182,23 +174,20 @@ class GeckoViewFetchUnitTestCases : FetchTestCases() {
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun get404WithBody() {
mockRequest()
mockResponse(404, body = "Error")
super.get404WithBody()
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun post200WithBody() {
mockRequest(method = "POST", body = "Hello World")
mockResponse(200)
super.post200WithBody()
}

@Test
@Ignore("With Java 11 Mockito can't mock MockWebServer classes")
override fun put201FileUpload() {
mockRequest(method = "PUT", headerMap = mapOf("Content-Type" to "image/png"), body = "I am an image file!")
mockResponse(201, headerMap = mapOf("Location" to "/your-image.png"), body = "Thank you!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ object ReflectionUtils {
modifiersField.isAccessible = true
modifiersField.setInt(originField, originField.modifiers and Modifier.FINAL.inv())

originField.isAccessible = true
originField.set(instance, value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import org.jetbrains.uast.UCallExpression
import org.jetbrains.uast.UClass
import org.jetbrains.uast.UIdentifier
import org.jetbrains.uast.getContainingUClass
import org.junit.Ignore
import org.junit.Test
import org.mockito.Mockito.`when`
import org.mockito.Mockito.mock
Expand All @@ -23,7 +22,6 @@ import org.mockito.Mockito.verify
class LintLogChecksTest {

@Test
@Ignore("With Java 11 Mockito fails to mock some of the Android classes here")
fun `report log error in components code only`() {
val evaluator = mock(JavaEvaluator::class.java)
val context = mock(JavaContext::class.java)
Expand Down
1 change: 0 additions & 1 deletion taskcluster/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ RUN apt-get update -qq \
# which we cannot navigate while building the Docker image.
&& apt-get install -y tzdata \
&& apt-get install -y openjdk-8-jdk \
openjdk-11-jdk \
expect \
git \
curl \
Expand Down
5 changes: 1 addition & 4 deletions taskcluster/scripts/decision-install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ ANDROID_SDK_VERSION='3859397'
ANDROID_SDK_SHA256='444e22ce8ca0f67353bda4b85175ed3731cae3ffa695ca18119cbacef1c1bea0'
SDK_ZIP_LOCATION="$HOME/sdk-tools-linux.zip"

# For the Android build system we want Java 11. However this version of sdkmanager requires Java 8.
JAVA8PATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/:$PATH"

$CURL --output "$SDK_ZIP_LOCATION" "https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip"
echo "$ANDROID_SDK_SHA256 $SDK_ZIP_LOCATION" | sha256sum --check
unzip -d "$ANDROID_SDK_ROOT" "$SDK_ZIP_LOCATION"
rm "$SDK_ZIP_LOCATION"
yes | PATH=$JAVA8PATH "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --licenses
yes | "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --licenses
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ set -v
mkdir -p ${NEXUS_WORK}/conf
cp /builds/worker/checkouts/src/taskcluster/scripts/toolchain/android-gradle-dependencies/nexus.xml ${NEXUS_WORK}/conf/nexus.xml

# For the Android build system we want Java 11. However this Nexus installation requires Java 8.
PATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/:$PATH" RUN_AS_USER=worker /opt/sonatype/nexus/bin/nexus restart
RUN_AS_USER=worker /opt/sonatype/nexus/bin/nexus restart

# Wait "a while" for Nexus to actually start. Don't fail if this fails.
curl --retry-connrefused --retry-delay 2 --retry 100 \
Expand Down
7 changes: 2 additions & 5 deletions taskcluster/scripts/toolchain/repack-android-sdk-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

export ANDROID_SDK_ROOT=$MOZ_FETCHES_DIR

# For the Android build system we want Java 11. However this version of sdkmanager requires Java 8.
JAVA8PATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/:$PATH"

yes | PATH=$JAVA8PATH "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --licenses
yes | "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --licenses

# It's nice to have the build logs include the state of the world upon completion.
PATH=$JAVA8PATH "${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --list
"${ANDROID_SDK_ROOT}/tools/bin/sdkmanager" --list

tar cf - -C "$ANDROID_SDK_ROOT" . --transform 's,^\./,android-sdk-linux/,' | xz > "$UPLOAD_DIR/android-sdk-linux.tar.xz"

0 comments on commit db914c5

Please sign in to comment.