Skip to content

Commit 54be6f6

Browse files
slawekjaranowskislachiewicz
authored andcommitted
Simple unit test
1 parent 2a42b66 commit 54be6f6

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
<artifactId>junit-jupiter-api</artifactId>
7070
<version>5.7.2</version>
7171
</dependency>
72+
<dependency>
73+
<groupId>org.junit.jupiter</groupId>
74+
<artifactId>junit-jupiter-engine</artifactId>
75+
<version>5.7.2</version>
76+
<scope>test</scope>
77+
</dependency>
7278
</dependencies>
7379

7480
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.codehaus.plexus.testing;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
import static org.junit.jupiter.api.Assertions.assertNotNull;
23+
24+
import org.junit.jupiter.api.Test;
25+
26+
import javax.inject.Inject;
27+
28+
@PlexusTest
29+
class PlexusTestTest
30+
{
31+
32+
@Inject
33+
private TestComponent testComponent;
34+
35+
@Test
36+
void dependencyShouldBeInjected()
37+
{
38+
assertNotNull( testComponent );
39+
assertNotNull( testComponent.getTestComponent2() );
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.codehaus.plexus.testing;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
import javax.inject.Inject;
23+
import javax.inject.Named;
24+
25+
@Named
26+
public class TestComponent
27+
{
28+
@Inject
29+
private TestComponent2 testComponent2;
30+
31+
public TestComponent2 getTestComponent2()
32+
{
33+
return testComponent2;
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.codehaus.plexus.testing;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
import javax.inject.Named;
23+
24+
@Named
25+
public class TestComponent2
26+
{
27+
}

0 commit comments

Comments
 (0)