Skip to content

Commit 077e985

Browse files
committed
WW-5532 Upgrade and align various dependencies
1 parent 5c22c0d commit 077e985

File tree

15 files changed

+197
-358
lines changed

15 files changed

+197
-358
lines changed

apps/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
<dependency>
100100
<groupId>org.springframework</groupId>
101101
<artifactId>spring-test</artifactId>
102-
<version>${spring.platformVersion}</version>
103102
<scope>test</scope>
104103
</dependency>
105104
</dependencies>

apps/showcase/src/test/java/it/org/apache/struts2/showcase/StrutsParametersTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ public void private_MyDtoField_WithGetter_MethodAnnotatedDepthOne() throws Excep
229229
}
230230

231231
private void assertText(Map<String, String> params, String text) throws IOException {
232-
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(ParameterUtils.getBaseUrl()).path("/paramsannotation/test.action");
232+
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(ParameterUtils.getBaseUrl())
233+
.path("/paramsannotation/test.action");
233234
params.forEach(builder::queryParam);
234235
String url = builder.toUriString();
235236
HtmlPage page = webClient.getPage(url);

core/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@
229229
<dependency>
230230
<groupId>junit</groupId>
231231
<artifactId>junit</artifactId>
232+
<scope>compile</scope>
232233
<optional>true</optional>
233234
</dependency>
234235

plugins/bean-validation/pom.xml

+4-11
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@
3737
</properties>
3838

3939
<dependencies>
40-
4140
<dependency>
4241
<groupId>jakarta.validation</groupId>
4342
<artifactId>jakarta.validation-api</artifactId>
44-
<version>3.1.0</version>
4543
</dependency>
4644

4745
<dependency>
@@ -55,29 +53,24 @@
5553
<artifactId>jakarta.el</artifactId>
5654
<scope>test</scope>
5755
</dependency>
58-
5956
<dependency>
60-
<groupId>javax.xml.bind</groupId>
61-
<artifactId>jaxb-api</artifactId>
62-
<version>2.3.1</version>
57+
<groupId>jakarta.xml.bind</groupId>
58+
<artifactId>jakarta.xml.bind-api</artifactId>
6359
<scope>test</scope>
6460
</dependency>
6561
<dependency>
6662
<groupId>com.sun.xml.bind</groupId>
6763
<artifactId>jaxb-core</artifactId>
68-
<version>2.3.0.1</version>
6964
<scope>test</scope>
7065
</dependency>
7166
<dependency>
7267
<groupId>com.sun.xml.bind</groupId>
7368
<artifactId>jaxb-impl</artifactId>
74-
<version>2.3.3</version>
7569
<scope>test</scope>
7670
</dependency>
7771
<dependency>
78-
<groupId>javax.activation</groupId>
79-
<artifactId>activation</artifactId>
80-
<version>1.1.1</version>
72+
<groupId>jakarta.activation</groupId>
73+
<artifactId>jakarta.activation-api</artifactId>
8174
<scope>test</scope>
8275
</dependency>
8376

plugins/cdi/pom.xml

+11-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<packaging>jar</packaging>
3434

3535
<dependencies>
36-
3736
<dependency>
3837
<groupId>jakarta.enterprise</groupId>
3938
<artifactId>jakarta.enterprise.cdi-api</artifactId>
@@ -43,29 +42,31 @@
4342
<dependency>
4443
<groupId>org.jboss.weld</groupId>
4544
<artifactId>weld-core-impl</artifactId>
46-
<scope>provided</scope>
45+
<version>${weld.version}</version>
46+
<scope>test</scope>
4747
</dependency>
48-
4948
<dependency>
5049
<groupId>org.jboss.weld.se</groupId>
5150
<artifactId>weld-se-core</artifactId>
51+
<version>${weld.version}</version>
5252
<scope>test</scope>
5353
</dependency>
54-
5554
<dependency>
56-
<groupId>org.springframework</groupId>
57-
<artifactId>spring-test</artifactId>
58-
<!-- org.springframework.mock.jndi.SimpleNamingContextBuilder removed from newer version -->
59-
<version>4.3.0.RELEASE</version>
55+
<groupId>com.github.h-thurow</groupId>
56+
<artifactId>simple-jndi</artifactId>
57+
<version>0.25.0</version>
6058
<scope>test</scope>
6159
</dependency>
62-
6360
<dependency>
6461
<groupId>commons-logging</groupId>
6562
<artifactId>commons-logging</artifactId>
6663
<scope>test</scope>
6764
</dependency>
68-
65+
<dependency>
66+
<groupId>jakarta.inject</groupId>
67+
<artifactId>jakarta.inject-api</artifactId>
68+
<scope>test</scope>
69+
</dependency>
6970
</dependencies>
7071

7172
<properties>

plugins/cdi/src/test/java/org/apache/struts2/cdi/CdiObjectFactoryTest.java

+27-10
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,43 @@
2121
import org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider;
2222
import org.jboss.weld.environment.se.Weld;
2323
import org.jboss.weld.environment.se.WeldContainer;
24+
import org.junit.AfterClass;
2425
import org.junit.BeforeClass;
2526
import org.junit.Test;
26-
import org.springframework.mock.jndi.SimpleNamingContextBuilder;
2727

2828
import jakarta.enterprise.inject.spi.InjectionTarget;
29+
import javax.naming.Context;
30+
import javax.naming.InitialContext;
31+
import javax.naming.NamingException;
2932

3033
import static org.junit.Assert.assertNotNull;
3134
import static org.junit.Assert.assertSame;
3235
import static org.junit.Assert.assertTrue;
3336

3437
public class CdiObjectFactoryTest {
3538

39+
private static final String SHARED_JNDI = "org.osjava.sj.jndi.shared";
40+
private static InitialContext context;
41+
private static WeldContainer container;
42+
3643
@BeforeClass
3744
public static void setup() throws Exception {
38-
Weld weld = new Weld().containerId(RegistrySingletonProvider.STATIC_INSTANCE);
39-
WeldContainer container = weld.initialize();
45+
container = new Weld().containerId(RegistrySingletonProvider.STATIC_INSTANCE).initialize();
46+
47+
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.osjava.sj.SimpleContextFactory");
48+
System.setProperty(SHARED_JNDI, "true");
49+
context = new InitialContext();
50+
context.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, container.getBeanManager());
51+
}
52+
53+
@AfterClass
54+
public static void tearDown() throws NamingException {
55+
container.shutdown();
4056

41-
SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
42-
builder.activate();
43-
builder.bind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP, container.getBeanManager());
57+
context.unbind(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP);
58+
context.close();
59+
System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
60+
System.clearProperty(SHARED_JNDI);
4461
}
4562

4663
@Test
@@ -50,16 +67,16 @@ public void testFindBeanManager() {
5067

5168
@Test
5269
public void testGetBean() throws Exception {
53-
final CdiObjectFactory cdiObjectFactory = new CdiObjectFactory();
54-
FooConsumer fooConsumer = (FooConsumer) cdiObjectFactory.buildBean(FooConsumer.class.getCanonicalName(), null, false);
70+
var cdiObjectFactory = new CdiObjectFactory();
71+
var fooConsumer = (FooConsumer) cdiObjectFactory.buildBean(FooConsumer.class.getCanonicalName(), null, false);
5572
assertNotNull(fooConsumer);
5673
assertNotNull(fooConsumer.fooService);
5774
}
5875

5976
@Test
6077
public void testGetInjectionTarget() {
61-
final CdiObjectFactory cdiObjectFactory = new CdiObjectFactory();
62-
final InjectionTarget<?> injectionTarget = cdiObjectFactory.getInjectionTarget(FooConsumer.class);
78+
var cdiObjectFactory = new CdiObjectFactory();
79+
InjectionTarget<?> injectionTarget = cdiObjectFactory.getInjectionTarget(FooConsumer.class);
6380
assertNotNull(injectionTarget);
6481
assertTrue(cdiObjectFactory.injectionTargetCache.containsKey(FooConsumer.class));
6582
assertSame(cdiObjectFactory.getInjectionTarget(FooConsumer.class), injectionTarget);

plugins/jfreechart/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
<scope>test</scope>
6363
</dependency>
6464
<dependency>
65-
<groupId>org.easymock</groupId>
66-
<artifactId>easymock</artifactId>
65+
<groupId>org.springframework</groupId>
66+
<artifactId>spring-web</artifactId>
6767
<scope>test</scope>
6868
</dependency>
6969
</dependencies>

0 commit comments

Comments
 (0)