You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2025/06/13 12:50:12 UTC

(causeway) branch v4 updated (2e656191d9c -> 752ffc0d3ce)

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a change to branch v4
in repository https://gitbox.apache.org/repos/asf/causeway.git


    from 2e656191d9c CAUSEWAY-3892: work on deprecations (4)
     add ba6c5e4e755 Bump cucumber.version from 7.22.2 to 7.23.0
     add c20d335987a Merge pull request #2954 from apache/dependabot/maven/main/cucumber.version-7.23.0
     add 2a72e04bfa0 Bump org.junit.platform:junit-platform-console from 1.12.2 to 1.13.0
     add 96536e4ecb7 Merge pull request #2955 from apache/dependabot/maven/main/org.junit.platform-junit-platform-console-1.13.0
     add 290d5d13167 Bump org.junit.jupiter:junit-jupiter-api from 5.12.2 to 5.13.0
     add 48f1aa91b23 Merge pull request #2956 from apache/dependabot/maven/main/org.junit.jupiter-junit-jupiter-api-5.13.0
     add 052b1f58175 Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.1 to 3.5.0
     add 4749575685a Merge pull request #2957 from apache/dependabot/maven/main/org.apache.maven.plugins-maven-clean-plugin-3.5.0
     add c44a455b0e7 Bump com.fasterxml.woodstox:woodstox-core from 7.1.0 to 7.1.1
     add 877019f9cd6 Merge pull request #2959 from apache/dependabot/maven/main/com.fasterxml.woodstox-woodstox-core-7.1.1
     add 19f44d06af9 Bump org.codehaus.mojo:exec-maven-plugin from 3.5.0 to 3.5.1
     add 4161daf311a Merge pull request #2958 from apache/dependabot/maven/main/org.codehaus.mojo-exec-maven-plugin-3.5.1
     add 51cdf6a59ee Bump org.owasp:dependency-check-maven from 12.1.1 to 12.1.2
     add e1513487e2e Merge pull request #2968 from apache/dependabot/maven/main/org.owasp-dependency-check-maven-12.1.2
     add 700ca8e0861 Bump org.codehaus.mojo:build-helper-maven-plugin from 3.6.0 to 3.6.1
     add 9c7459433cf Merge pull request #2970 from apache/dependabot/maven/main/org.codehaus.mojo-build-helper-maven-plugin-3.6.1
     add 4a369203963 Bump org.junit.platform:junit-platform-console from 1.13.0 to 1.13.1
     add 500cd89d2dc Merge pull request #2967 from apache/dependabot/maven/main/org.junit.platform-junit-platform-console-1.13.1
     add e7ed1fe19f6 Bump org.junit.jupiter:junit-jupiter-api from 5.13.0 to 5.13.1
     add 5044f10852c Merge pull request #2969 from apache/dependabot/maven/main/org.junit.jupiter-junit-jupiter-api-5.13.1
     add 50f12ff4fbb CAUSEWAY-3885: adds new module for the generation of JDO Q classes
     add c058adcdf06 Merge pull request #2931 from apache/CAUSEWAY-3885
     add b794e379042 ESP-3886 : adds utility to measure metaclass memory usage.
     add 44886cdb92a Merge pull request #2932 from apache/CAUSEWAY-3886
     add 34b360bc20b CAUSEWAY-3883: updates docs a little
     add a6a16c01547 CAUSEWAY-3883: updates more javadoc
     add a3769a845a2 CAUSEWAY-3883: improves javadoc some more
     add 65d64cd85b7 CAUSEWAY-3883: testing
     add 8fe3bb7be51 Merge branch 'CAUSEWAY-3883' into maintenance-branch
     add 5fbcdd60dab CAUSEWAY-3891: adds noCache flag as an experiment
     add d589bafcdb3 CAUSEWAY-3891 and CAUSEWAY-3883: merges from maintenance branch
     new 752ffc0d3ce Merge remote-tracking branch 'origin/main' into v4

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 commons/src/main/java/module-info.java             |   1 +
 .../commons/internal/debug/_MemoryUsage.java       |  98 ++++++++++++++
 .../metamodel/context/HasMetaModelContext.java     |   5 +
 .../context/MetaModelContext_usingSpring.java      |   5 +
 .../metamodel/spec/impl/ObjectMemberAbstract.java  |   5 -
 .../runtimeservices/src/main/java/module-info.java |   1 +
 .../pdfjs/wkt/ui/components/PdfJsViewerPanel.java  |  20 +--
 .../testdomain/jpa/JpaInventoryManager.java        |   6 +
 ...st.java => WrapperInteraction_1_IntegTest.java} |  14 +-
 ...t2.java => WrapperInteraction_2_IntegTest.java} |  13 +-
 ...t3.java => WrapperInteraction_3_IntegTest.java} |  17 +--
 ...t4.java => WrapperInteraction_4_IntegTest.java} |  13 +-
 .../WrapperInteraction_Caching_IntegTest.java      | 141 +++++++++++++++++++++
 .../jpa/wrapper/JpaWrapperSyncTest.java            |  86 +++++++++++++
 .../WrapperFactoryMetaspaceMemoryLeakTest.java     | 103 +++++++++++++++
 15 files changed, 489 insertions(+), 39 deletions(-)
 create mode 100644 commons/src/main/java/org/apache/causeway/commons/internal/debug/_MemoryUsage.java
 copy regressiontests/interact/src/test/java/org/apache/causeway/testdomain/interact/{WrapperInteractionTest.java => WrapperInteraction_1_IntegTest.java} (92%)
 copy regressiontests/interact/src/test/java/org/apache/causeway/testdomain/interact/{WrapperInteractionTest2.java => WrapperInteraction_2_IntegTest.java} (91%)
 copy regressiontests/interact/src/test/java/org/apache/causeway/testdomain/interact/{WrapperInteractionTest3.java => WrapperInteraction_3_IntegTest.java} (91%)
 copy regressiontests/interact/src/test/java/org/apache/causeway/testdomain/interact/{WrapperInteractionTest4.java => WrapperInteraction_4_IntegTest.java} (93%)
 create mode 100644 regressiontests/interact/src/test/java/org/apache/causeway/testdomain/interact/WrapperInteraction_Caching_IntegTest.java
 create mode 100644 regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/JpaWrapperSyncTest.java
 create mode 100644 regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/WrapperFactoryMetaspaceMemoryLeakTest.java


(causeway) 01/01: Merge remote-tracking branch 'origin/main' into v4

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 752ffc0d3ce56abc23d21654400fca865aea0809
Merge: 2e656191d9c d589bafcdb3
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jun 13 14:50:07 2025 +0200

    Merge remote-tracking branch 'origin/main' into v4

 commons/src/main/java/module-info.java             |   1 +
 .../commons/internal/debug/_MemoryUsage.java       |  98 +++++++++++++
 .../metamodel/context/HasMetaModelContext.java     |   5 +
 .../context/MetaModelContext_usingSpring.java      |   5 +
 .../metamodel/spec/impl/ObjectMemberAbstract.java  |   5 -
 .../runtimeservices/src/main/java/module-info.java |   1 +
 .../pdfjs/wkt/ui/components/PdfJsViewerPanel.java  |  20 +--
 .../testdomain/jpa/JpaInventoryManager.java        |   6 +
 .../interact/WrapperInteraction_1_IntegTest.java   | 149 +++++++++++++++++++
 .../interact/WrapperInteraction_2_IntegTest.java   | 132 +++++++++++++++++
 .../interact/WrapperInteraction_3_IntegTest.java   | 158 +++++++++++++++++++++
 .../interact/WrapperInteraction_4_IntegTest.java   | 152 ++++++++++++++++++++
 .../WrapperInteraction_Caching_IntegTest.java      | 141 ++++++++++++++++++
 .../jpa/wrapper/JpaWrapperSyncTest.java            |  86 +++++++++++
 .../WrapperFactoryMetaspaceMemoryLeakTest.java     | 103 ++++++++++++++
 15 files changed, 1049 insertions(+), 13 deletions(-)

diff --cc commons/src/main/java/module-info.java
index dc27edec287,27b06a6870d..fd5cc6fdc27
--- a/commons/src/main/java/module-info.java
+++ b/commons/src/main/java/module-info.java
@@@ -66,6 -66,7 +66,7 @@@ module org.apache.causeway.commons 
      requires transitive java.desktop;
      requires transitive java.sql;
      requires transitive java.xml;
 -    requires transitive org.apache.logging.log4j;
++    requires transitive java.management;
      requires transitive org.jdom2;
      requires transitive org.jspecify;
      requires transitive org.jsoup;
diff --cc regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/JpaWrapperSyncTest.java
index 00000000000,a62821d1e69..e58358093f4
mode 000000,100644..100644
--- a/regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/JpaWrapperSyncTest.java
+++ b/regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/JpaWrapperSyncTest.java
@@@ -1,0 -1,90 +1,86 @@@
+ /*
+  *  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
+  *
+  *        http://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.causeway.testdomain.persistence.jpa.wrapper;
+ 
+ import jakarta.inject.Inject;
+ 
+ import org.junit.jupiter.api.AfterEach;
+ import org.junit.jupiter.api.BeforeEach;
+ import org.junit.jupiter.api.Test;
+ 
+ import static org.junit.jupiter.api.Assertions.assertEquals;
+ 
+ import org.springframework.boot.test.context.SpringBootTest;
 -import org.springframework.test.context.TestPropertySource;
 -
+ import org.apache.causeway.applib.services.repository.RepositoryService;
+ import org.apache.causeway.applib.services.wrapper.WrapperFactory;
 -import org.apache.causeway.core.config.presets.CausewayPresets;
+ import org.apache.causeway.testdomain.fixtures.EntityTestFixtures;
+ import org.apache.causeway.testdomain.jpa.JpaInventoryManager;
+ import org.apache.causeway.testdomain.jpa.JpaTestFixtures;
+ import org.apache.causeway.testdomain.jpa.conf.Configuration_usingJpa;
+ import org.apache.causeway.testdomain.jpa.entities.JpaBook;
+ import org.apache.causeway.testdomain.jpa.entities.JpaProduct;
+ import org.apache.causeway.testing.integtestsupport.applib.CausewayIntegrationTestAbstract;
+ 
+ import lombok.val;
+ 
+ @SpringBootTest(
+         classes = {
+                 Configuration_usingJpa.class
+         },
+         properties = {
+                 "spring.datasource.url=jdbc:h2:mem:JpaWrapperSyncTest"
+         }
+ )
 -@TestPropertySource(CausewayPresets.UseLog4j2Test)
+ class JpaWrapperSyncTest extends CausewayIntegrationTestAbstract {
+ 
+     @Inject private RepositoryService repository;
+     @Inject private WrapperFactory wrapper;
+     @Inject private JpaTestFixtures testFixtures;
+ 
+     protected EntityTestFixtures.Lock lock;
+ 
+     @BeforeEach
+     void installFixture() {
+         this.lock = testFixtures.aquireLock();
+         lock.install();
+     }
+ 
+     @AfterEach
+     void uninstallFixture() {
+         this.lock.release();
+     }
+ 
+     @Test
+     void testWrapper_waitingOnDomainEvent() {
+ 
+         val inventoryManager = factoryService.viewModel(JpaInventoryManager.class);
+         val sumOfPrices = repository.allInstances(JpaProduct.class)
+                 .stream()
+                 .mapToDouble(JpaProduct::getPrice)
+                 .sum();
+ 
+         assertEquals(167d, sumOfPrices, 1E-6);
+ 
+         val products = wrapper.wrap(inventoryManager).getAllProducts();
+ 
+         assertEquals(3, products.size());
+         assertEquals(JpaBook.class, products.get(0).getClass());
+     }
+ 
+ }
diff --cc regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/WrapperFactoryMetaspaceMemoryLeakTest.java
index 00000000000,18dd21de935..c579fbfe39f
mode 000000,100644..100644
--- a/regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/WrapperFactoryMetaspaceMemoryLeakTest.java
+++ b/regressiontests/persistence-jpa/src/test/java/org/apache/causeway/testdomain/persistence/jpa/wrapper/WrapperFactoryMetaspaceMemoryLeakTest.java
@@@ -1,0 -1,107 +1,103 @@@
+ /*
+  *  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
+  *
+  *        http://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.causeway.testdomain.persistence.jpa.wrapper;
+ 
+ import jakarta.inject.Inject;
+ 
+ import org.junit.jupiter.api.AfterEach;
+ import org.junit.jupiter.api.BeforeEach;
+ import org.junit.jupiter.api.Test;
+ 
+ import org.springframework.boot.test.context.SpringBootTest;
 -import org.springframework.test.context.TestPropertySource;
 -
+ import org.apache.causeway.applib.services.wrapper.WrapperFactory;
+ import org.apache.causeway.commons.internal.base._Blackhole;
+ import org.apache.causeway.commons.internal.debug._MemoryUsage;
 -import org.apache.causeway.core.config.presets.CausewayPresets;
+ import org.apache.causeway.testdomain.fixtures.EntityTestFixtures;
+ import org.apache.causeway.testdomain.jpa.JpaInventoryManager;
+ import org.apache.causeway.testdomain.jpa.JpaTestFixtures;
+ import org.apache.causeway.testdomain.jpa.conf.Configuration_usingJpa;
+ import org.apache.causeway.testdomain.jpa.entities.JpaProduct;
+ import org.apache.causeway.testing.integtestsupport.applib.CausewayIntegrationTestAbstract;
+ 
+ @SpringBootTest(
+         classes = {
+                 Configuration_usingJpa.class,
+         },
+         properties = {
+                 "spring.datasource.url=jdbc:h2:mem:JpaWrapperSyncTest"
+         }
+ )
 -@TestPropertySource(CausewayPresets.UseLog4j2Test)
+ class WrapperFactoryMetaspaceMemoryLeakTest extends CausewayIntegrationTestAbstract {
+ 
+     @Inject private WrapperFactory wrapper;
+     @Inject private JpaTestFixtures testFixtures;
+ 
+     protected EntityTestFixtures.Lock lock;
+ 
+     @BeforeEach
+     void installFixture() {
+         this.lock = testFixtures.aquireLock();
+         lock.install();
+     }
+ 
+     @AfterEach
+     void uninstallFixture() {
+         this.lock.release();
+     }
+ 
+     @Test
+     void testWrapper_waitingOnDomainEvent() throws InterruptedException {
+         _MemoryUsage.measureMetaspace("exercise", ()->{
+ // with caching
+ //            exercise(1, 0);         // 2,221 KB
+ //            exercise(1, 2000);      // 3,839 KB. // some leakage from collections
+ //            exercise(20, 0);        // 2,112 KB
+ //            exercise(20, 2000);     // 3,875 KB
+ //            exercise(2000, 0);      // 3,263 KB. // ? increased some, is it significant; a lot less than without caching
+ //            exercise(2000, 200);    // 4,294 KB.
+ //            exercise(20000, 0);     // 3,243 KB  // no noticeable leakage compared to 2000; MUCH less than without caching
+ 
+ // without caching
+ //            exercise(1, 0);        //   2,244 KB
+ //            exercise(1, 2000);     //.  3,669 KB // some leakage from collections
+ //            exercise(20, 0);       //   2,440 KB
+ //            exercise(20, 2000);    //.  4,286 KB
+             exercise(2000, 0);     //  14,580 KB // significant leakage from 20
+ //            exercise(2000, 200);   //  20,423 KB
+ //            exercise(20000, 0);    //.115,729 KB
+         });
+     }
+ 
 -    private void exercise(int instances, int loops) {
++    private void exercise(final int instances, final int loops) {
+         for (int i = 0; i < instances; i++) {
+             var jpaInventoryManager = wrapper.wrap(factoryService.viewModel(JpaInventoryManager.class));
+             jpaInventoryManager.foo();
+ 
+             for (var j = 0; j < loops; j++) {
+                 jpaInventoryManager
+                     .getAllProducts()
+                     .stream()
+                     .map(JpaProduct::getName)
+                     .forEach(_Blackhole::consume);
+             }
+         }
+     }
+ }
+ 
+