Skip to content

Commit

Permalink
[25356] update core model test due to heap content lazy change
Browse files Browse the repository at this point in the history
  • Loading branch information
huthomas committed Aug 23, 2023
1 parent ecfec06 commit 5defbbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
14 changes: 9 additions & 5 deletions tests/ch.elexis.core.model.test/CoreModelTests.launch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<setEntry value="com.sun.xml.bind.jaxb-osgi@default:default"/>
<setEntry value="jakarta.persistence@default:default"/>
<setEntry value="jakarta.ws.rs-api@default:default"/>
<setEntry value="jakarta.xml.bind-api@default:default"/>
<setEntry value="jakarta.xml.bind-api@default:false"/>
<setEntry value="javax.activation@default:default"/>
<setEntry value="javax.annotation@default:default"/>
<setEntry value="javax.inject@default:default"/>
Expand All @@ -69,6 +69,7 @@
<setEntry value="org.apache.commons.commons-dbcp2@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-pool2@default:default"/>
<setEntry value="org.apache.commons.commons-text@default:default"/>
<setEntry value="org.apache.commons.lang3@default:default"/>
<setEntry value="org.apache.commons.logging*1.2.0.v20180409-1502@default:default"/>
<setEntry value="org.apache.commons.logging*1.2.0@default:default"/>
Expand All @@ -83,7 +84,7 @@
<setEntry value="org.eclipse.ant.core@default:default"/>
<setEntry value="org.eclipse.core.contenttype@default:default"/>
<setEntry value="org.eclipse.core.expressions@default:default"/>
<setEntry value="org.eclipse.core.filesystem.linux.x86_64@default:default"/>
<setEntry value="org.eclipse.core.filesystem.linux.x86_64@default:false"/>
<setEntry value="org.eclipse.core.filesystem@default:default"/>
<setEntry value="org.eclipse.core.jobs@default:default"/>
<setEntry value="org.eclipse.core.resources@default:default"/>
Expand All @@ -100,7 +101,7 @@
<setEntry value="org.eclipse.gemini.jpa@3:true"/>
<setEntry value="org.eclipse.jdt.junit.runtime@default:default"/>
<setEntry value="org.eclipse.jdt.junit4.runtime@default:default"/>
<setEntry value="org.eclipse.jetty.osgi.alpn.fragment@default:default"/>
<setEntry value="org.eclipse.jetty.osgi.alpn.fragment@default:false"/>
<setEntry value="org.eclipse.osgi.compatibility.state@default:false"/>
<setEntry value="org.eclipse.osgi.services@default:default"/>
<setEntry value="org.eclipse.osgi.util@default:default"/>
Expand All @@ -125,7 +126,7 @@
<setEntry value="org.keycloak.keycloak-authz-client@default:default"/>
<setEntry value="org.keycloak.keycloak-common@default:default"/>
<setEntry value="org.keycloak.keycloak-core@default:default"/>
<setEntry value="org.osgi.framework.system.packages.extra@default:default"/>
<setEntry value="org.osgi.framework.system.packages.extra@default:false"/>
<setEntry value="org.osgi.service.cm@default:default"/>
<setEntry value="org.osgi.service.component@default:default"/>
<setEntry value="org.osgi.service.device@default:default"/>
Expand Down Expand Up @@ -154,15 +155,18 @@
<setEntry value="ch.elexis.core.jpa.logging.slf4j@default:false"/>
<setEntry value="ch.elexis.core.jpa@default:false"/>
<setEntry value="ch.elexis.core.l10n@default:default"/>
<setEntry value="ch.elexis.core.logback.rocketchat@default:default"/>
<setEntry value="ch.elexis.core.logback.rocketchat@default:false"/>
<setEntry value="ch.elexis.core.logging.default_configuration@default:false"/>
<setEntry value="ch.elexis.core.model.test@default:false"/>
<setEntry value="ch.elexis.core.model@default:true"/>
<setEntry value="ch.elexis.core.services@default:default"/>
<setEntry value="ch.elexis.core.test.context@default:false"/>
<setEntry value="ch.elexis.core.test.logging@default:default"/>
<setEntry value="ch.elexis.core.test@default:default"/>
<setEntry value="ch.elexis.core.webdav@default:default"/>
<setEntry value="ch.elexis.core@default:default"/>
<setEntry value="ch.rgw.utility@default:default"/>
<setEntry value="info.elexis.server.core.logging@default:default"/>
</setAttribute>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.time.LocalDate;
Expand Down Expand Up @@ -457,11 +456,13 @@ public void compareExecuteCursorQueryWithLazyBlob() {
byte[] content = iBlob.getContent();
assertArrayEquals(b, content);

try (IQueryCursor<IBlob> cursor = modelService.getQuery(IBlob.class).executeAsCursor()) {
iBlob = cursor.next();
content = iBlob.getContent();
assertNull(content);
}
// blob content is not lazy any more see ticket
// https://redmine.medelexis.ch/issues/25356
// try (IQueryCursor<IBlob> cursor = modelService.getQuery(IBlob.class).executeAsCursor()) {
// iBlob = cursor.next();
// content = iBlob.getContent();
// assertNull(content);
// }

try (IQueryCursor<IBlob> cursor = modelService.getQuery(IBlob.class)
.executeAsCursor(Collections.singletonMap(QueryHints.MAINTAIN_CACHE, HintValues.TRUE))) {
Expand Down

0 comments on commit 5defbbd

Please sign in to comment.