Skip to content

Commit

Permalink
[MAINTENANCE] Refactor tests in BMP
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/aries/trunk@1810273 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
alien11689 committed Oct 1, 2017
1 parent c5e9167 commit cf62c10
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public void testProducesWithConfigProperty() throws Exception {
@Test
public void testConfigPropertiesInjection() throws Exception {
Node bean = getBeanById("beanWithConfigurationProperties");
assertXpathEquals(bean, "@class", "org.apache.aries.blueprint.plugin.test.BeanWithConfigurationProperties");
assertXpathEquals(bean, "@class", "org.apache.aries.blueprint.plugin.test.configuration.BeanWithConfigurationProperties");
assertXpathEquals(bean, "argument[1]/@ref", "testProps5");
assertXpathEquals(bean, "argument[2]/@ref", "properties-aries-test6-false");
assertXpathEquals(bean, "property[@name='prop1']/@ref", "properties-aries-test1-true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.aries.blueprint.plugin.bad.BadFieldBean2;
import org.apache.aries.blueprint.plugin.bad.BadFieldBean3;
import org.apache.aries.blueprint.plugin.bad.FieldBean4;
import org.apache.aries.blueprint.plugin.test.BeanWithConfig;
import org.apache.aries.blueprint.plugin.test.configuration.BeanWithConfig;
import org.apache.aries.blueprint.plugin.test.MyBean1;
import org.apache.aries.blueprint.plugin.test.MyBean3;
import org.apache.aries.blueprint.plugin.test.MyBean4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@
@DependsOn("myBean6")
public class MyBean5 {

ServiceA serviceA1;

ServiceA serviceA2;

ServiceB serviceB;

int bla;

ServiceC myReference;
ServiceC myReference2;

ServiceA serviceAAnnotated;

@Inject
public MyBean5(@Named("my2") ServiceA serviceA1,
ServiceA serviceA2,
Expand All @@ -53,13 +40,6 @@ public MyBean5(@Named("my2") ServiceA serviceA1,
@OsgiService(filter = "(mode=123)") @Named("ser2") ServiceC myReference2,
@AnnotatedService ServiceA serviceAAnnotated,
@Named("produced2") MyProduced myProduced) {
this.serviceA1 = serviceA1;
this.serviceA2 = serviceA2;
this.serviceB = serviceB;
this.bla = bla;
this.myReference = myReference;
this.myReference2 = myReference2;
this.serviceAAnnotated = serviceAAnnotated;
}

public MyBean5() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
@DependsOn
public class MyBean6 {

@SuppressWarnings("unused")
private final ServiceA serviceA1;

public MyBean6(@Named("my2") ServiceA serviceA1) {
this.serviceA1 = serviceA1;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public MyProduced createBeanWithServiceExpose1() {
public MyProduced createBeanWithServiceExpose2() {
return new MyProduced("My message");
}

@Produces
@Named("producedForServiceWithTwoInterfaces")
@OsgiServiceProvider(classes = {MyProduced.class, ServiceA.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.aries.blueprint.plugin.test;
package org.apache.aries.blueprint.plugin.test.cditransactional;

import org.apache.aries.blueprint.plugin.test.ParentBean;
import org.springframework.context.annotation.Lazy;

import javax.annotation.PostConstruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.aries.blueprint.plugin.test;
package org.apache.aries.blueprint.plugin.test.configuration;

import org.apache.aries.blueprint.annotation.config.Config;
import org.apache.aries.blueprint.annotation.config.ConfigProperty;
import org.apache.aries.blueprint.annotation.config.DefaultProperty;
import org.apache.aries.blueprint.plugin.test.MyProducedWithConstructor;

import javax.enterprise.inject.Produces;
import javax.inject.Named;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.aries.blueprint.plugin.test;
package org.apache.aries.blueprint.plugin.test.configuration;

import org.apache.aries.blueprint.annotation.config.ConfigProperties;
import org.apache.aries.blueprint.plugin.test.MyProducedWithConstructor;
import org.ops4j.pax.cdi.api.OsgiService;

import javax.enterprise.inject.Produces;
Expand Down

0 comments on commit cf62c10

Please sign in to comment.