FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
protobuf/java/internal/JavaVersionTest.java at main · MapTex/protobuf · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
MapTex
/
protobuf
Public
forked from
protocolbuffers/protobuf
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
protobuf
/
java
/
internal
/
JavaVersionTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (28 loc) · 1.04 KB
Breadcrumbs
protobuf
/
java
/
internal
/
JavaVersionTest.java
Copy path
File metadata and controls
31 lines (28 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// Test that Kokoro is using the expected version of Java.
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertWithMessage
;
import
org
.
junit
.
Test
;
import
org
.
junit
.
runner
.
RunWith
;
import
org
.
junit
.
runners
.
JUnit4
;
@
RunWith
(
JUnit4
.
class
)
public
class
JavaVersionTest
{
@
Test
public
void
testJavaVersion
()
throws
Exception
{
String
exp
=
System
.
getenv
(
"KOKORO_JAVA_VERSION"
);
if
(
exp
==
null
||
exp
.
isEmpty
()) {
System
.
err
.
println
(
"No kokoro java version found, skipping check"
);
return
;
}
// Java 8's version is read as "1.8"
if
(
exp
.
equals
(
"8"
))
exp
=
"1.8"
;
String
version
=
System
.
getProperty
(
"java.version"
);
assertWithMessage
(
"Expected Java "
+
exp
+
" but found Java "
+
version
)
.
that
(
version
.
startsWith
(
exp
))
.
isTrue
();
}
}
Back
|
FazBrowse Home
|
New Git URL