deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwellm...@apache.org
Subject [1/2] deltaspike git commit: DELTASPIKE-965 failing test demonstrating the problem
Date Mon, 27 Jul 2015 19:19:18 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master daa5eb69e -> b11d8174b


DELTASPIKE-965 failing test demonstrating the problem

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/e56035aa
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/e56035aa
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/e56035aa

Branch: refs/heads/master
Commit: e56035aa82babce38ec092a73e45a33488f681e5
Parents: daa5eb6
Author: Harald Wellmann <harald.wellmann@gmx.de>
Authored: Mon Jul 27 18:04:07 2015 +0200
Committer: Harald Wellmann <harald.wellmann@gmx.de>
Committed: Mon Jul 27 18:04:07 2015 +0200

----------------------------------------------------------------------
 .../handler/EntityRepositoryHandlerTest.java    | 21 +++++++++++++++
 .../test/service/SimpleStringIdRepository.java  | 28 ++++++++++++++++++++
 2 files changed, 49 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e56035aa/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
index df46d29..8e522d0 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/EntityRepositoryHandlerTest.java
@@ -21,11 +21,13 @@ package org.apache.deltaspike.data.impl.handler;
 import org.apache.deltaspike.data.test.TransactionalTestCase;
 import org.apache.deltaspike.data.test.domain.Simple;
 import org.apache.deltaspike.data.test.domain.Simple2;
+import org.apache.deltaspike.data.test.domain.SimpleStringId;
 import org.apache.deltaspike.data.test.domain.Simple_;
 import org.apache.deltaspike.data.test.service.ExtendedRepositoryAbstract;
 import org.apache.deltaspike.data.test.service.ExtendedRepositoryAbstract2;
 import org.apache.deltaspike.data.test.service.ExtendedRepositoryAbstract4;
 import org.apache.deltaspike.data.test.service.ExtendedRepositoryInterface;
+import org.apache.deltaspike.data.test.service.SimpleStringIdRepository;
 import org.apache.deltaspike.test.category.WebProfileCategory;
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.shrinkwrap.api.Archive;
@@ -37,6 +39,7 @@ import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 import javax.persistence.metamodel.SingularAttribute;
+
 import java.util.List;
 
 import static org.apache.deltaspike.data.test.util.TestDeployments.initDeployment;
@@ -57,6 +60,7 @@ public class EntityRepositoryHandlerTest extends TransactionalTestCase
                 .addClasses(ExtendedRepositoryAbstract.class)
                 .addClasses(ExtendedRepositoryAbstract2.class)
                 .addClasses(ExtendedRepositoryAbstract4.class)
+                .addClasses(SimpleStringIdRepository.class)
                 .addPackage(Simple.class.getPackage());
     }
 
@@ -72,6 +76,9 @@ public class EntityRepositoryHandlerTest extends TransactionalTestCase
     @Inject
     private ExtendedRepositoryAbstract4 repoAbstract4;
 
+    @Inject
+    private SimpleStringIdRepository stringIdRepo;
+
     @Produces
     @PersistenceContext
     private EntityManager entityManager;
@@ -124,6 +131,20 @@ public class EntityRepositoryHandlerTest extends TransactionalTestCase
     }
 
     @Test
+    public void should_save_with_string_id()
+    {
+        // given
+        SimpleStringId foo = new SimpleStringId("foo", "bar");
+
+        // when
+        foo = stringIdRepo.save(foo);
+
+        // then
+        assertNotNull(foo);
+    }
+
+
+    @Test
     public void should_refresh() throws Exception
     {
         // given

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e56035aa/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/SimpleStringIdRepository.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/SimpleStringIdRepository.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/SimpleStringIdRepository.java
new file mode 100644
index 0000000..63de9cd
--- /dev/null
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/service/SimpleStringIdRepository.java
@@ -0,0 +1,28 @@
+/*
+ * 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.service;
+
+import org.apache.deltaspike.data.api.EntityRepository;
+import org.apache.deltaspike.data.api.Repository;
+import org.apache.deltaspike.data.test.domain.SimpleStringId;
+
+@Repository
+public interface SimpleStringIdRepository extends EntityRepository<SimpleStringId, String>
+{
+}


Mime
View raw message