diff --git a/pom.xml b/pom.xml index 2c7b040..d098a55 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,12 @@ junit-jupiter-api 5.7.2 + + org.junit.jupiter + junit-jupiter-engine + 5.7.2 + test + diff --git a/src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java b/src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java new file mode 100644 index 0000000..24b3845 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/PlexusTestTest.java @@ -0,0 +1,41 @@ +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 static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; + +import javax.inject.Inject; + +@PlexusTest +class PlexusTestTest +{ + + @Inject + private TestComponent testComponent; + + @Test + void dependencyShouldBeInjected() + { + assertNotNull( testComponent ); + assertNotNull( testComponent.getTestComponent2() ); + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestComponent.java b/src/test/java/org/codehaus/plexus/testing/TestComponent.java new file mode 100644 index 0000000..cc21698 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestComponent.java @@ -0,0 +1,35 @@ +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 TestComponent +{ + @Inject + private TestComponent2 testComponent2; + + public TestComponent2 getTestComponent2() + { + return testComponent2; + } +} diff --git a/src/test/java/org/codehaus/plexus/testing/TestComponent2.java b/src/test/java/org/codehaus/plexus/testing/TestComponent2.java new file mode 100644 index 0000000..2a62bac --- /dev/null +++ b/src/test/java/org/codehaus/plexus/testing/TestComponent2.java @@ -0,0 +1,27 @@ +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 TestComponent2 +{ +}