Skip to content

Commit

Permalink
Merge pull request apache#597 from apache/WW-5226-weld
Browse files Browse the repository at this point in the history
[WW-5226] Upgrade weld-core to version 2.4.8.Final
  • Loading branch information
lukaszlenart authored Sep 20, 2022
2 parents f04b68d + 7b65520 commit b9cd7d8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions assembly/src/main/assembly/min-lib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<include>org.apache.struts:struts2-core</include>
<include>org.freemarker:freemarker</include>
<include>org.apache.commons:commons-lang3</include>
<include>org.apache.commons:commons-text</include>
<include>org.apache.logging.log4j:log4j-api</include>
<include>ognl:ognl</include>
<include>commons-fileupload:commons-fileupload</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@
*/
package org.apache.struts2.cdi;

import org.jboss.weld.environment.se.StartMain;
import static org.junit.Assert.*;

import org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider;
import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.mock.jndi.SimpleNamingContextBuilder;

import javax.enterprise.inject.spi.InjectionTarget;

/**
* CdiObjectFactoryTest.
*/
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

public class CdiObjectFactoryTest {

@Before
public void setUp() throws Exception {
@BeforeClass
public static void setup() throws Exception {
Weld weld = new Weld().containerId(RegistrySingletonProvider.STATIC_INSTANCE);
WeldContainer container = weld.initialize();

SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
builder.activate();

StartMain sm = new StartMain(new String[0]);
WeldContainer weldContainer = sm.go();
builder.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, weldContainer.getBeanManager());
builder.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, container.getBeanManager());
}

@Test
public void testFindBeanManager() throws Exception {
public void testFindBeanManager() {
assertNotNull(new CdiObjectFactory().findBeanManager());
}

Expand All @@ -56,7 +56,8 @@ public void testGetBean() throws Exception {
assertNotNull(fooConsumer.fooService);
}

@Test public void testGetInjectionTarget() throws Exception {
@Test
public void testGetInjectionTarget() {
final CdiObjectFactory cdiObjectFactory = new CdiObjectFactory();
final InjectionTarget<?> injectionTarget = cdiObjectFactory.getInjectionTarget(FooConsumer.class);
assertNotNull(injectionTarget);
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,13 +1202,13 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.2.16.SP1</version>
<version>2.4.8.Final</version>
</dependency>

<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>2.2.16.SP1</version>
<version>2.4.8.Final</version>
</dependency>

<dependency>
Expand Down

0 comments on commit b9cd7d8

Please sign in to comment.