Repository: deltaspike Updated Branches: refs/heads/master 11e1cf724 -> 2cc5eeb07
DELTASPIKE-1326 Remove backwards compatible layer for Java 8 in Data Module, since Java 8 is now required. Test against Wildfly 10 by default. Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/2cc5eeb0 Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/2cc5eeb0 Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/2cc5eeb0 Branch: refs/heads/master Commit: 2cc5eeb074081aa5157da3420995f5cd85220c40 Parents: 11e1cf7 Author: John D. Ament <johndam...@apache.org> Authored: Thu Mar 8 20:48:23 2018 -0500 Committer: John D. Ament <johndam...@apache.org> Committed: Thu Mar 8 20:48:23 2018 -0500 ---------------------------------------------------------------------- .../deltaspike/core/util/OptionalUtil.java | 76 ----- .../apache/deltaspike/core/util/StreamUtil.java | 77 ----- .../deltaspike/core/util/OptionalUtilTest.java | 65 ---- .../deltaspike/core/util/StreamUtilTest.java | 61 ---- .../data/impl/builder/DelegateQueryBuilder.java | 10 +- .../builder/result/QueryProcessorFactory.java | 7 +- .../impl/handler/EntityRepositoryHandler.java | 4 +- .../RepositoryMethodMetadataInitializer.java | 19 +- .../data/test/java8/entity/Simple.java | 139 +++++++++ .../data/test/java8/repo/SimpleRepository.java | 38 +++ .../data/test/java8/repo/SimpleRepository2.java | 38 +++ .../data/test/java8/test/Java8Test.java | 167 ++++++++++ .../test/java8/util/EntityManagerProducer.java | 30 ++ .../data/test/java8/util/TestDeployments.java | 62 ++++ deltaspike/modules/data/pom.xml | 8 +- deltaspike/modules/data/test-java8/pom.xml | 305 ------------------- .../data/test/java8/entity/Simple.java | 139 --------- .../data/test/java8/repo/SimpleRepository.java | 38 --- .../data/test/java8/repo/SimpleRepository2.java | 38 --- .../data/test/java8/test/Java8Test.java | 167 ---------- .../test/java8/util/EntityManagerProducer.java | 30 -- .../data/test/java8/util/TestDeployments.java | 62 ---- .../resources-glassfish/test-persistence.xml | 30 -- .../test/resources-openejb/test-persistence.xml | 31 -- .../resources-weblogic/test-persistence.xml | 31 -- .../test/resources-wildfly/test-persistence.xml | 28 -- deltaspike/parent/code/pom.xml | 2 +- 27 files changed, 492 insertions(+), 1210 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/OptionalUtil.java ---------------------------------------------------------------------- diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/OptionalUtil.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/OptionalUtil.java deleted file mode 100644 index c906af4..0000000 --- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/OptionalUtil.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.deltaspike.core.util; - -import javax.enterprise.inject.Typed; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -@Typed() -public abstract class OptionalUtil -{ - private static boolean optionalSupported = true; - private static Class<?> optionalClass; - private static Method optionalMethod; - - static - { - try - { - optionalClass = Class.forName("java.util.Optional"); - optionalMethod = optionalClass.getMethod("ofNullable", Object.class); - } - catch (Exception e) - { - optionalSupported = false; - optionalClass = null; - optionalMethod = null; - } - } - - public static boolean isOptionalSupported() - { - return optionalSupported; - } - - public static boolean isOptionalReturned(Method method) - { - return optionalSupported && optionalClass.isAssignableFrom(method.getReturnType()); - } - - public static Object wrap(Object input) - { - if (!optionalSupported) - { - return input; - } - try - { - return optionalMethod.invoke(null, input); - } - catch (IllegalAccessException e) - { - } - catch (InvocationTargetException e) - { - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/StreamUtil.java ---------------------------------------------------------------------- diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/StreamUtil.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/StreamUtil.java deleted file mode 100644 index 97314ae..0000000 --- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/StreamUtil.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.deltaspike.core.util; - -import javax.enterprise.inject.Typed; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Collection; - -@Typed() -public abstract class StreamUtil -{ - private static boolean streamSupported = true; - private static Class<?> streamClass; - private static Method streamMethod; - - static - { - try - { - streamClass = Class.forName("java.util.stream.Stream"); - streamMethod = Collection.class.getMethod("stream"); - } - catch (Exception e) - { - streamSupported = false; - streamClass = null; - streamMethod = null; - } - } - - public static boolean isStreamSupported() - { - return streamSupported; - } - - public static boolean isStreamReturned(Method method) - { - return isStreamSupported() && streamClass.isAssignableFrom(method.getReturnType()); - } - - public static Object wrap(Object input) - { - if (!isStreamSupported() || input == null) - { - return input; - } - try - { - return streamMethod.invoke(input); - } - catch (IllegalAccessException e) - { - } - catch (InvocationTargetException e) - { - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/OptionalUtilTest.java ---------------------------------------------------------------------- diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/OptionalUtilTest.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/OptionalUtilTest.java deleted file mode 100644 index 7c76d9b..0000000 --- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/OptionalUtilTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.deltaspike.core.util; - -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; - -import java.lang.reflect.Method; - -public class OptionalUtilTest -{ - @Before - public void isEnabled() - { - Assume.assumeTrue(OptionalUtil.isOptionalSupported()); - } - - @Test - public void shouldIdentifyOptionalReturnType() throws Exception - { - Method empty = getOptionalClass().getMethod("empty"); - Assert.assertTrue(OptionalUtil.isOptionalReturned(empty)); - } - - @Test - public void shouldReturnEmptyWhenGivenNull() throws Exception - { - Object wrapped = OptionalUtil.wrap(null); - Method isPresent = getOptionalClass().getMethod("isPresent"); - Object invoke = isPresent.invoke(wrapped); - Assert.assertEquals(invoke, Boolean.FALSE); - } - - @Test - public void shouldReturnNotEmptyWhenGivenNonnull() throws Exception - { - Object wrapped = OptionalUtil.wrap("String"); - Method isPresent = getOptionalClass().getMethod("isPresent"); - Object invoke = isPresent.invoke(wrapped); - Assert.assertEquals(invoke, Boolean.TRUE); - } - - private static Class<?> getOptionalClass() throws ClassNotFoundException { - return Class.forName("java.util.Optional"); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/StreamUtilTest.java ---------------------------------------------------------------------- diff --git a/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/StreamUtilTest.java b/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/StreamUtilTest.java deleted file mode 100644 index 8c49f9d..0000000 --- a/deltaspike/core/api/src/test/java/org/apache/deltaspike/core/util/StreamUtilTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.deltaspike.core.util; - -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Before; -import org.junit.Test; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; - -public class StreamUtilTest -{ - @Before - public void isEnabled() - { - Assume.assumeTrue(StreamUtil.isStreamSupported()); - } - - @Test - public void shouldIdentifyStreamReturnType() throws Exception - { - Method empty = ArrayList.class.getMethod("stream"); - Assert.assertTrue(StreamUtil.isStreamReturned(empty)); - } - - @Test - public void shouldReturnEmptyWhenGivenNull() throws Exception - { - Object wrapped = StreamUtil.wrap(null); - Assert.assertNull(wrapped); - } - - @Test - public void shouldReturnAStreamWhenGivenACollection() throws Exception - { - Object wrapped = StreamUtil.wrap(Arrays.asList("a","b")); - Class<?> streamClass = Class.forName("java.util.stream.Stream"); - Assert.assertTrue(streamClass.isAssignableFrom(wrapped.getClass())); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java index 05d0e57..4316b55 100644 --- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java @@ -23,6 +23,7 @@ import java.lang.reflect.Method; import java.util.Collection; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.Set; import javax.enterprise.context.ApplicationScoped; @@ -35,8 +36,6 @@ import javax.persistence.PersistenceException; import org.apache.deltaspike.core.api.provider.BeanProvider; import org.apache.deltaspike.core.util.ClassUtils; -import org.apache.deltaspike.core.util.OptionalUtil; -import org.apache.deltaspike.core.util.StreamUtil; import org.apache.deltaspike.data.api.QueryInvocationException; import org.apache.deltaspike.data.impl.handler.CdiQueryInvocationContext; import org.apache.deltaspike.data.impl.util.bean.BeanDestroyable; @@ -48,8 +47,7 @@ public class DelegateQueryBuilder extends QueryBuilder @Inject private BeanManager beanManager; - private final Map<Method, Bean<DelegateQueryHandler>> lookupCache - = new HashMap<Method, Bean<DelegateQueryHandler>>(); + private final Map<Method, Bean<DelegateQueryHandler>> lookupCache = new HashMap<>(); @Override public Object execute(CdiQueryInvocationContext context) @@ -62,11 +60,11 @@ public class DelegateQueryBuilder extends QueryBuilder Object result = invoke(delegate, context); if (result instanceof Collection && context.getRepositoryMethodMetadata().isReturnsStream()) { - return StreamUtil.wrap(result); + return ((Collection) result).stream(); } else if (context.getRepositoryMethodMetadata().isReturnsOptional()) { - return OptionalUtil.wrap(result); + return Optional.ofNullable(result); } else { http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java index 946e51d..89da622 100644 --- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java @@ -19,14 +19,13 @@ package org.apache.deltaspike.data.impl.builder.result; import java.util.List; +import java.util.Optional; import javax.enterprise.context.ApplicationScoped; import javax.persistence.NoResultException; import javax.persistence.Query; import org.apache.deltaspike.core.util.ClassUtils; -import org.apache.deltaspike.core.util.OptionalUtil; -import org.apache.deltaspike.core.util.StreamUtil; import org.apache.deltaspike.data.api.Modifying; import org.apache.deltaspike.data.api.QueryResult; import org.apache.deltaspike.data.api.SingleResultType; @@ -89,7 +88,7 @@ public class QueryProcessorFactory @Override public Object executeQuery(Query query, CdiQueryInvocationContext context) { - return StreamUtil.wrap(query.getResultList()); + return query.getResultList().stream(); } } @@ -121,7 +120,7 @@ public class QueryProcessorFactory if (context.getRepositoryMethodMetadata().isReturnsOptional()) { - return OptionalUtil.wrap(result); + return Optional.ofNullable(result); } else { http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java index 2eb1cce..0eb2340 100755 --- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandler.java @@ -18,7 +18,6 @@ */ package org.apache.deltaspike.data.impl.handler; -import org.apache.deltaspike.core.util.OptionalUtil; import org.apache.deltaspike.data.api.EntityRepository; import org.apache.deltaspike.data.api.Query; import org.apache.deltaspike.data.impl.builder.QueryBuilder; @@ -44,6 +43,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.logging.Level; import java.util.logging.Logger; @@ -131,7 +131,7 @@ public class EntityRepositoryHandler<E, PK extends Serializable> catch (Exception e) { } - return OptionalUtil.wrap(found); + return Optional.ofNullable(found); } @Override http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java index da0ef0e..adcfc49 100644 --- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java +++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java @@ -23,7 +23,9 @@ import static org.apache.deltaspike.core.util.StringUtils.isNotEmpty; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.Optional; import java.util.Set; +import java.util.stream.Stream; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.spi.Bean; @@ -33,8 +35,6 @@ import javax.persistence.LockModeType; import org.apache.deltaspike.core.util.AnnotationUtils; import org.apache.deltaspike.core.util.ClassUtils; -import org.apache.deltaspike.core.util.OptionalUtil; -import org.apache.deltaspike.core.util.StreamUtil; import org.apache.deltaspike.data.api.Modifying; import org.apache.deltaspike.data.api.Query; import org.apache.deltaspike.data.api.Repository; @@ -53,19 +53,14 @@ public class RepositoryMethodMetadataInitializer @Inject private QueryProcessorFactory queryProcessorFactory; - @Inject - private BeanManager beanManager; - public RepositoryMethodMetadata init(RepositoryMetadata repositoryMetadata, Method method, BeanManager beanManager) { RepositoryMethodMetadata repositoryMethodMetadata = new RepositoryMethodMetadata(); repositoryMethodMetadata.setMethod(method); - repositoryMethodMetadata.setReturnsOptional( - OptionalUtil.isOptionalReturned(method)); - repositoryMethodMetadata.setReturnsStream( - StreamUtil.isStreamReturned(method)); + repositoryMethodMetadata.setReturnsOptional(Optional.class.isAssignableFrom(method.getReturnType())); + repositoryMethodMetadata.setReturnsStream(Stream.class.isAssignableFrom(method.getReturnType())); repositoryMethodMetadata.setQuery(method.isAnnotationPresent(Query.class) ? method.getAnnotation(Query.class) : null); @@ -87,7 +82,7 @@ public class RepositoryMethodMetadataInitializer extractMapper(method, repositoryMetadata)); initQueryRoot(repositoryMetadata, repositoryMethodMetadata); - initQueryInOutMapperIsNormalScope(repositoryMetadata, repositoryMethodMetadata, beanManager); + initQueryInOutMapperIsNormalScope(repositoryMethodMetadata, beanManager); initSingleResultType(repositoryMethodMetadata); initRequiresTransaction(repositoryMethodMetadata); @@ -127,8 +122,8 @@ public class RepositoryMethodMetadataInitializer } } - private void initQueryInOutMapperIsNormalScope(RepositoryMetadata repositoryMetadata, - RepositoryMethodMetadata repositoryMethodMetadata, BeanManager beanManager) + private void initQueryInOutMapperIsNormalScope(RepositoryMethodMetadata repositoryMethodMetadata, + BeanManager beanManager) { if (repositoryMethodMetadata.getQueryInOutMapperClass() != null) { http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java new file mode 100644 index 0000000..b262ce2 --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java @@ -0,0 +1,139 @@ +/* + * 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.deltaspike.data.test.java8.entity; + +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@NamedQueries({ + @NamedQuery(name = Simple.BY_NAME_LIKE, + query = "select e from Simple e where e.name like ?1"), + @NamedQuery(name = Simple.BY_NAME_ENABLED, + query = "select s from Simple s where s.name = ?1 and s.enabled = ?2 order by s.id asc"), + @NamedQuery(name = Simple.BY_ID, + query = "select s from Simple s where s.id = :id and s.enabled = :enabled") +}) +@Table(name = "SIMPLE_TABLE") +public class Simple +{ + public static final String BY_NAME_LIKE = "simple.byNameLike"; + public static final String BY_NAME_ENABLED = "simple.byNameAndEnabled"; + public static final String BY_ID = "simple.byId"; + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue + private Long id; + + private String name; + private String camelCase; + private Boolean enabled = Boolean.TRUE; + private Integer counter = Integer.valueOf(0); + @Temporal(TemporalType.TIMESTAMP) + private Date temporal; + + protected Simple() + { + } + + public Simple(String name) + { + this.name = name; + } + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Boolean getEnabled() + { + return enabled; + } + + public void setEnabled(Boolean enabled) + { + this.enabled = enabled; + } + + public Integer getCounter() + { + return counter; + } + + public void setCounter(Integer counter) + { + this.counter = counter; + } + + public String getCamelCase() + { + return camelCase; + } + + public void setCamelCase(String camelCase) + { + this.camelCase = camelCase; + } + + public Date getTemporal() + { + return temporal; + } + + public void setTemporal(Date temporal) + { + this.temporal = temporal; + } + + @Override + public String toString() + { + return "Simple [id=" + id + ", name=" + name + ", camelCase=" + camelCase + ", enabled=" + enabled + + ", counter=" + counter + ", temporal=" + temporal + "]"; + } + +} + http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java new file mode 100644 index 0000000..e2e61ef --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java @@ -0,0 +1,38 @@ +/* + * 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.deltaspike.data.test.java8.repo; + +import org.apache.deltaspike.data.api.Repository; +import org.apache.deltaspike.data.test.java8.entity.Simple; + +import java.util.Optional; +import java.util.stream.Stream; + +@Repository(forEntity = Simple.class) +public interface SimpleRepository +{ + Stream<Simple> findByName(String name); + + Optional<Simple> findOptional(Long id); + + Stream<Simple> findAll(); + + Optional<Simple> findBy(Long id); +} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java new file mode 100644 index 0000000..30b7f1c --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java @@ -0,0 +1,38 @@ +/* + * 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.deltaspike.data.test.java8.repo; + +import org.apache.deltaspike.data.api.Query; +import org.apache.deltaspike.data.api.Repository; +import org.apache.deltaspike.data.api.SingleResultType; +import org.apache.deltaspike.data.test.java8.entity.Simple; + +import java.util.Optional; +import java.util.stream.Stream; + +@Repository(forEntity = Simple.class) +public interface SimpleRepository2 +{ + @Query(singleResult = SingleResultType.ANY) + Optional<Simple> findByName(String name); + + @Query(value = "select name from simple_table", isNative = true) + Stream<String> findSimpleNames(); +} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java new file mode 100644 index 0000000..261556c --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java @@ -0,0 +1,167 @@ +/* + * 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.deltaspike.data.test.java8.test; + +import org.apache.deltaspike.data.test.java8.entity.Simple; +import org.apache.deltaspike.data.test.java8.repo.SimpleRepository; +import org.apache.deltaspike.data.test.java8.repo.SimpleRepository2; +import org.apache.deltaspike.test.category.WebProfileCategory; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; + +import javax.annotation.Resource; +import javax.inject.Inject; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.transaction.UserTransaction; + +import java.util.Optional; +import java.util.stream.Stream; + +import static java.util.Arrays.asList; +import java.util.Collections; +import java.util.List; +import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.toList; +import static org.apache.deltaspike.data.test.java8.util.TestDeployments.initDeployment; + +@Category(WebProfileCategory.class) +@RunWith(Arquillian.class) +public class Java8Test +{ + @Deployment + public static Archive<?> deployment() + { + return initDeployment() + .addClasses(Java8Test.class, Simple.class, SimpleRepository.class, SimpleRepository2.class); + } + + @Inject + private SimpleRepository simpleRepository; + + @Inject + private SimpleRepository2 simpleRepository2; + + @PersistenceContext + private EntityManager entityManager; + + @Resource + private UserTransaction ut; + + @Before + public void setupTX() throws Exception + { + ut.begin(); + } + + @After + public void rollbackTX() throws Exception + { + ut.rollback(); + } + + @Test + public void shouldFindOptionalSimple() throws Exception + { + Simple s = new Simple("something"); + entityManager.persist(s); + + Optional<Simple> found = simpleRepository.findOptional(s.getId()); + + Assert.assertTrue(found.isPresent()); + } + + @Test + public void shouldNotFindOptionalSimpleForMissing() throws Exception + { + Optional<Simple> found = simpleRepository.findBy(-1L); + + Assert.assertFalse(found.isPresent()); + } + + @Test + public void shouldFindStreamOfSimples() + { + String name = "something"; + Simple s = new Simple(name); + entityManager.persist(s); + + Stream<Simple> found = simpleRepository.findByName(name); + + Assert.assertEquals(1, found.count()); + } + + @Test + public void shouldFindEmptyStream() + { + String name = "something"; + Simple s = new Simple(name); + entityManager.persist(s); + + Stream<Simple> found = simpleRepository.findByName("some other name"); + + Assert.assertEquals(emptyList(), found.collect(toList())); + } + + @Test + public void shouldFindAllAsStream() + { + String name = "something"; + Simple s = new Simple(name); + entityManager.persist(s); + + Stream<Simple> found = simpleRepository.findAll(); + + Assert.assertEquals(1, found.count()); + } + + @Test + public void shouldFindByNameOptional() + { + String name = "jim"; + entityManager.persist(new Simple(name)); + entityManager.persist(new Simple(name)); + + Optional<Simple> found = simpleRepository2.findByName(name); + + Assert.assertTrue(found.isPresent()); + } + + @Test + public void shouldFindNamesAsStream() + { + entityManager.persist(new Simple("a")); + entityManager.persist(new Simple("b")); + entityManager.flush(); + + Stream<String> names = simpleRepository2.findSimpleNames(); + final List<String> actualSorted = names.collect(toList()); + Collections.sort(actualSorted); + + Assert.assertEquals(asList("a","b"), actualSorted); + } +} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java new file mode 100644 index 0000000..dc0a2fe --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java @@ -0,0 +1,30 @@ +/* + * 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.deltaspike.data.test.java8.util; + +import javax.enterprise.inject.Produces; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; + +public class EntityManagerProducer { + @PersistenceContext + @Produces + private EntityManager entityManager; +} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java new file mode 100644 index 0000000..24003ff --- /dev/null +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java @@ -0,0 +1,62 @@ +/* + * 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.deltaspike.data.test.java8.util; + +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.jboss.shrinkwrap.resolver.api.maven.Maven; + +import java.io.File; + +public class TestDeployments +{ + /** + * Create a basic deployment with dependencies, beans.xml and persistence descriptor. + * + * @return Basic web archive. + */ + public static WebArchive initDeployment() + { + WebArchive archive = ShrinkWrap + .create(WebArchive.class, "test.war") + .addAsLibraries(getDeltaSpikeDataWithDependencies()) + .addClasses(EntityManagerProducer.class) + .addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml") + .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + + return archive; + } + + private static File[] getDeltaSpikeDataWithDependencies() + { + return Maven.resolver().loadPomFromFile("pom.xml").resolve( + "org.apache.deltaspike.core:deltaspike-core-api", + "org.apache.deltaspike.core:deltaspike-core-impl", + "org.apache.deltaspike.modules:deltaspike-partial-bean-module-api", + "org.apache.deltaspike.modules:deltaspike-partial-bean-module-impl", + "org.apache.deltaspike.modules:deltaspike-jpa-module-api", + "org.apache.deltaspike.modules:deltaspike-jpa-module-impl", + "org.apache.deltaspike.modules:deltaspike-data-module-api", + "org.apache.deltaspike.modules:deltaspike-data-module-impl") + .withTransitivity() + .asFile(); + } +} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/pom.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/pom.xml b/deltaspike/modules/data/pom.xml index a794e12..08e6323 100755 --- a/deltaspike/modules/data/pom.xml +++ b/deltaspike/modules/data/pom.xml @@ -65,19 +65,13 @@ <activation> <property> <name>wildfly.version</name> - <value>10.0.0.Final</value> + <value>10.1.0.Final</value> </property> </activation> <modules> <module>test-ee7</module> </modules> </profile> - <profile> - <id>java8.tests</id> - <modules> - <module>test-java8</module> - </modules> - </profile> </profiles> </project> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/pom.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/pom.xml b/deltaspike/modules/data/test-java8/pom.xml deleted file mode 100644 index 96df36a..0000000 --- a/deltaspike/modules/data/test-java8/pom.xml +++ /dev/null @@ -1,305 +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. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>data-module-project</artifactId> - <groupId>org.apache.deltaspike.modules</groupId> - <version>1.9.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>deltaspike-data-module-test-java8</artifactId> - <packaging>jar</packaging> - - <name>Apache DeltaSpike Data-Module Tests with Java 8</name> - - <properties> - <deploy.skip>true</deploy.skip> - </properties> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <argLine>-Xms128m -Xmx1024m -XX:MaxPermSize=256m</argLine> - </configuration> - </plugin> - </plugins> - </pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <configuration> - <skip>${deploy.skip}</skip> <!-- we don't deploy our test-modules upstream --> - </configuration> - </plugin> - <plugin> - <groupId>org.bsc.maven</groupId> - <artifactId>maven-processor-plugin</artifactId> - <version>2.0.7</version> - <executions> - <execution> - <id>process-test</id> - <goals> - <goal>process-test</goal> - </goals> - <phase>generate-test-sources</phase> - </execution> - </executions> - <configuration> - <processors> - <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor> - </processors> - </configuration> - <dependencies> - <!-- this part of Hibernate is Apache License 2.0, thus O.K. for us. --> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-jpamodelgen</artifactId> - <version>1.2.0.Final</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jpa_2.1_spec</artifactId> - <version>1.0-alpha-1</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jta_1.2_spec</artifactId> - <version>1.0-alpha-1</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.apache.deltaspike.modules</groupId> - <artifactId>deltaspike-data-module-api</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.deltaspike.modules</groupId> - <artifactId>deltaspike-data-module-impl</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.deltaspike.core</groupId> - <artifactId>deltaspike-core-impl</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.deltaspike.modules</groupId> - <artifactId>deltaspike-partial-bean-module-impl</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.deltaspike.modules</groupId> - <artifactId>deltaspike-jpa-module-impl</artifactId> - <scope>test</scope> - </dependency> - - <!-- Tests --> - - <dependency> - <groupId>org.jboss.shrinkwrap.resolver</groupId> - <artifactId>shrinkwrap-resolver-impl-maven</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.jboss.shrinkwrap.descriptors</groupId> - <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <profiles> - <profile> - <id>wildfly-build-managed</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-wildfly</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>wildfly-managed</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-wildfly</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>wildfly-remote</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-wildfly</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>jbossas-managed-7</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <!--Can reuse Wildfly persistence xml file--> - <directory>src/test/resources-wildfly</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>jbossas-remote-7</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <!--Can reuse Wildfly persistence xml file--> - <directory>src/test/resources-wildfly</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>tomee-build-managed</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-openejb</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>tomee7-build-managed</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-openejb</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>glassfish-build-managed-4</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-glassfish</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>payara-build-managed-4</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-glassfish</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>wls-remote-12c</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-weblogic</directory> - </testResource> - </testResources> - </build> - </profile> - <profile> - <id>wls-managed-12c</id> - <build> - <testResources> - <testResource> - <directory>src/test/resources</directory> - </testResource> - <testResource> - <directory>src/test/resources-weblogic</directory> - </testResource> - </testResources> - </build> - </profile> - </profiles> -</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java deleted file mode 100644 index b262ce2..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/entity/Simple.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.entity; - -import java.util.Date; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -@Entity -@NamedQueries({ - @NamedQuery(name = Simple.BY_NAME_LIKE, - query = "select e from Simple e where e.name like ?1"), - @NamedQuery(name = Simple.BY_NAME_ENABLED, - query = "select s from Simple s where s.name = ?1 and s.enabled = ?2 order by s.id asc"), - @NamedQuery(name = Simple.BY_ID, - query = "select s from Simple s where s.id = :id and s.enabled = :enabled") -}) -@Table(name = "SIMPLE_TABLE") -public class Simple -{ - public static final String BY_NAME_LIKE = "simple.byNameLike"; - public static final String BY_NAME_ENABLED = "simple.byNameAndEnabled"; - public static final String BY_ID = "simple.byId"; - - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - private Long id; - - private String name; - private String camelCase; - private Boolean enabled = Boolean.TRUE; - private Integer counter = Integer.valueOf(0); - @Temporal(TemporalType.TIMESTAMP) - private Date temporal; - - protected Simple() - { - } - - public Simple(String name) - { - this.name = name; - } - - public Long getId() - { - return id; - } - - public void setId(Long id) - { - this.id = id; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public Boolean getEnabled() - { - return enabled; - } - - public void setEnabled(Boolean enabled) - { - this.enabled = enabled; - } - - public Integer getCounter() - { - return counter; - } - - public void setCounter(Integer counter) - { - this.counter = counter; - } - - public String getCamelCase() - { - return camelCase; - } - - public void setCamelCase(String camelCase) - { - this.camelCase = camelCase; - } - - public Date getTemporal() - { - return temporal; - } - - public void setTemporal(Date temporal) - { - this.temporal = temporal; - } - - @Override - public String toString() - { - return "Simple [id=" + id + ", name=" + name + ", camelCase=" + camelCase + ", enabled=" + enabled - + ", counter=" + counter + ", temporal=" + temporal + "]"; - } - -} - http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java deleted file mode 100644 index e2e61ef..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.repo; - -import org.apache.deltaspike.data.api.Repository; -import org.apache.deltaspike.data.test.java8.entity.Simple; - -import java.util.Optional; -import java.util.stream.Stream; - -@Repository(forEntity = Simple.class) -public interface SimpleRepository -{ - Stream<Simple> findByName(String name); - - Optional<Simple> findOptional(Long id); - - Stream<Simple> findAll(); - - Optional<Simple> findBy(Long id); -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java deleted file mode 100644 index 30b7f1c..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/repo/SimpleRepository2.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.repo; - -import org.apache.deltaspike.data.api.Query; -import org.apache.deltaspike.data.api.Repository; -import org.apache.deltaspike.data.api.SingleResultType; -import org.apache.deltaspike.data.test.java8.entity.Simple; - -import java.util.Optional; -import java.util.stream.Stream; - -@Repository(forEntity = Simple.class) -public interface SimpleRepository2 -{ - @Query(singleResult = SingleResultType.ANY) - Optional<Simple> findByName(String name); - - @Query(value = "select name from simple_table", isNative = true) - Stream<String> findSimpleNames(); -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java deleted file mode 100644 index 261556c..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/test/Java8Test.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.test; - -import org.apache.deltaspike.data.test.java8.entity.Simple; -import org.apache.deltaspike.data.test.java8.repo.SimpleRepository; -import org.apache.deltaspike.data.test.java8.repo.SimpleRepository2; -import org.apache.deltaspike.test.category.WebProfileCategory; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.Archive; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; - -import javax.annotation.Resource; -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.transaction.UserTransaction; - -import java.util.Optional; -import java.util.stream.Stream; - -import static java.util.Arrays.asList; -import java.util.Collections; -import java.util.List; -import static java.util.Collections.emptyList; -import static java.util.stream.Collectors.toList; -import static org.apache.deltaspike.data.test.java8.util.TestDeployments.initDeployment; - -@Category(WebProfileCategory.class) -@RunWith(Arquillian.class) -public class Java8Test -{ - @Deployment - public static Archive<?> deployment() - { - return initDeployment() - .addClasses(Java8Test.class, Simple.class, SimpleRepository.class, SimpleRepository2.class); - } - - @Inject - private SimpleRepository simpleRepository; - - @Inject - private SimpleRepository2 simpleRepository2; - - @PersistenceContext - private EntityManager entityManager; - - @Resource - private UserTransaction ut; - - @Before - public void setupTX() throws Exception - { - ut.begin(); - } - - @After - public void rollbackTX() throws Exception - { - ut.rollback(); - } - - @Test - public void shouldFindOptionalSimple() throws Exception - { - Simple s = new Simple("something"); - entityManager.persist(s); - - Optional<Simple> found = simpleRepository.findOptional(s.getId()); - - Assert.assertTrue(found.isPresent()); - } - - @Test - public void shouldNotFindOptionalSimpleForMissing() throws Exception - { - Optional<Simple> found = simpleRepository.findBy(-1L); - - Assert.assertFalse(found.isPresent()); - } - - @Test - public void shouldFindStreamOfSimples() - { - String name = "something"; - Simple s = new Simple(name); - entityManager.persist(s); - - Stream<Simple> found = simpleRepository.findByName(name); - - Assert.assertEquals(1, found.count()); - } - - @Test - public void shouldFindEmptyStream() - { - String name = "something"; - Simple s = new Simple(name); - entityManager.persist(s); - - Stream<Simple> found = simpleRepository.findByName("some other name"); - - Assert.assertEquals(emptyList(), found.collect(toList())); - } - - @Test - public void shouldFindAllAsStream() - { - String name = "something"; - Simple s = new Simple(name); - entityManager.persist(s); - - Stream<Simple> found = simpleRepository.findAll(); - - Assert.assertEquals(1, found.count()); - } - - @Test - public void shouldFindByNameOptional() - { - String name = "jim"; - entityManager.persist(new Simple(name)); - entityManager.persist(new Simple(name)); - - Optional<Simple> found = simpleRepository2.findByName(name); - - Assert.assertTrue(found.isPresent()); - } - - @Test - public void shouldFindNamesAsStream() - { - entityManager.persist(new Simple("a")); - entityManager.persist(new Simple("b")); - entityManager.flush(); - - Stream<String> names = simpleRepository2.findSimpleNames(); - final List<String> actualSorted = names.collect(toList()); - Collections.sort(actualSorted); - - Assert.assertEquals(asList("a","b"), actualSorted); - } -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java deleted file mode 100644 index dc0a2fe..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/EntityManagerProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.util; - -import javax.enterprise.inject.Produces; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; - -public class EntityManagerProducer { - @PersistenceContext - @Produces - private EntityManager entityManager; -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java b/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java deleted file mode 100644 index 24003ff..0000000 --- a/deltaspike/modules/data/test-java8/src/test/java/org/apache/deltaspike/data/test/java8/util/TestDeployments.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.deltaspike.data.test.java8.util; - -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.resolver.api.maven.Maven; - -import java.io.File; - -public class TestDeployments -{ - /** - * Create a basic deployment with dependencies, beans.xml and persistence descriptor. - * - * @return Basic web archive. - */ - public static WebArchive initDeployment() - { - WebArchive archive = ShrinkWrap - .create(WebArchive.class, "test.war") - .addAsLibraries(getDeltaSpikeDataWithDependencies()) - .addClasses(EntityManagerProducer.class) - .addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml") - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - - return archive; - } - - private static File[] getDeltaSpikeDataWithDependencies() - { - return Maven.resolver().loadPomFromFile("pom.xml").resolve( - "org.apache.deltaspike.core:deltaspike-core-api", - "org.apache.deltaspike.core:deltaspike-core-impl", - "org.apache.deltaspike.modules:deltaspike-partial-bean-module-api", - "org.apache.deltaspike.modules:deltaspike-partial-bean-module-impl", - "org.apache.deltaspike.modules:deltaspike-jpa-module-api", - "org.apache.deltaspike.modules:deltaspike-jpa-module-impl", - "org.apache.deltaspike.modules:deltaspike-data-module-api", - "org.apache.deltaspike.modules:deltaspike-data-module-impl") - .withTransitivity() - .asFile(); - } -} http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/resources-glassfish/test-persistence.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/resources-glassfish/test-persistence.xml b/deltaspike/modules/data/test-java8/src/test/resources-glassfish/test-persistence.xml deleted file mode 100644 index 64744d4..0000000 --- a/deltaspike/modules/data/test-java8/src/test/resources-glassfish/test-persistence.xml +++ /dev/null @@ -1,30 +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. - --> -<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> - <persistence-unit name="test"> - <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> - <jta-data-source>jdbc/__default</jta-data-source> - <properties> - <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> - <property name="eclipselink.logging.level" value="FINE"/> - <property name="eclipselink.logging.parameters" value="true" /> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/resources-openejb/test-persistence.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/resources-openejb/test-persistence.xml b/deltaspike/modules/data/test-java8/src/test/resources-openejb/test-persistence.xml deleted file mode 100644 index 828e4a3..0000000 --- a/deltaspike/modules/data/test-java8/src/test/resources-openejb/test-persistence.xml +++ /dev/null @@ -1,31 +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. - --> -<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> - <persistence-unit name="test"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <jta-data-source>testDatabase</jta-data-source> - <properties> - <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/> - <property name="openjpa.Log" value="DefaultLevel=WARN, SQL=TRACE"/> - <property name="openjpa.jdbc.DBDictionary" value="hsql(SimulateLocking=true)"/> - <property name="openejb.jpa.init-entitymanager" value="true" /> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/resources-weblogic/test-persistence.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/resources-weblogic/test-persistence.xml b/deltaspike/modules/data/test-java8/src/test/resources-weblogic/test-persistence.xml deleted file mode 100644 index 26fd8bf..0000000 --- a/deltaspike/modules/data/test-java8/src/test/resources-weblogic/test-persistence.xml +++ /dev/null @@ -1,31 +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. - --> -<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"> - <persistence-unit name="test"> - <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> - <jta-data-source>TestDS</jta-data-source> - <properties> - <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> - <property name="eclipselink.logging.level" value="FINE"/> - <property name="eclipselink.logging.parameters" value="true" /> - <property name="eclipselink.deploy-on-startup" value="true" /> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/modules/data/test-java8/src/test/resources-wildfly/test-persistence.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/test-java8/src/test/resources-wildfly/test-persistence.xml b/deltaspike/modules/data/test-java8/src/test/resources-wildfly/test-persistence.xml deleted file mode 100644 index 170def0..0000000 --- a/deltaspike/modules/data/test-java8/src/test/resources-wildfly/test-persistence.xml +++ /dev/null @@ -1,28 +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. - --> -<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> - <persistence-unit name="test"> - <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source> - <properties> - <property name="hibernate.hbm2ddl.auto" value="create-drop"/> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/2cc5eeb0/deltaspike/parent/code/pom.xml ---------------------------------------------------------------------- diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml index eb33c83..e997583 100644 --- a/deltaspike/parent/code/pom.xml +++ b/deltaspike/parent/code/pom.xml @@ -37,7 +37,7 @@ <properties> <container.unpack.directory>${java.io.tmpdir}/deltaspike-arquillian-containers</container.unpack.directory> <jboss.as.version>7.1.1.Final</jboss.as.version> - <wildfly.version>9.0.2.Final</wildfly.version> + <wildfly.version>10.0.1.Final</wildfly.version> <wildfly.arquillian.version>1.0.2.Final</wildfly.arquillian.version> <glassfish3.version>3.1.2.2</glassfish3.version> <glassfish4.version>4.0</glassfish4.version>