This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-398
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-398 by this push:
new 7f24021 WIP.
7f24021 is described below
commit 7f24021ae1249c8c6ea1f7e8ced6171ee21a76bf
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Aug 9 18:27:30 2021 +0300
WIP.
---
.../mgrs/deploy/NCModelNestedSamplesSpec.scala | 48 ++++++++++++++++++++++
...nagerSpec.scala => NCModelReferencesSpec.scala} | 2 +-
.../mgrs/deploy/jv/NCModelDeploySpecAdapter.java | 2 +-
.../mgrs/deploy/sc/NCModelDeploySpecAdapter.scala | 2 +-
4 files changed, 51 insertions(+), 3 deletions(-)
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelNestedSamplesSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelNestedSamplesSpec.scala
new file mode 100644
index 0000000..6ceab8f
--- /dev/null
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelNestedSamplesSpec.scala
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nlpcraft.probe.mgrs.deploy
+
+import org.apache.nlpcraft.model.tools.embedded.NCEmbeddedProbe
+import org.apache.nlpcraft.model.{NCIntent, NCIntentSample, NCModelAdapter,
NCResult}
+import org.apache.nlpcraft.probe.mgrs.model.NCModelManager
+import org.junit.jupiter.api.Test
+
+class NCModelNested extends NCModelAdapter("nlpcraft.samples.test.mdl", "Test
Model", "1.0") {
+ @NCIntentSample(Array("a"))
+ @NCIntent("intent=ss term={tok_id() == 'a'}*")
+ def m(): NCResult = NCResult.text("OK")
+}
+
+class NCModelWrapper extends NCModelNested
+
+class NCModelNestedSamplesSpec {
+ @Test
+ def test(): Unit = {
+ try {
+ NCEmbeddedProbe.start("nlpcraft.conf",
java.util.Collections.singleton(classOf[NCModelWrapper].getName))
+
+ val mdls = NCModelManager.getAllModels()
+
+ require(mdls.size == 1)
+
+ require(mdls.head.samples.nonEmpty)
+ }
+ finally
+ NCEmbeddedProbe.stop()
+ }
+}
\ No newline at end of file
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManagerSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelReferencesSpec.scala
similarity index 98%
rename from
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManagerSpec.scala
rename to
nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelReferencesSpec.scala
index 1268f6e..8f57ad2 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManagerSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCModelReferencesSpec.scala
@@ -72,7 +72,7 @@ class NCModelMix extends
NCModelAdapter("nlpcraft.deploy.test.mdl", "Test Model"
}
@NCModelAddPackage(Array("org.apache.nlpcraft.probe.mgrs.deploy"))
-class NCModelPackagesWrapperMix extends
NCModelAdapter("nlpcraft.deploy.test.mdl", "Test Model", "1.0") {
+class NCModelPackagesWrapperMix extends
NCModelAdapter("nlpcraft.deploy.test.mix.mdl", "Test Model", "1.0") {
override def getElements: util.Set[NCElement] =
Set(
NCTestElement("scalaClass"),
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/jv/NCModelDeploySpecAdapter.java
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/jv/NCModelDeploySpecAdapter.java
index 3c557be..0a88991 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/jv/NCModelDeploySpecAdapter.java
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/jv/NCModelDeploySpecAdapter.java
@@ -24,7 +24,7 @@ import java.util.Set;
class NCModelDeploySpecAdapter extends NCModelAdapter {
public NCModelDeploySpecAdapter() {
- super("nlpcraft.deploy.test.mdl", "Test Model", "1.0");
+ super("nlpcraft.deploy.test.java", "Test Model", "1.0");
}
@Override
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/sc/NCModelDeploySpecAdapter.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/sc/NCModelDeploySpecAdapter.scala
index 18a83f0..b0fa796 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/sc/NCModelDeploySpecAdapter.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/deploy/sc/NCModelDeploySpecAdapter.scala
@@ -23,6 +23,6 @@ import org.apache.nlpcraft.model.{NCElement, NCModelAdapter}
import java.util
import scala.language.implicitConversions
-class NCModelDeploySpecAdapter extends
NCModelAdapter("nlpcraft.deploy.test.mdl", "Test Model", "1.0") {
+class NCModelDeploySpecAdapter extends
NCModelAdapter("nlpcraft.deploy.test.scala", "Test Model", "1.0") {
override def getElements: util.Set[NCElement] =
Set(NCTestElement("scalaClass"), NCTestElement("scalaStatic"))
}