From a8cc4783bfcd2629d57bca3b97f773a1289eb1d8 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 18 Sep 2017 15:05:47 +0200 Subject: [PATCH] DATACMNS-1159 - Upgrade to OpenWebBeans 2.0.1. --- pom.xml | 12 ++++---- ...itoryExtensionSupportIntegrationTests.java | 30 +++++++++++-------- src/test/resources/META-INF/beans.xml | 6 ---- 3 files changed, 23 insertions(+), 25 deletions(-) delete mode 100644 src/test/resources/META-INF/beans.xml diff --git a/pom.xml b/pom.xml index b9d6ccfd8..7d6ac2c6a 100644 --- a/pom.xml +++ b/pom.xml @@ -72,8 +72,8 @@ javax.annotation - jsr250-api - 1.0 + javax.annotation-api + ${javax-annotation-api} true @@ -157,7 +157,7 @@ javax.enterprise cdi-api - ${cdi} + 2.0 provided true @@ -185,13 +185,13 @@ javax.el el-api - ${cdi} + 1.0 test - org.apache.openwebbeans.test - cditest-owb + org.apache.openwebbeans + openwebbeans-se ${webbeans} test diff --git a/src/test/java/org/springframework/data/repository/cdi/WebbeansCdiRepositoryExtensionSupportIntegrationTests.java b/src/test/java/org/springframework/data/repository/cdi/WebbeansCdiRepositoryExtensionSupportIntegrationTests.java index 4bf8596c1..9e3b3f85f 100755 --- a/src/test/java/org/springframework/data/repository/cdi/WebbeansCdiRepositoryExtensionSupportIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/cdi/WebbeansCdiRepositoryExtensionSupportIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,35 +15,39 @@ */ package org.springframework.data.repository.cdi; -import org.apache.webbeans.cditest.CdiTestContainer; -import org.apache.webbeans.cditest.CdiTestContainerLoader; +import javax.enterprise.inject.se.SeContainer; +import javax.enterprise.inject.se.SeContainerInitializer; + import org.junit.AfterClass; import org.junit.BeforeClass; /** * CDI extension integration test using OpenWebbeans. - * + * * @author Oliver Gierke + * @author Mark Paluch */ -public class WebbeansCdiRepositoryExtensionSupportIntegrationTests extends - CdiRepositoryExtensionSupportIntegrationTests { +public class WebbeansCdiRepositoryExtensionSupportIntegrationTests + extends CdiRepositoryExtensionSupportIntegrationTests { - static CdiTestContainer container; + private static SeContainer container; @BeforeClass - public static void setUp() throws Exception { + public static void setUp() { - container = CdiTestContainerLoader.getCdiContainer(); - container.bootContainer(); + container = SeContainerInitializer.newInstance() // + .disableDiscovery() // + .addPackages(SampleRepository.class) // + .initialize(); } @Override protected T getBean(Class type) { - return container.getInstance(type); + return container.select(type).get(); } @AfterClass - public static void tearDown() throws Exception { - container.shutdownContainer(); + public static void tearDown() { + container.close(); } } diff --git a/src/test/resources/META-INF/beans.xml b/src/test/resources/META-INF/beans.xml deleted file mode 100644 index 73ae3a251..000000000 --- a/src/test/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - -