Skip to content

Commit 3e1746d

Browse files
committed
Move HelloWorld example to a unit test of tensorflow-core-api
1 parent ab324e9 commit 3e1746d

File tree

2 files changed

+13
-38
lines changed

2 files changed

+13
-38
lines changed

tensorflow-core/tensorflow-core-examples/src/main/java/org/tensorflow/examples/HelloWorld.java renamed to tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/c_api/HelloWorldTest.java

+13-7
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
package org.tensorflow.examples;
16+
package org.tensorflow.c_api;
1717

18-
import org.bytedeco.javacpp.*;
19-
import org.tensorflow.c_api.*;
20-
import static org.tensorflow.c_api.global.tensorflow.*;
18+
import static org.junit.Assert.assertTrue;
19+
import static org.tensorflow.c_api.global.tensorflow.TF_Version;
2120

22-
public class HelloWorld {
23-
public static void main(String[] args) throws Exception {
24-
System.out.println("Running with TensorFlow " + TF_Version().getString());
21+
import org.junit.Test;
22+
import org.junit.runner.RunWith;
23+
import org.junit.runners.JUnit4;
24+
25+
@RunWith(JUnit4.class)
26+
public class HelloWorldTest {
27+
28+
@Test
29+
public void getVersion() {
30+
assertTrue(TF_Version().getString().length() > 0);
2531
}
2632
}

tensorflow-core/tensorflow-core-examples/pom.xml

-31
This file was deleted.

0 commit comments

Comments
 (0)