You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/06/22 09:18:51 UTC

[isis] branch master updated: ISIS-2742: more meta-annotations tests

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c7e06ac  ISIS-2742: more meta-annotations tests
c7e06ac is described below

commit c7e06ac01bd24906cc5d1c0089f7c4e3e4de7859
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Jun 22 11:18:42 2021 +0200

    ISIS-2742: more meta-annotations tests
---
 .../domainmodel/jdo/DomainModelTest.java           | 19 ++++++++++++++-
 .../isis/testdomain/jdo/entities/package.jdo       | 27 ----------------------
 2 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/regressiontests/stable-persistence-jdo/src/test/java/org/apache/isis/testdomain/domainmodel/jdo/DomainModelTest.java b/regressiontests/stable-persistence-jdo/src/test/java/org/apache/isis/testdomain/domainmodel/jdo/DomainModelTest.java
index b772d81..71c6db5 100644
--- a/regressiontests/stable-persistence-jdo/src/test/java/org/apache/isis/testdomain/domainmodel/jdo/DomainModelTest.java
+++ b/regressiontests/stable-persistence-jdo/src/test/java/org/apache/isis/testdomain/domainmodel/jdo/DomainModelTest.java
@@ -19,6 +19,8 @@
 package org.apache.isis.testdomain.domainmodel.jdo;
 
 import javax.inject.Inject;
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
 
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -33,7 +35,9 @@ import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.core.config.presets.IsisPresets;
 import org.apache.isis.core.metamodel.facets.object.entity.EntityFacet;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.persistence.jdo.provider.metamodel.facets.object.datastoreidentity.JdoDatastoreIdentityFacet;
 import org.apache.isis.persistence.jdo.provider.metamodel.facets.object.persistencecapable.JdoPersistenceCapableFacet;
+import org.apache.isis.persistence.jdo.provider.metamodel.facets.object.version.JdoVersionFacet;
 import org.apache.isis.testdomain.conf.Configuration_usingJdo;
 import org.apache.isis.testdomain.jdo.entities.JdoEntityMetaAnnotated;
 import org.apache.isis.testdomain.jdo.entities.JdoProduct;
@@ -89,7 +93,20 @@ class DomainModelTest {
 
         assertEquals(BeanSort.ENTITY, entitySpec.getBeanSort());
         assertNotNull(entitySpec.getFacet(EntityFacet.class));
-        assertNotNull(entitySpec.getFacet(JdoPersistenceCapableFacet.class));
+
+        //@PersistenceCapable(identityType = IdentityType.DATASTORE)
+        val persistenceCapableFacet = entitySpec.getFacet(JdoPersistenceCapableFacet.class);
+        assertNotNull(persistenceCapableFacet);
+        assertEquals(IdentityType.DATASTORE, persistenceCapableFacet.getIdentityType());
+
+        //@DatastoreIdentity(strategy = IdGeneratorStrategy.NATIVE)
+        val datastoreIdentityFacet = entitySpec.getFacet(JdoDatastoreIdentityFacet.class);
+        assertNotNull(datastoreIdentityFacet);
+        assertEquals(IdGeneratorStrategy.NATIVE, datastoreIdentityFacet.getStrategy());
+
+        //@Version(strategy = VersionStrategy.VERSION_NUMBER)
+        val versionFacet = entitySpec.getFacet(JdoVersionFacet.class);
+        assertNotNull(versionFacet);
     }
 
 
diff --git a/regressiontests/stable/src/main/java/org/apache/isis/testdomain/jdo/entities/package.jdo b/regressiontests/stable/src/main/java/org/apache/isis/testdomain/jdo/entities/package.jdo
deleted file mode 100644
index 3d998be..0000000
--- a/regressiontests/stable/src/main/java/org/apache/isis/testdomain/jdo/entities/package.jdo
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!-- 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. -->
-<jdo xmlns="http://xmlns.jcp.org/xml/ns/jdo/jdo"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo http://xmlns.jcp.org/xml/ns/jdo/jdo_3_1.xsd"
-	version="3.1">
-
-	<!-- usually this file helps the DN Eclipse plugin finding the entities, that need enhancing -->
-
-	<package name="org.apache.isis.testdomain.jdo.entities">
-		<class name="JdoProduct" />
-		<class name="JdoProductComment" />
-		<class name="JdoBook" />
-		<class name="JdoInventory" />
-	</package>
-
-</jdo>
-