Skip to content

Commit 98886fe

Browse files
committed
Add test, make package private
Signed-off-by: Ryan Nett <[email protected]>
1 parent e56be82 commit 98886fe

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/MRTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818
package org.tensorflow;
1919

20-
public class MRTest {
21-
public static int version() {
20+
class MRTest {
21+
static int version() {
2222
return 8;
2323
}
2424
}

tensorflow-core/tensorflow-core-api/src/main/java9/org/tensorflow/MRTest.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
*/
1818
package org.tensorflow;
1919

20-
import java.lang.ref.Cleaner;
21-
22-
public class MRTest {
23-
public static int version(){
24-
Cleaner.create();
20+
class MRTest {
21+
static int version(){
2522
return 9;
2623
}
2724
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
Copyright 2021 The TensorFlow Authors. All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
=======================================================================
16+
17+
*/
18+
package org.tensorflow;
19+
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
21+
22+
import org.junit.jupiter.api.Test;
23+
24+
public class MultiReleaseTest {
25+
26+
@Test
27+
public void testMultirelease(){
28+
String javaVersion = System.getProperty("java.version");
29+
System.out.println("Testing on Java version " + javaVersion);
30+
int value = MRTest.version();
31+
if(javaVersion.compareTo("9") >= 0){
32+
assertEquals(9, value);
33+
} else {
34+
assertEquals(8, value);
35+
}
36+
}
37+
38+
}

0 commit comments

Comments
 (0)