--- /dev/null
+# Default ignored files
+/shelf/
+/workspace.xml
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectRootManager">
+ <output url="file://$PROJECT_DIR$/out" />
+ </component>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings" defaultProject="true" />
+</project>
\ No newline at end of file
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;
// Map constructors
for(Constructor<?> constructor : class_metadata.getDeclaredConstructors()){
- Class<?>[] parameter_types = constructor.getParameterTypes();
- MethodType method_type = MethodType.methodType(class_metadata, parameter_types);
- MethodHandle constructor_handle;
-
- if((constructor.getModifiers() & Modifier.PRIVATE) != 0){
- constructor_handle = private_lookup.findConstructor(class_metadata, method_type);
- } else{
- constructor_handle = lookup.findConstructor(class_metadata, method_type);
+ try{
+ Class<?>[] parameter_types = constructor.getParameterTypes();
+ MethodType method_type = MethodType.methodType(class_metadata, parameter_types);
+ MethodHandle constructor_handle = private_lookup.findConstructor(class_metadata, method_type);
+
+ FunctionSignature signature = new FunctionSignature("<init>", parameter_types);
+ map.put(signature, constructor_handle);
+ }catch (NoSuchMethodException e){
+ System.err.println("Skipping constructor: " + constructor);
+ }catch(Throwable t){
+ t.printStackTrace();
}
-
- FunctionSignature signature = new FunctionSignature("<init>", parameter_types);
- map.put(signature, constructor_handle);
}
-
+
// Map methods
for(Method method : class_metadata.getDeclaredMethods()){
Class<?>[] parameter_types = method.getParameterTypes();
FunctionSignature signature = new FunctionSignature(method);
map.put(signature ,method_handle);
}
- } catch(Throwable t){
- System.out.println("FunctionSignature_To_Handle_Map::add_class exception:");
- t.printStackTrace();
- }
- }
-
-
- /*
-
- private void add_class(Class<?> class_metadata){
- try{
- MethodHandles.Lookup lookup = MethodHandles.lookup();
- MethodHandles.Lookup private_lookup = MethodHandles.privateLookupIn(class_metadata ,lookup);
- for( Method method : class_metadata.getDeclaredMethods() ){
- Class<?>[] parameter_types = method.getParameterTypes();
- MethodType method_type = MethodType.methodType(
- method.getReturnType() ,parameter_types
- );
- MethodHandle method_handle;
-
- if((method.getModifiers() & java.lang.reflect.Modifier.PRIVATE) != 0 ){
- method_handle = private_lookup.findSpecial(class_metadata ,method.getName() ,method_type ,class_metadata);
- }else{
- method_handle = lookup.findVirtual(class_metadata ,method.getName() ,method_type);
- }
-
- FunctionSignature signature = new FunctionSignature(method);
- map.put(signature ,method_handle);
- }
}catch(Throwable t){
System.out.println("FunctionSignature_To_Handle_Map::add_class exception:");
t.printStackTrace();
}
}
- */
-
public MethodHandle get_handle(FunctionSignature signature){
return map.get(signature);
+++ /dev/null
-package com.ReasoningTechnology.Mosaic;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import com.ReasoningTechnology.Mosaic.Mosaic_IsPrimitive;
-
-public class Mosaic_FunctionSignature {
- private final String method_name;
- private final Class<?>[] parameter_types;
-
- public FunctionSignature(String method_name ,Class<?>[] parameter_types){
- this.method_name = method_name;
- this.parameter_types = parameter_types;
- }
-
- public FunctionSignature(String method_name ,Object[] args){
- this.method_name = method_name;
- this.parameter_types = resolve_parameter_types(args);
- }
-
- public FunctionSignature(Method method){
- this.method_name = method.getName();
- this.parameter_types = method.getParameterTypes();
- }
-
- private static Class<?>[] resolve_parameter_types(Object[] arg_list){
- Class<?>[] parameter_types = new Class<?>[arg_list.length];
- for( int i = 0; i < arg_list.length; i++ ){
- if( arg_list[i] instanceof Mosaic_IsPrimitive ){
- parameter_types[i] = ((Mosaic_IsPrimitive) arg_list[i]).get_type();
- }else if( arg_list[i] != null ){
- parameter_types[i] = arg_list[i].getClass();
- }else{
- parameter_types[i] = null;
- }
- }
- return parameter_types;
- }
-
- public String get_method_name(){
- return method_name;
- }
-
- public Class<?>[] get_parameter_types(){
- return parameter_types;
- }
-
- @Override
- public boolean equals(Object o){
- if( this == o ) return true;
- if( o == null || getClass() != o.getClass() ) return false;
- FunctionSignature signature = (FunctionSignature) o;
- return method_name.equals(signature.method_name) &&
- java.util.Arrays.equals(parameter_types ,signature.parameter_types);
- }
-
- @Override
- public int hashCode(){
- int result = method_name.hashCode();
- result = 31 * result + java.util.Arrays.hashCode(parameter_types);
- return result;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(method_name).append("(");
- for (int i = 0; i < parameter_types.length; i++) {
- sb.append(parameter_types[i].getSimpleName());
- if (i < parameter_types.length - 1) sb.append(", ");
- }
- sb.append(")");
- return sb.toString();
- }
-
-}
-
--- /dev/null
+package com.ReasoningTechnology.Mosaic;
+
+/*
+ These are used for testing that Mosaic can be used for white box
+ testing. Mosaic tests for Mosaic itself access each of these as
+ part of regression. Users are welcome to also check accessing these
+ when debugging any access problems that might arise.
+*/
+
+// Public class with public and private methods
+public class Mosaic_TestClasses {
+ public boolean publicMethod() {
+ return true;
+ }
+
+ private boolean privateMethod() {
+ return true;
+ }
+
+ public class PublicClass {
+ public boolean publicMethod() {
+ return true;
+ }
+
+ private boolean privateMethod() {
+ return true;
+ }
+ }
+
+ private class PrivateClass {
+ public boolean publicMethod() {
+ return true;
+ }
+
+ private boolean privateMethod() {
+ return true;
+ }
+ }
+}
+
+// Default (package-private) class with public and private methods
+class DefaultClass {
+ public boolean publicMethod() {
+ return true;
+ }
+
+ private boolean privateMethod() {
+ return true;
+ }
+}
project will have to expanded into the same module as that being
tested, rather than having its jar file accessed through the class
path.
+
+
+2024-12-16T10:47:06Z
+
+ FunctionSignature used with AllMethodsPublic currently does not
+ include the return type. It needs to have that.
+
--- /dev/null
+#!/usr/bin/env bash
+
+# Centralized environment executor. Typically used by IDEs to run developer/tool
+# or tester/tool commands in the correct environment. Shell users are encouraged
+# to source the appropriate environment file into their shell instead of
+# running commands through this executor.
+
+if [ "$#" -lt 2 ]; then
+ echo "Usage: $0 <environment> <command> [args...]"
+ echo "Example: $0 developer make"
+ exit 1
+fi
+
+# extract the environment and the command
+environment=$1
+shift
+command=$1
+shift
+command_args="$@"
+
+# Determine the path to the environment script based on the environment
+case "$environment" in
+ developer)
+ env_script="env_developer"
+ ;;
+ tester)
+ env_script="env_tester"
+ ;;
+ *)
+ echo "Error: Unknown environment '$environment'. Supported environments are: developer, tester."
+ exit 1
+ ;;
+esac
+
+# check if the environment script exists and is readable
+if [ ! -f "$env_script" ] || [ ! -r "$env_script" ]; then
+ echo "Error: Environment script '$env_script' not found or not readable."
+ exit 1
+fi
+
+source "$env_script"
+exec "$command" "$command_args"
--- /dev/null
+import com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy;
+import com.ReasoningTechnology.Mosaic.Mosaic_IO;
+import com.ReasoningTechnology.Mosaic.Mosaic_Testbench;
+import com.ReasoningTechnology.Mosaic.Mosaic_TestClasses;
+
+public class Test_Access_0{
+
+ public static class TestSuite{
+
+ private static Mosaic_AllMethodsPublicProxy publicProxy;
+ // private static Mosaic_AllMethodsPublicProxy nestedPublicProxy;
+ // private static Mosaic_AllMethodsPublicProxy nestedPrivateProxy;
+ // private static Mosaic_AllMethodsPublicProxy topPrivateProxy;
+
+ static{
+ // Initialize proxies using class metadata and path strings
+ publicProxy = new Mosaic_AllMethodsPublicProxy(Mosaic_TestClasses.class);
+ // nestedPublicProxy = new Mosaic_AllMethodsPublicProxy("com.ReasoningTechnology.Mosaic.Mosaic_TestClasses$PublicClass");
+ // nestedPrivateProxy = new Mosaic_AllMethodsPublicProxy("com.ReasoningTechnology.Mosaic.Mosaic_TestClasses$PrivateClass");
+ // topPrivateProxy = new Mosaic_AllMethodsPublicProxy("com.ReasoningTechnology.Mosaic.PrivateClass");
+ }
+
+ public Boolean test_publicClass_publicMethod(Mosaic_IO io){
+ Object instance = publicProxy.construct("<init>");
+ return true;
+ // return(Boolean) publicProxy.invoke(instance, "publicMethod");
+ }
+
+ /*
+
+ public Boolean test_publicClass_privateMethod(Mosaic_IO io){
+ Object instance = publicProxy.construct("<init>");
+ return(Boolean) publicProxy.invoke(instance, "privateMethod");
+ }
+
+ public Boolean test_nestedPublicClass_publicMethod(Mosaic_IO io){
+ Object outerInstance = publicProxy.construct("<init>");
+ Object instance = nestedPublicProxy.construct("<init>", outerInstance);
+ return(Boolean) nestedPublicProxy.invoke(instance, "publicMethod");
+ }
+
+ public Boolean test_nestedPublicClass_privateMethod(Mosaic_IO io){
+ Object outerInstance = publicProxy.construct("<init>");
+ Object instance = nestedPublicProxy.construct("<init>", outerInstance);
+ return(Boolean) nestedPublicProxy.invoke(instance, "privateMethod");
+ }
+
+ public Boolean test_nestedPrivateClass_publicMethod(Mosaic_IO io){
+ Object outerInstance = publicProxy.construct("<init>");
+ Object instance = nestedPrivateProxy.construct("<init>", outerInstance);
+ return(Boolean) nestedPrivateProxy.invoke(instance, "publicMethod");
+ }
+
+ public Boolean test_nestedPrivateClass_privateMethod(Mosaic_IO io){
+ Object outerInstance = publicProxy.construct("<init>");
+ Object instance = nestedPrivateProxy.construct("<init>", outerInstance);
+ return(Boolean) nestedPrivateProxy.invoke(instance, "privateMethod");
+ }
+ */
+ }
+
+ public static void main(String[] args){
+ TestSuite suite = new TestSuite();
+ int result = Mosaic_Testbench.run(suite);
+ System.exit(result);
+ }
+}
--- /dev/null
+import com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy;
+import com.ReasoningTechnology.Mosaic.Mosaic_IO;
+import com.ReasoningTechnology.Mosaic.Mosaic_Testbench;
+import com.ReasoningTechnology.Mosaic.Mosaic_TestClasses;
+
+public class Test_AllMethodsPublicProxy_0 {
+
+ public static class TestSuite {
+
+ private static Mosaic_AllMethodsPublicProxy publicProxy;
+ private static Mosaic_AllMethodsPublicProxy defaultProxy;
+ private static Mosaic_AllMethodsPublicProxy privateProxy;
+
+ static {
+ try {
+ // Initialize proxies for public, default, and private classes
+ publicProxy = new Mosaic_AllMethodsPublicProxy(PublicClass.class);
+ defaultProxy = new Mosaic_AllMethodsPublicProxy(DefaultClass.class);
+ privateProxy = new Mosaic_AllMethodsPublicProxy(PrivateClass.class);
+ } catch (Exception e) {
+ System.err.println("Failed to initialize proxies: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ public Boolean test_publicClass_publicMethod(Mosaic_IO io) {
+ try {
+ Object instance = publicProxy.construct("<init>");
+ return (Boolean) publicProxy.invoke(instance, "publicMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public Boolean test_publicClass_privateMethod(Mosaic_IO io) {
+ try {
+ Object instance = publicProxy.construct("<init>");
+ return (Boolean) publicProxy.invoke(instance, "privateMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public Boolean test_defaultClass_publicMethod(Mosaic_IO io) {
+ try {
+ Object instance = defaultProxy.construct("<init>");
+ return (Boolean) defaultProxy.invoke(instance, "publicMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public Boolean test_defaultClass_privateMethod(Mosaic_IO io) {
+ try {
+ Object instance = defaultProxy.construct("<init>");
+ return (Boolean) defaultProxy.invoke(instance, "privateMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public Boolean test_privateClass_publicMethod(Mosaic_IO io) {
+ try {
+ Object instance = privateProxy.construct("<init>");
+ return (Boolean) privateProxy.invoke(instance, "publicMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public Boolean test_privateClass_privateMethod(Mosaic_IO io) {
+ try {
+ Object instance = privateProxy.construct("<init>");
+ return (Boolean) privateProxy.invoke(instance, "privateMethod");
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ TestSuite suite = new TestSuite();
+ int result = Mosaic_Testbench.run(suite);
+ System.exit(result);
+ }
+}
+++ /dev/null
-import com.ReasoningTechnology.Mosaic.*;
-
-public class Test_FunctionSignature{
-
- public class TestSuite{
-
- public Boolean test_basic_signature(Mosaic_IO io){
- Boolean[] conditions = new Boolean[3];
- int i = 0;
-
- // Test resolve_parameter_types with primitives and non-primitives
- Mosaic_FunctionSignature sig1 = new Mosaic_FunctionSignature("test", new Object[]{42, "hello"});
- conditions[i++] = sig1.get_parameter_types()[0].equals(int.class);
- conditions[i++] = sig1.get_parameter_types()[1].equals(String.class);
-
- // Test method name retrieval
- conditions[i++] = sig1.get_method_name().equals("test");
-
- return Mosaic_Util.all(conditions);
- }
-
- public Boolean test_signature_equality(Mosaic_IO io){
- Boolean[] conditions = new Boolean[2];
- int i = 0;
-
- Mosaic_FunctionSignature sig1 = new Mosaic_FunctionSignature("test", new Object[]{42, "hello"});
- Mosaic_FunctionSignature sig2 = new Mosaic_FunctionSignature("test", new Object[]{42, "hello"});
-
- // Test equality and hash code
- conditions[i++] = sig1.equals(sig2);
- conditions[i++] = sig1.hashCode() == sig2.hashCode();
-
- return Mosaic_Util.all(conditions);
- }
-
- public Boolean test_null_arguments(Mosaic_IO io){
- Boolean[] conditions = new Boolean[2];
- int i = 0;
-
- Mosaic_FunctionSignature sig = new Mosaic_FunctionSignature("test", new Object[]{null});
-
- // Test parameter types for null argument
- conditions[i++] = sig.get_parameter_types()[0] == null;
-
- // Test method name retrieval
- conditions[i++] = sig.get_method_name().equals("test");
-
- return Mosaic_Util.all(conditions);
- }
-
- public Boolean test_to_string(Mosaic_IO io){
- Boolean[] conditions = new Boolean[1];
- int i = 0;
-
- Mosaic_FunctionSignature sig = new Mosaic_FunctionSignature("example", new Object[]{42, "text"});
- String expected = "example(int, String)";
-
- // Test string representation
- conditions[i++] = sig.toString().equals(expected);
-
- return Mosaic_Util.all(conditions);
- }
-
- public Boolean test_method_constructor(Mosaic_IO io){
- Boolean[] conditions = new Boolean[2];
- int i = 0;
-
- class TestClass{
- public void sampleMethod(int a, String b){}
- }
-
- try{
- Method method = TestClass.class.getDeclaredMethod("sampleMethod", int.class, String.class);
- Mosaic_FunctionSignature sig = new Mosaic_FunctionSignature(method);
-
- // Test method name
- conditions[i++] = sig.get_method_name().equals("sampleMethod");
-
- // Test parameter types
- conditions[i++] = sig.get_parameter_types()[0].equals(int.class) &&
- sig.get_parameter_types()[1].equals(String.class);
- } catch (NoSuchMethodException e){
- return false; // This shouldn't happen in a controlled test
- }
-
- return Mosaic_Util.all(conditions);
- }
- }
-
- public static void main(String[] args){
- TestSuite suite = new Test_FunctionSignature().new TestSuite();
- int result = Mosaic_Testbench.run(suite);
- System.exit(result);
- }
-}
--- /dev/null
+import com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy;
+import com.ReasoningTechnology.Mosaic.Mosaic_IO;
+import com.ReasoningTechnology.Mosaic.Mosaic_Testbench;
+
+public class Test_FunctionSignature_0 {
+
+ public static class TestSuite {
+
+ private static Mosaic_AllMethodsPublicProxy proxy;
+
+ static {
+ try {
+ proxy = new Mosaic_AllMethodsPublicProxy("com.ReasoningTechnology.Mosaic.FunctionSignature");
+ } catch (ClassNotFoundException e) {
+ System.err.println("Failed to initialize proxy: " + e.getMessage());
+ }
+ }
+
+ public Boolean smoke_test_0(Mosaic_IO io) {
+ try {
+ // Create a FunctionSignature instance via the proxy constructor
+ Object signature = proxy.construct("<init>", "testMethod", new Class<?>[]{});
+
+ // Call the toString method on the proxy instance
+ String result = (String) proxy.invoke(signature, "toString");
+
+ // Check expected output
+ return "testMethod()".equals(result);
+ } catch (Exception e) {
+ System.err.println("Test failed: " + e.getMessage());
+ e.printStackTrace();
+ return false;
+ }
+ }
+ }
+
+ public static void main(String[] args) {
+ TestSuite suite = new TestSuite();
+ int result = Mosaic_Testbench.run(suite);
+ System.exit(result);
+ }
+}
-2024-12-13T02:40:45.582Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-13T02:40:45.580717856Z -----------------------------------------------------------
-Test: smoke_test_logging
-Message:
-This is a smoke test for logging.
-
-2024-12-13T02:40:45.962Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-13T02:40:45.961627900Z -----------------------------------------------------------
-Test: test_failure_3
+2024-12-16T10:34:45.427Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T10:34:45.426403953Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
Stream: stdout
Output:
-Intentional extraneous chars to stdout for testing
+Mosaic_AllMethodsPublicProxy::construct exception:
-2024-12-13T02:40:45.963Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-13T02:40:45.963744794Z -----------------------------------------------------------
-Test: test_failure_4
+2024-12-16T10:34:45.428Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T10:34:45.428781379Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
Stream: stderr
Output:
-Intentional extraneous chars to stderr for testing.
+java.lang.NoSuchMethodException: No constructor found for signature: <init>
+ at com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy.construct(Mosaic_AllMethodsPublicProxy.java:188)
+ at Test_Access_0$TestSuite.test_publicClass_publicMethod(Test_Access_0.java:24)
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:580)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run_test(Mosaic_Testbench.java:58)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run(Mosaic_Testbench.java:95)
+ at Test_Access_0.main(Test_Access_0.java:64)
-2024-12-14T05:51:43.096Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-14T05:51:43.094778420Z -----------------------------------------------------------
-Test: smoke_test_logging
-Message:
-This is a smoke test for logging.
+2024-12-16T11:02:12.892Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:02:12.891300901Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
+Stream: stdout
+Output:
+Mosaic_AllMethodsPublicProxy::construct exception:
+
+
+2024-12-16T11:02:12.894Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:02:12.894076730Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
+Stream: stderr
+Output:
+java.lang.NoSuchMethodException: No constructor found for signature: <init>
+ at com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy.construct(Mosaic_AllMethodsPublicProxy.java:188)
+ at Test_Access_0$TestSuite.test_publicClass_publicMethod(Test_Access_0.java:24)
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:580)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run_test(Mosaic_Testbench.java:58)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run(Mosaic_Testbench.java:95)
+ at Test_Access_0.main(Test_Access_0.java:64)
+
+
+2024-12-16T11:03:52.982Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:03:52.981361838Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
+Stream: stdout
+Output:
+Mosaic_AllMethodsPublicProxy::construct exception:
+
+
+2024-12-16T11:03:52.984Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:03:52.984090088Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
+Stream: stderr
+Output:
+java.lang.NoSuchMethodException: No constructor found for signature: <init>
+ at com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy.construct(Mosaic_AllMethodsPublicProxy.java:188)
+ at Test_Access_0$TestSuite.test_publicClass_publicMethod(Test_Access_0.java:24)
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:580)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run_test(Mosaic_Testbench.java:58)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run(Mosaic_Testbench.java:95)
+ at Test_Access_0.main(Test_Access_0.java:64)
+
-2024-12-14T05:51:43.496Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-14T05:51:43.494998052Z -----------------------------------------------------------
-Test: test_failure_3
+2024-12-16T11:05:17.523Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:05:17.521819930Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
Stream: stdout
Output:
-Intentional extraneous chars to stdout for testing
+Mosaic_AllMethodsPublicProxy::construct exception:
-2024-12-14T05:51:43.497Z [main] INFO c.R.Mosaic.Mosaic_Logger -
-2024-12-14T05:51:43.497259959Z -----------------------------------------------------------
-Test: test_failure_4
+2024-12-16T11:05:17.524Z [main] INFO c.R.Mosaic.Mosaic_Logger -
+2024-12-16T11:05:17.524857224Z -----------------------------------------------------------
+Test: test_publicClass_publicMethod
Stream: stderr
Output:
-Intentional extraneous chars to stderr for testing.
+java.lang.NoSuchMethodException: No constructor found for signature: <init>
+ at com.ReasoningTechnology.Mosaic.Mosaic_AllMethodsPublicProxy.construct(Mosaic_AllMethodsPublicProxy.java:188)
+ at Test_Access_0$TestSuite.test_publicClass_publicMethod(Test_Access_0.java:24)
+ at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
+ at java.base/java.lang.reflect.Method.invoke(Method.java:580)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run_test(Mosaic_Testbench.java:58)
+ at com.ReasoningTechnology.Mosaic.Mosaic_Testbench.run(Mosaic_Testbench.java:95)
+ at Test_Access_0.main(Test_Access_0.java:64)
+++ /dev/null
-#!/bin/env bash
-script_afp=$(realpath "${BASH_SOURCE[0]}")
-
-# each test listed here will receive a shell wrapper, and run_tests will
-# include the test in the test run, in the order it appears in the list.
-
-# input guards
-env_must_be="tester/toolđź–‰/env"
-if [ "$ENV" != "$env_must_be" ]; then
- echo "$(script_fp):: error: must be run in the $env_must_be environment"
- exit 1
-fi
-
-# space separated list of bash interface wrappers
-echo\
- Test_Logger\
- Test0\
- Test_Util\
- Test_IO\
- Test_Testbench\
- Test_MockClass_0\
- Test_Util_proxy\
- Test_IsPrimitive\
- Test_FunctionSignature\
- ""
# remove files
set -x
cd "$REPO_HOME"/tester
+ rm_na log/log.txt
rm_na -r scratchpad/*
rm_na bash/*
set +x
# input guards
- env_must_be="tester/toolđź–‰/env"
- if [ "$ENV" != "$env_must_be" ]; then
- echo "$(script_fp):: error: must be run in the $env_must_be environment"
- exit 1
- fi
+env_must_be="tester/toolđź–‰/env"
+if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+fi
echo "Compiling files..."
- set -x
- cd $REPO_HOME/tester
- javac -g -d scratchpad javacđź–‰/*.java
- set +x
+set -x
+cd $REPO_HOME/tester
+
+# Get the list of tests to compile
+# wrapper is a space-separated list
+wrapper_list=$(test_list)
+
+# make class files
+for file in $wrapper_list; do
+ javac -g -d scratchpad "javacđź–‰/$file.java"
+done
+set +x
echo "Creating bash wrappers..."
- mkdir -p bash
- # wrapper is a space separated list
- wrapper=$(bash_wrapper_list)
- for file in $wrapper;do
- cat > bash/$file << EOL
+mkdir -p bash
+
+# make shell call wrappers
+for file in $wrapper_list; do
+ cat > bash/$file << EOL
#!/bin/env bash
java $file
EOL
- chmod +x bash/$file
+ chmod +x bash/$file
done
echo "$(script_fp) done."
--- /dev/null
+#!/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
+# returns the list of tests for 'make' and for 'run_tests'.
+
+# input guards
+env_must_be="tester/toolđź–‰/env"
+if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+fi
+
+# space separated list of bash interface wrappers
+echo\
+ Test_Logger\
+ Test0\
+ Test_Util\
+ Test_IO\
+ Test_Testbench\
+ Test_MockClass_0\
+ Test_IsPrimitive\
+ Test_Access_0\
+ ""
PATH="$REPO_HOME/tool_shared/third_party/RT-project-share/release/amd64:$PATH"
PATH="$REPO_HOME/tool_shared/third_party/emacs/bin:$PATH"
-# after having installed Itellij IDEA
-# PATH="$REPO_HOME/tool_shared/third_party/idea-IC-243.21565.193/:$PATH"
+ # after having installed Itellij IDEA
+ PATH="$REPO_HOME/tool_shared/third_party/idea-IC-243.21565.193/bin:$PATH"
JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-23.0.1"
LOGGER_CLASSIC="$REPO_HOME"/tool_shared/third_party/logback-classic-1.4.11.jar
LOGGER_CORE="$REPO_HOME"/tool_shared/third_party/logback-core-1.4.11.jar
-
export PATH JAVA_HOME LOGGER_FACADE LOGGER_CLASSIC LOGGER_CORE
# --------------------------------------------------------------------------------
Otherwise, follow the directions below to make a local
install of the third party tool.
-----------------------------------------
-RT-project-share
-
-This pulls in documents and commonly used scripts. The project has symbolic links
-into RT-icommon, so this is not optional.
-
- cd "$REPO_HOME/tool_shared/third_party/"
- git clone https://github.com/Thomas-Walker-Lynch/RT-project-share.git
-
- note this link should already be present:
- ln -s "$REPO_HOME/tool_shared/third_party/resource/document" see_also
-
-----------------------------------------
-jdk-23
-
- cd "$REPO_HOME/tool_shared/third_party/upstream"
-
- # source for the 11 version used before, now upgraded to 23
- #curl -C - -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16+8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz
- curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O https://download.oracle.com/java/23/latest/jdk-23_linux-x64_bin.tar.gz
-
- cd ..
- tar -xzf upstream/jdk-23_linux-x64_bin.tar.gz
-
- edit $REPO_HOME/tool_shared/bespoke/env, and update JAVA_HOME:
- export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-23.0.1"
-
----------------------------------------
Logging
#curl -O https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.5.12/logback-classic-1.5.12.jar
#curl -O https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.5.12/logback-core-1.5.12.jar
-
-
-
add to bespokeđź–‰/env names for these for use in CLASSPATH
----------------------------------------
-IDE
-
-See
-$REPO_HOME/tool_shared/document/install_emacs.txt
-$REPO_HOME/tool_shared/document/install_IntelliJ_IDEA.txt
-
-
-but a local install of an IDE will assure it is
-sync with the rest of the project build for configuration files and tools built
-in to it.
-
-See the install_emacs.txt and/or install_IDEA.txt files.
+see ~/RT-project-share/documentđź–‰ for:
-Note, I am using emacs mainly, but also configured and ran IntelliJ IDEA to make
-sure it was working.
+ jdk-23; and one or more IDEs: IntelliJ IDEA, Eclipse, Emacs