Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2012 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2720713 to your computer and use it in GitHub Desktop.
Save anonymous/2720713 to your computer and use it in GitHub Desktop.
WeldTest
/*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
package org.infinispan.cdi.test;
import org.infinispan.Cache;
import org.infinispan.test.TestingUtil;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import org.testng.annotations.Test;
import javax.inject.Inject;
/**
* Tests against Weld 1.0 using Weld-SE
*
* @author Manik Surtani
* @since 5.1
*/
@Test(groups = "functional", testName = "cdi.test.WeldTest")
public class WeldTest {
@Inject
Cache<String, String> cache;
public void testWithWeldSE() {
try {
WeldContainer weld = new Weld().initialize();
WeldTest component = weld.instance().select(WeldTest.class).get();
assert cache != null;
} finally {
if (cache != null) TestingUtil.killCaches(cache);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment