From 53f7e8de741a8540141687922fa6aa5a178ef86d Mon Sep 17 00:00:00 2001 From: Pavel Date: Sat, 5 Oct 2024 11:53:14 -0400 Subject: [PATCH] Version bump and adjustments --- pom.xml | 38 ++++++++++--------- .../tests/TestDependencyAndObjectLoading.java | 33 ---------------- .../nasdanika/launcher/tests/TestGroovy.java | 23 +++++++++++ 3 files changed, 44 insertions(+), 50 deletions(-) delete mode 100644 src/test/java/org/nasdanika/launcher/tests/TestDependencyAndObjectLoading.java diff --git a/pom.xml b/pom.xml index b933560..0058c99 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.nasdanika - 2024.9.0-SNAPSHOT + 2024.10.0 cli-launcher jar Nasdanika CLI launcher @@ -27,48 +27,52 @@ org.nasdanika.html app-model-gen-cli - 2024.9.0-SNAPSHOT + 2024.10.0 org.nasdanika.models.java cli - 2024.8.0 + 2024.10.0 org.nasdanika.models.rules cli - 2024.8.0 + 2024.10.0 org.nasdanika.models.architecture model - 2024.8.0 + 2024.10.0 org.nasdanika.core http - 2024.9.0-SNAPSHOT + 2024.10.0 + + + org.nasdanika.core + groovy + 2024.10.0 org.nasdanika.core maven - 2024.9.0-SNAPSHOT + 2024.10.0 org.nasdanika.models.echarts graph - 2024.8.0 + 2024.10.0 org.nasdanika.models.ecore cli - 2024.8.0 + 2024.10.0 - org.apache.groovy groovy-all - 4.0.22 + 4.0.23 pom @@ -83,13 +87,13 @@ org.junit.jupiter junit-jupiter-api - 5.10.2 + 5.11.0 test org.junit.jupiter junit-jupiter-engine - 5.10.2 + 5.11.0 test @@ -108,7 +112,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.7.1 + 3.8.0 copy-dependencies @@ -129,7 +133,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.3.0 + 3.5.0 @@ -187,7 +191,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.7.0 + 3.10.0 attach-javadocs @@ -242,7 +246,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.6 sign-artifacts diff --git a/src/test/java/org/nasdanika/launcher/tests/TestDependencyAndObjectLoading.java b/src/test/java/org/nasdanika/launcher/tests/TestDependencyAndObjectLoading.java deleted file mode 100644 index bbeb1e2..0000000 --- a/src/test/java/org/nasdanika/launcher/tests/TestDependencyAndObjectLoading.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.nasdanika.launcher.tests; - -import java.io.File; -import java.util.Collection; - -import org.junit.jupiter.api.Test; -import org.nasdanika.capability.CapabilityLoader; -import org.nasdanika.capability.CapabilityProvider; -import org.nasdanika.capability.maven.DependencyRequestRecord; -import org.nasdanika.common.PrintStreamProgressMonitor; -import org.nasdanika.common.ProgressMonitor; - -public class TestDependencyAndObjectLoading { - - @Test - public void testDependencyLoading() { - CapabilityLoader capabilityLoader = new CapabilityLoader(); - DependencyRequestRecord requirement = new DependencyRequestRecord( - new String[] { "org.apache.groovy:groovy-all:pom:4.0.22" }, - null, - null, - "target/test-repo"); - - ProgressMonitor progressMonitor = new PrintStreamProgressMonitor(); - Iterable> cpi = capabilityLoader.load(requirement, progressMonitor); - for (CapabilityProvider cp: cpi) { - @SuppressWarnings("unchecked") - Collection result = (Collection) cp.getPublisher().blockFirst(); - System.out.println(result); - } - } - -} diff --git a/src/test/java/org/nasdanika/launcher/tests/TestGroovy.java b/src/test/java/org/nasdanika/launcher/tests/TestGroovy.java index df909cc..4a36c79 100644 --- a/src/test/java/org/nasdanika/launcher/tests/TestGroovy.java +++ b/src/test/java/org/nasdanika/launcher/tests/TestGroovy.java @@ -8,6 +8,7 @@ import javax.script.ScriptException; import org.junit.jupiter.api.Test; +import org.nasdanika.common.Invocable; public class TestGroovy { @@ -40,5 +41,27 @@ def annotatedMethod() { } } } + + @Test + public void testAnomymous() throws ScriptException { + String source = """ + new org.nasdanika.common.Invocable() { + + def invoke(Object... args) { + System.out.println(args); + args[0] + 55; + } + + } + + """; + + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine scriptEngine = sem.getEngineByName("groovy"); + Object result = scriptEngine.eval(source); + Object resultResult = ((Invocable) result).invoke(33); + System.out.println(resultResult); + } + }