diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..43f0e47 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Parent 13 - reformat +92cd784be0351b6832af410fb373707270f12750 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 336cecf..fb8795b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,34 +21,11 @@ on: [push, pull_request] jobs: build: - - strategy: - matrix: - os: [ubuntu-latest,windows-latest, macOS-latest] - java: [8, 11] - jdk: [adopt, zulu] - fail-fast: false - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v2.3.4 - - - name: Set up cache for ~./m2/repository - uses: actions/cache@v2.1.6 - with: - path: ~/.m2/repository - key: maven-${{ matrix.os }}-java${{ matrix.java }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - maven-${{ matrix.os }}-java${{ matrix.java }}- - maven-${{ matrix.os }}- - - - name: Set up JDK - uses: actions/setup-java@v2 - with: - distribution: ${{ matrix.jdk }} - java-version: ${{ matrix.java }} - - - name: Build with Maven - run: mvn install javadoc:javadoc -e -B -V -Pno-tests-if-not-on-osx + name: Build it + uses: codehaus-plexus/.github/.github/workflows/maven.yml@master + +# deploy: +# name: Deploy +# needs: build +# uses: codehaus-plexus/.github/.github/workflows/maven-deploy.yml@master +# secrets: inherit diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 4e2af99..4c09c8a 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,6 +7,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5.15.0 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 2934b80..14ce8ec 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ Plexus testing: - * [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-testing.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%22plexus-testing%22) +* [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-testing.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.codehaus.plexus%22%20a%3A%22plexus-testing%22) + [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/codehaus/plexus/plexus-testing/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/plexus/plexus-testing/README.md) + diff --git a/pom.xml b/pom.xml index 839f8c1..b946481 100644 --- a/pom.xml +++ b/pom.xml @@ -1,24 +1,23 @@ - 4.0.0 org.codehaus.plexus plexus - 7 + 22 plexus-testing - 1.0.0 + 1.5.1-SNAPSHOT Plexus Testing - scm:git:git@github.com:codehaus-plexus/plexus-testing.git - scm:git:git@github.com:codehaus-plexus/plexus-testing.git - http://github.com/codehaus-plexus/plexus-testing - plexus-testing-1.0.0 + scm:git:https://github.com/codehaus-plexus/plexus-testing.git + ${project.scm.connection} + HEAD + https://github.com/codehaus-plexus/plexus-testing github @@ -32,42 +31,55 @@ - true - 8 - 2021-05-28T14:25:32Z + 5.12.1 + 0.9.0.M4 + 2025-04-05T17:02:05Z - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - org.apache.maven.shared - maven-shared-resources - 3 - - - - - + + + + + com.google.guava + guava + + 33.4.8-jre + + + org.eclipse.sisu org.eclipse.sisu.plexus - 0.3.4 + ${versions.eclipse.sisu} + + + org.eclipse.sisu + org.eclipse.sisu.inject + ${versions.eclipse.sisu} com.google.inject guice - 4.2.3 + 6.0.0 + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + provided + true + + org.junit.jupiter junit-jupiter-api - 5.7.2 diff --git a/src/main/java/org/codehaus/plexus/testing/PlexusExtension.java b/src/main/java/org/codehaus/plexus/testing/PlexusExtension.java index b743ae9..be8ce91 100644 --- a/src/main/java/org/codehaus/plexus/testing/PlexusExtension.java +++ b/src/main/java/org/codehaus/plexus/testing/PlexusExtension.java @@ -65,51 +65,51 @@ * @author Michal Maczka * @author Guillaume Nodet */ -public class PlexusExtension implements BeforeEachCallback, AfterEachCallback -{ +public class PlexusExtension implements BeforeEachCallback, AfterEachCallback { private ExtensionContext context; private PlexusContainer container; private static String basedir; @Override - public void beforeEach( ExtensionContext context ) - throws Exception - { + public void beforeEach(ExtensionContext context) throws Exception { basedir = getBasedir(); - this.context = context; - getContainer().addComponent( getContainer(), PlexusContainer.class.getName() ); + setContext(context); + + getContainer().addComponent(getContainer(), PlexusContainer.class.getName()); + + ((DefaultPlexusContainer) getContainer()) + .addPlexusInjector( + Collections.emptyList(), binder -> binder.requestInjection(context.getRequiredTestInstance())); + } - ( (DefaultPlexusContainer) getContainer() ).addPlexusInjector( Collections.emptyList(), - binder -> binder.requestInjection( context.getRequiredTestInstance() ) ); + protected void setContext(ExtensionContext context) { + this.context = context; } - @SuppressWarnings( "ResultOfMethodCallIgnored" ) - protected void setupContainer() - { + @SuppressWarnings("ResultOfMethodCallIgnored") + protected void setupContainer() { // ---------------------------------------------------------------------------- // Context Setup // ---------------------------------------------------------------------------- DefaultContext context = new DefaultContext(); - context.put( "basedir", getBasedir() ); + context.put("basedir", getBasedir()); - customizeContext( context ); + customizeContext(context); - boolean hasPlexusHome = context.contains( "plexus.home" ); + boolean hasPlexusHome = context.contains("plexus.home"); - if ( !hasPlexusHome ) - { - File f = getTestFile( "target/plexus-home" ); + if (!hasPlexusHome) { + File f = getTestFile("target/plexus-home"); - if ( !f.isDirectory() ) - { + if (!f.isDirectory()) { f.mkdir(); } - context.put( "plexus.home", f.getAbsolutePath() ); + context.put("plexus.home", f.getAbsolutePath()); } // ---------------------------------------------------------------------------- @@ -118,30 +118,23 @@ protected void setupContainer() String config = getCustomConfigurationName(); - ContainerConfiguration containerConfiguration = new DefaultContainerConfiguration() - .setName( "test" ) - .setContext( context.getContextData() ); + ContainerConfiguration containerConfiguration = + new DefaultContainerConfiguration().setName("test").setContext(context.getContextData()); - if ( config != null ) - { - containerConfiguration.setContainerConfiguration( config ); - } - else - { - String resource = getConfigurationName( null ); + if (config != null) { + containerConfiguration.setContainerConfiguration(config); + } else { + String resource = getConfigurationName(null); - containerConfiguration.setContainerConfiguration( resource ); + containerConfiguration.setContainerConfiguration(resource); } - customizeContainerConfiguration( containerConfiguration ); + customizeContainerConfiguration(containerConfiguration); - try - { - container = new DefaultPlexusContainer( containerConfiguration ); - } - catch ( PlexusContainerException e ) - { - throw new IllegalArgumentException( "Failed to create plexus container.", e ); + try { + container = new DefaultPlexusContainer(containerConfiguration); + } catch (PlexusContainerException e) { + throw new IllegalArgumentException("Failed to create plexus container.", e); } } @@ -151,57 +144,43 @@ protected void setupContainer() * * @param containerConfiguration {@link ContainerConfiguration}. */ - protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) - { - containerConfiguration.setAutoWiring( true ); - containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX ); + protected void customizeContainerConfiguration(ContainerConfiguration containerConfiguration) { + containerConfiguration.setAutoWiring(true); + containerConfiguration.setClassPathScanning(PlexusConstants.SCANNING_INDEX); } - protected void customizeContext( Context context ) - { - } + protected void customizeContext(Context context) {} - protected PlexusConfiguration customizeComponentConfiguration() - { + protected PlexusConfiguration customizeComponentConfiguration() { return null; } @Override - public void afterEach( ExtensionContext context ) - throws Exception - { - if ( container != null ) - { + public void afterEach(ExtensionContext context) throws Exception { + if (container != null) { container.dispose(); container = null; } } - public PlexusContainer getContainer() - { - if ( container == null ) - { + public PlexusContainer getContainer() { + if (container == null) { setupContainer(); } return container; } - protected InputStream getConfiguration() - throws Exception - { - return getConfiguration( null ); + protected InputStream getConfiguration() throws Exception { + return getConfiguration(null); } - protected InputStream getConfiguration( String subname ) - throws Exception - { - return getResourceAsStream( getConfigurationName( subname ) ); + protected InputStream getConfiguration(String subname) throws Exception { + return getResourceAsStream(getConfigurationName(subname)); } - protected String getCustomConfigurationName() - { + protected String getCustomConfigurationName() { return null; } @@ -214,29 +193,22 @@ protected String getCustomConfigurationName() * @param subname the subname * @return A configruation name */ - protected String getConfigurationName( String subname ) - { + protected String getConfigurationName(String subname) { Class testClass = context.getRequiredTestClass(); - for ( Class clazz = testClass; - clazz != null; - clazz = clazz.getSuperclass() ) - { - String name = clazz.getName().replace( '.', '/' ) + ".xml"; - if ( testClass.getClassLoader().getResource( name ) != null ) - { + for (Class clazz = testClass; clazz != null; clazz = clazz.getSuperclass()) { + String name = clazz.getName().replace('.', '/') + ".xml"; + if (testClass.getClassLoader().getResource(name) != null) { return name; } } return null; } - protected InputStream getResourceAsStream( String resource ) - { - return context.getRequiredTestClass().getResourceAsStream( resource ); + protected InputStream getResourceAsStream(String resource) { + return context.getRequiredTestClass().getResourceAsStream(resource); } - protected ClassLoader getClassLoader() - { + protected ClassLoader getClassLoader() { return context.getRequiredTestClass().getClassLoader(); } @@ -244,98 +216,75 @@ protected ClassLoader getClassLoader() // Container access // ---------------------------------------------------------------------- - @SuppressWarnings( "unchecked" ) - protected T lookup( String componentKey ) - throws ComponentLookupException - { - return (T) getContainer().lookup( componentKey ); + @SuppressWarnings("unchecked") + protected T lookup(String componentKey) throws ComponentLookupException { + return (T) getContainer().lookup(componentKey); } - @SuppressWarnings( "unchecked" ) - protected T lookup( String role, - String roleHint ) - throws ComponentLookupException - { - return (T) getContainer().lookup( role, roleHint ); + @SuppressWarnings("unchecked") + protected T lookup(String role, String roleHint) throws ComponentLookupException { + return (T) getContainer().lookup(role, roleHint); } - protected T lookup( Class componentClass ) - throws ComponentLookupException - { - return getContainer().lookup( componentClass ); + protected T lookup(Class componentClass) throws ComponentLookupException { + return getContainer().lookup(componentClass); } - protected T lookup( Class componentClass, String roleHint ) - throws ComponentLookupException - { - return getContainer().lookup( componentClass, roleHint ); + protected T lookup(Class componentClass, String roleHint) throws ComponentLookupException { + return getContainer().lookup(componentClass, roleHint); } - protected void release( Object component ) - throws ComponentLifecycleException - { - getContainer().release( component ); + protected void release(Object component) throws ComponentLifecycleException { + getContainer().release(component); } // ---------------------------------------------------------------------- // Helper methods for sub classes // ---------------------------------------------------------------------- - public static File getTestFile( String path ) - { - return new File( getBasedir(), path ); + public static File getTestFile(String path) { + return new File(getBasedir(), path); } - public static File getTestFile( String basedir, - String path ) - { - File basedirFile = new File( basedir ); + public static File getTestFile(String basedir, String path) { + File basedirFile = new File(basedir); - if ( !basedirFile.isAbsolute() ) - { - basedirFile = getTestFile( basedir ); + if (!basedirFile.isAbsolute()) { + basedirFile = getTestFile(basedir); } - return new File( basedirFile, path ); + return new File(basedirFile, path); } - public static String getTestPath( String path ) - { - return getTestFile( path ).getAbsolutePath(); + public static String getTestPath(String path) { + return getTestFile(path).getAbsolutePath(); } - public static String getTestPath( String basedir, - String path ) - { - return getTestFile( basedir, path ).getAbsolutePath(); + public static String getTestPath(String basedir, String path) { + return getTestFile(basedir, path).getAbsolutePath(); } - public static String getBasedir() - { - if ( basedir != null ) - { + public static String getBasedir() { + if (basedir != null) { return basedir; } - basedir = System.getProperty( "basedir" ); + basedir = System.getProperty("basedir"); - if ( basedir == null ) - { - basedir = new File( "" ).getAbsolutePath(); + if (basedir == null) { + basedir = new File("").getAbsolutePath(); } return basedir; } - public String getTestConfiguration() - { - return getTestConfiguration( context.getRequiredTestClass() ); + public String getTestConfiguration() { + return getTestConfiguration(context.getRequiredTestClass()); } - public static String getTestConfiguration( Class clazz ) - { - String s = clazz.getName().replace( '.', '/' ); + public static String getTestConfiguration(Class clazz) { + String s = clazz.getName().replace('.', '/'); - return s.substring( 0, s.indexOf( "$" ) ) + ".xml"; + return s.substring(0, s.indexOf("$")) + ".xml"; } } diff --git a/src/main/java/org/codehaus/plexus/testing/PlexusTest.java b/src/main/java/org/codehaus/plexus/testing/PlexusTest.java index 5e3b215..b72ebf3 100644 --- a/src/main/java/org/codehaus/plexus/testing/PlexusTest.java +++ b/src/main/java/org/codehaus/plexus/testing/PlexusTest.java @@ -29,10 +29,7 @@ /** * Plexus test */ -@Retention( RetentionPolicy.RUNTIME ) -@ExtendWith( PlexusExtension.class ) -@Target( ElementType.TYPE ) -public @interface PlexusTest -{ - -} +@Retention(RetentionPolicy.RUNTIME) +@ExtendWith(PlexusExtension.class) +@Target(ElementType.TYPE) +public @interface PlexusTest {} diff --git a/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java b/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java new file mode 100644 index 0000000..72e39da --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/PlexusTestJakartaTest.java @@ -0,0 +1,46 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import jakarta.inject.Inject; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +@PlexusTest +class PlexusTestJakartaTest { + + @Inject + private TestJakartaComponent testJakartaComponent; + + @Test + void dependencyShouldBeInjected() { + assertNotNull(testJakartaComponent); + assertNotNull(testJakartaComponent.getTestJakartaComponent2()); + // assertNotNull(testJakartaComponent.getTestJakartaComponent3Named()); + assertNull(testJakartaComponent.getTestJakartaComponent3NullableJavax()); + assertNull(testJakartaComponent.getTestJakartaComponent3NullableJakarta()); + + assertNotNull(testJakartaComponent.getTestJavaxComponent2()); + assertNotNull(testJakartaComponent.getTestJavaxComponent2()); + assertNotNull(testJakartaComponent.getTestJavaxComponent2()); + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java b/src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java new file mode 100644 index 0000000..add8490 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/PlexusTestJavaxTest.java @@ -0,0 +1,39 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@PlexusTest +class PlexusTestJavaxTest { + + @Inject + private TestJavaxComponent testJavaxComponent; + + @Test + void dependencyShouldBeInjected() { + assertNotNull(testJavaxComponent); + assertNotNull(testJavaxComponent.getTestComponent2()); + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java new file mode 100644 index 0000000..c4912a5 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent.java @@ -0,0 +1,67 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import jakarta.inject.Inject; +import jakarta.inject.Named; + +@Named +public class TestJakartaComponent { + @Inject + private TestJavaxComponent2 testJavaxComponent2; + + @Inject + private TestJakartaComponent2 testJakartaComponent2; + + // @Inject + // @Nonnull + // @Named("someComponent") + // private TestJakartaComponent3 testJakartaComponent3Named; + + @Inject + @javax.annotation.Nullable + @Named("someComponentNotExisting") + private TestJakartaComponent3 testJakartaComponent3NullableJavax; + + @Inject + @jakarta.annotation.Nullable + @Named("someComponentNotExisting") + private TestJakartaComponent3 testJakartaComponent3NullableJakarta; + + public TestJavaxComponent2 getTestJavaxComponent2() { + return testJavaxComponent2; + } + + public TestJakartaComponent2 getTestJakartaComponent2() { + return testJakartaComponent2; + } + + // public TestJakartaComponent3 getTestJakartaComponent3Named() { + // return testJakartaComponent3Named; + // } + + public TestJakartaComponent3 getTestJakartaComponent3NullableJavax() { + return testJakartaComponent3NullableJavax; + } + + public TestJakartaComponent3 getTestJakartaComponent3NullableJakarta() { + return testJakartaComponent3NullableJakarta; + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java new file mode 100644 index 0000000..7db989d --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent2.java @@ -0,0 +1,25 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Named; + +@Named +public class TestJakartaComponent2 {} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent3.java b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent3.java new file mode 100644 index 0000000..cb0b286 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJakartaComponent3.java @@ -0,0 +1,25 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import jakarta.inject.Named; + +@Named("someComponent") +public class TestJakartaComponent3 {} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java new file mode 100644 index 0000000..6ce98b7 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent.java @@ -0,0 +1,33 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Inject; +import javax.inject.Named; + +@Named +public class TestJavaxComponent { + @Inject + private TestJavaxComponent2 testJavaxComponent2; + + public TestJavaxComponent2 getTestComponent2() { + return testJavaxComponent2; + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java new file mode 100644 index 0000000..d5afd5b --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestJavaxComponent2.java @@ -0,0 +1,25 @@ +package org.codehaus.plexus.testing; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.inject.Named; + +@Named +public class TestJavaxComponent2 {}