You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2020/06/25 11:40:04 UTC
[incubator-nlpcraft] branch NLPCRAFT-85 updated: Weather example
fixed for work with 'geo' profile.
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-85
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-85 by this push:
new 2c3ec6d Weather example fixed for work with 'geo' profile.
new 6ca5c8f Merge remote-tracking branch 'origin/NLPCRAFT-85' into NLPCRAFT-85
2c3ec6d is described below
commit 2c3ec6d9b8339db4376a5182e728db8a313568a3
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Thu Jun 25 14:39:47 2020 +0300
Weather example fixed for work with 'geo' profile.
---
.../org/apache/nlpcraft/examples/weather/WeatherTest.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherTest.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherTest.java
index 1e8a30a..8e60059 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherTest.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherTest.java
@@ -19,13 +19,14 @@ package org.apache.nlpcraft.examples.weather;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
-import jdk.nashorn.internal.ir.annotations.Ignore;
import org.apache.nlpcraft.common.NCException;
import org.apache.nlpcraft.model.tools.test.NCTestClient;
import org.apache.nlpcraft.model.tools.test.NCTestClientBuilder;
import org.apache.nlpcraft.model.tools.test.NCTestResult;
import org.apache.nlpcraft.probe.embedded.NCEmbeddedProbe;
import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -34,7 +35,9 @@ import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Weather model test. Note that this example demonstrates the testing of the proper
@@ -89,7 +92,6 @@ class WeatherTest {
// TODO: Uncomment and run with profile ``. Disabled by default for profile apache.
@Test
- @Ignore
void test() throws NCException, IOException {
// Empty parameter.
assertTrue(cli.ask("").isFailed());
@@ -109,4 +111,10 @@ class WeatherTest {
// Cannot be answered without conversation.
assertTrue(cli.ask("Moscow").isFailed());
}
+
+ @BeforeAll
+ public static void checkOs() {
+ // Works with 'geo' profile.
+ Assumptions.assumeTrue(WeatherTest.class.getClassLoader().getResourceAsStream("geo/synonyms") != null);
+ }
}