Skip to content

Commit

Permalink
Merge pull request #1232 from apache/WW-5532-upg-deps
Browse files Browse the repository at this point in the history
WW-5532 Upgrade and align various dependencies
  • Loading branch information
kusalk authored Feb 25, 2025
2 parents 84cf666 + 077e985 commit 15ee2ac
Show file tree
Hide file tree
Showing 15 changed files with 197 additions and 358 deletions.
1 change: 0 additions & 1 deletion apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.platformVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ public void private_MyDtoField_WithGetter_MethodAnnotatedDepthOne() throws Excep
}

private void assertText(Map<String, String> params, String text) throws IOException {
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(ParameterUtils.getBaseUrl()).path("/paramsannotation/test.action");
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(ParameterUtils.getBaseUrl())
.path("/paramsannotation/test.action");
params.forEach(builder::queryParam);
String url = builder.toUriString();
HtmlPage page = webClient.getPage(url);
Expand Down
1 change: 1 addition & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>

Expand Down
15 changes: 4 additions & 11 deletions plugins/bean-validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@
</properties>

<dependencies>

<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.0</version>
</dependency>

<dependency>
Expand All @@ -55,29 +53,24 @@
<artifactId>jakarta.el</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<scope>test</scope>
</dependency>

Expand Down
21 changes: 11 additions & 10 deletions plugins/cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<packaging>jar</packaging>

<dependencies>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
Expand All @@ -43,29 +42,31 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-impl</artifactId>
<scope>provided</scope>
<version>${weld.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>${weld.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<!-- org.springframework.mock.jndi.SimpleNamingContextBuilder removed from newer version -->
<version>4.3.0.RELEASE</version>
<groupId>com.github.h-thurow</groupId>
<artifactId>simple-jndi</artifactId>
<version>0.25.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,43 @@
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.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.mock.jndi.SimpleNamingContextBuilder;

import jakarta.enterprise.inject.spi.InjectionTarget;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

public class CdiObjectFactoryTest {

private static final String SHARED_JNDI = "org.osjava.sj.jndi.shared";
private static InitialContext context;
private static WeldContainer container;

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

System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.osjava.sj.SimpleContextFactory");
System.setProperty(SHARED_JNDI, "true");
context = new InitialContext();
context.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, container.getBeanManager());
}

@AfterClass
public static void tearDown() throws NamingException {
container.shutdown();

SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
builder.activate();
builder.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, container.getBeanManager());
context.unbind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP);
context.close();
System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
System.clearProperty(SHARED_JNDI);
}

@Test
Expand All @@ -50,16 +67,16 @@ public void testFindBeanManager() {

@Test
public void testGetBean() throws Exception {
final CdiObjectFactory cdiObjectFactory = new CdiObjectFactory();
FooConsumer fooConsumer = (FooConsumer) cdiObjectFactory.buildBean(FooConsumer.class.getCanonicalName(), null, false);
var cdiObjectFactory = new CdiObjectFactory();
var fooConsumer = (FooConsumer) cdiObjectFactory.buildBean(FooConsumer.class.getCanonicalName(), null, false);
assertNotNull(fooConsumer);
assertNotNull(fooConsumer.fooService);
}

@Test
public void testGetInjectionTarget() {
final CdiObjectFactory cdiObjectFactory = new CdiObjectFactory();
final InjectionTarget<?> injectionTarget = cdiObjectFactory.getInjectionTarget(FooConsumer.class);
var cdiObjectFactory = new CdiObjectFactory();
InjectionTarget<?> injectionTarget = cdiObjectFactory.getInjectionTarget(FooConsumer.class);
assertNotNull(injectionTarget);
assertTrue(cdiObjectFactory.injectionTargetCache.containsKey(FooConsumer.class));
assertSame(cdiObjectFactory.getInjectionTarget(FooConsumer.class), injectionTarget);
Expand Down
4 changes: 2 additions & 2 deletions plugins/jfreechart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit 15ee2ac

Please sign in to comment.