diff --git a/impl/core/src/test/java/template/TemplateTest.java b/impl/core/src/test/java/template/TemplateTest.java
new file mode 100644
index 0000000..8598c35
--- /dev/null
+++ b/impl/core/src/test/java/template/TemplateTest.java
@@ -0,0 +1,156 @@
+/*
+ * Demoiselle Framework
+ * Copyright (C) 2010 SERPRO
+ * ----------------------------------------------------------------------------
+ * This file is part of Demoiselle Framework.
+ *
+ * Demoiselle Framework is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License version 3
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License version 3
+ * along with this program; if not, see
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301, USA.
+ * ----------------------------------------------------------------------------
+ * Este arquivo é parte do Framework Demoiselle.
+ *
+ * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
+ * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
+ * do Software Livre (FSF).
+ *
+ * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
+ * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
+ * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
+ * para maiores detalhes.
+ *
+ * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
+ * "LICENCA.txt", junto com esse programa. Se não, acesse
+ * ou escreva para a Fundação do Software Livre (FSF) Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+package template;
+
+import static junit.framework.Assert.*;
+
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import template.business.TemplateBC;
+import template.crud.CrudImpl;
+import template.model.DummyEntity;
+import test.Tests;
+import br.gov.frameworkdemoiselle.internal.context.ContextManager;
+import br.gov.frameworkdemoiselle.internal.context.ManagedContext;
+
+@RunWith(Arquillian.class)
+public class TemplateTest {
+
+ private static final String DUMMY_NAME = "Dummy De Meu Deus";
+ private static final Long INSERT_ID = 15L;
+ private static final Long VALID_ID = 1L;
+
+ @Inject
+ private TemplateBC templateBC;
+
+ @Inject
+ private CrudImpl crudImpl;
+
+ @Deployment
+ public static JavaArchive createDeployment() {
+
+ JavaArchive deployment = Tests.createDeployment(TemplateTest.class);
+
+ return deployment;
+
+ }
+
+ @Before
+ public void initialize() {
+
+ ContextManager.activate(ManagedContext.class, RequestScoped.class);
+
+ this.crudImpl.resetEntities();
+
+ }
+
+ @After
+ public void finalize() {
+
+ ContextManager.deactivate(ManagedContext.class, RequestScoped.class);
+
+ }
+
+ @Test
+ public void testInsert() {
+
+ assertNull(this.crudImpl.load(INSERT_ID));
+
+ this.templateBC.insert(new DummyEntity(INSERT_ID, DUMMY_NAME));
+
+ assertNotNull(this.crudImpl.load(INSERT_ID));
+
+ }
+
+ @Test
+ public void testRemove() {
+
+ assertNotNull(this.crudImpl.load(VALID_ID));
+
+ this.templateBC.delete(VALID_ID);
+
+ assertNull(this.crudImpl.load(VALID_ID));
+
+ }
+
+ @Test
+ public void testFindAll() {
+
+ List listImpl = this.crudImpl.findAll();
+ List listDelegate = this.templateBC.findAll();
+
+ assertEquals(listImpl, listDelegate);
+
+ }
+
+ @Test
+ public void testLoad() {
+
+ DummyEntity dummyEntityImpl = this.crudImpl.load(VALID_ID);
+ DummyEntity dummyEntityDelegate = this.templateBC.load(VALID_ID);
+
+ assertEquals(dummyEntityImpl, dummyEntityDelegate);
+
+ }
+
+ @Test
+ public void testUpdate() {
+
+ DummyEntity dummyEntity = this.crudImpl.load(VALID_ID);
+
+ assertFalse(DUMMY_NAME.equals(dummyEntity.getName()));
+
+ dummyEntity.setName(DUMMY_NAME);
+
+ this.templateBC.update(dummyEntity);
+
+ assertEquals(this.crudImpl.load(VALID_ID).getName(), DUMMY_NAME);
+
+ }
+
+}
diff --git a/impl/core/src/test/java/template/business/TemplateBC.java b/impl/core/src/test/java/template/business/TemplateBC.java
new file mode 100644
index 0000000..4e4db26
--- /dev/null
+++ b/impl/core/src/test/java/template/business/TemplateBC.java
@@ -0,0 +1,11 @@
+package template.business;
+
+import template.crud.CrudImpl;
+import template.model.DummyEntity;
+import br.gov.frameworkdemoiselle.stereotype.BusinessController;
+import br.gov.frameworkdemoiselle.template.DelegateCrud;
+
+@BusinessController
+public class TemplateBC extends DelegateCrud{
+
+}
diff --git a/impl/core/src/test/java/template/crud/CrudImpl.java b/impl/core/src/test/java/template/crud/CrudImpl.java
new file mode 100644
index 0000000..26ea747
--- /dev/null
+++ b/impl/core/src/test/java/template/crud/CrudImpl.java
@@ -0,0 +1,131 @@
+/*
+ * Demoiselle Framework
+ * Copyright (C) 2010 SERPRO
+ * ----------------------------------------------------------------------------
+ * This file is part of Demoiselle Framework.
+ *
+ * Demoiselle Framework is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License version 3
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License version 3
+ * along with this program; if not, see
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301, USA.
+ * ----------------------------------------------------------------------------
+ * Este arquivo é parte do Framework Demoiselle.
+ *
+ * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
+ * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
+ * do Software Livre (FSF).
+ *
+ * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
+ * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
+ * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
+ * para maiores detalhes.
+ *
+ * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
+ * "LICENCA.txt", junto com esse programa. Se não, acesse
+ * ou escreva para a Fundação do Software Livre (FSF) Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+package template.crud;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+
+import template.model.DummyEntity;
+import br.gov.frameworkdemoiselle.DemoiselleException;
+import br.gov.frameworkdemoiselle.template.Crud;
+
+@RequestScoped
+public class CrudImpl implements Crud {
+
+ private List entities;
+
+ public CrudImpl() {
+
+ super();
+
+ this.entities = new ArrayList();
+
+ }
+
+ public void resetEntities() {
+
+ this.entities.clear();
+
+ this.entities.add(new DummyEntity(1L, "Dummy1 Label 1"));
+ this.entities.add(new DummyEntity(2L, "Dummy1 Label 2"));
+ this.entities.add(new DummyEntity(3L, "Dummy1 Label 3"));
+ this.entities.add(new DummyEntity(4L, "Dummy1 Label 4"));
+ this.entities.add(new DummyEntity(5L, "Dummy1 Label 5"));
+ this.entities.add(new DummyEntity(6L, "Dummy1 Label 6"));
+ this.entities.add(new DummyEntity(7L, "Dummy1 Label 7"));
+ this.entities.add(new DummyEntity(8L, "Dummy1 Label 8"));
+ this.entities.add(new DummyEntity(9L, "Dummy1 Label 9"));
+ this.entities.add(new DummyEntity(10L, "Dummy1 Label 10"));
+
+ }
+
+ @Override
+ public void delete(Long id) {
+
+ this.entities.remove(this.load(id));
+
+ }
+
+ @Override
+ public List findAll() {
+
+ return this.entities;
+
+ }
+
+ @Override
+ public DummyEntity insert(DummyEntity bean) {
+
+ if (this.entities.add(bean)) {
+ return bean;
+ } else {
+ throw new DemoiselleException("Erro ao inserir entity");
+ }
+
+ }
+
+ @Override
+ public DummyEntity load(Long id) {
+
+ for (DummyEntity dummyEntity : this.entities) {
+
+ if (dummyEntity.getId().equals(id)) {
+
+ return dummyEntity;
+
+ }
+
+ }
+
+ return null;
+
+ }
+
+ @Override
+ public DummyEntity update(DummyEntity bean) {
+
+ DummyEntity dummyEntity = this.load(bean.getId());
+
+ dummyEntity.setName(bean.getName());
+
+ return dummyEntity;
+
+ }
+
+}
diff --git a/impl/core/src/test/java/template/model/DummyEntity.java b/impl/core/src/test/java/template/model/DummyEntity.java
new file mode 100644
index 0000000..f31db41
--- /dev/null
+++ b/impl/core/src/test/java/template/model/DummyEntity.java
@@ -0,0 +1,100 @@
+/*
+ * Demoiselle Framework
+ * Copyright (C) 2010 SERPRO
+ * ----------------------------------------------------------------------------
+ * This file is part of Demoiselle Framework.
+ *
+ * Demoiselle Framework is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License version 3
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License version 3
+ * along with this program; if not, see
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301, USA.
+ * ----------------------------------------------------------------------------
+ * Este arquivo é parte do Framework Demoiselle.
+ *
+ * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
+ * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
+ * do Software Livre (FSF).
+ *
+ * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
+ * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
+ * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
+ * para maiores detalhes.
+ *
+ * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
+ * "LICENCA.txt", junto com esse programa. Se não, acesse
+ * ou escreva para a Fundação do Software Livre (FSF) Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+package template.model;
+
+public class DummyEntity {
+
+ private Long id;
+ private String name;
+
+ public DummyEntity(Long id, String name) {
+
+ super();
+
+ this.id = id;
+ this.name = name;
+
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DummyEntity other = (DummyEntity) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
--
libgit2 0.21.2