Author: pete.muir(a)jboss.org
Date: 2010-01-22 11:34:32 -0500 (Fri, 22 Jan 2010)
New Revision: 5584
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextDesctructionTest.java
Log:
port WELD-341 to trunk
Deleted:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextDesctructionTest.java
===================================================================
---
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextDesctructionTest.java 2010-01-22
16:33:13 UTC (rev 5583)
+++
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextDesctructionTest.java 2010-01-22
16:34:32 UTC (rev 5584)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.persistence.EntityManager;
-
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- * Injection of persistence related objects.
- *
- * @author David Allen
- */
-@Artifact
-(a)Packaging(PackagingType.WAR)
-@IntegrationTest
-@Resource(source = "persistence.xml", destination =
"WEB-INF/classes/META-INF/persistence.xml")
-//(a)PersistenceXml("persistence.xml")
-(a)BeansXml("beans.xml")
-@SpecVersion(spec="cdi", version="20091101")
-public class PersistenceContextDesctructionTest extends AbstractJSR299Test
-{
-
- @Test(groups = { "beanLifecycle", "commonAnnotations",
"integration" })
- @SpecAssertions( {
- @SpecAssertion(section="7.3.6", id = "nb")
- })
- public void testDestructionOfPersistenceContext() throws Exception
- {
- Bean<ManagedBean> managedBean =
getBeans(ManagedBean.class).iterator().next();
- CreationalContext<ManagedBean> creationalContext =
getCurrentManager().createCreationalContext(managedBean);
- ManagedBean instance = managedBean.create(creationalContext);
- EntityManager em = instance.getPersistenceContext();
- assert em.isOpen();
- managedBean.destroy(instance, creationalContext);
- assert !em.isOpen();
- }
-
-}