Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MCOMPILER-372] - fix test compile issue: added dependency test path for modules #27

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/it/MCOMPILER-372_modularized_testjar/pom.xml
Expand Up @@ -37,6 +37,7 @@
<module>prj0</module>
<module>prj1</module>
<module>prj2</module>
<module>prj3</module>
</modules>

<build>
Expand Down
14 changes: 14 additions & 0 deletions src/it/MCOMPILER-372_modularized_testjar/prj1/pom.xml
Expand Up @@ -56,6 +56,20 @@

<dependencies>

<!-- log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.12.1</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.12.1</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Expand Up @@ -19,10 +19,15 @@

package prj1;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import junit.framework.TestCase;

public class Prj1Test extends TestCase
{

public static final Logger LOGGER = LogManager.getLogger( Prj1Test.class );

public void test() {

}
Expand Down
Expand Up @@ -19,11 +19,16 @@

package prj2;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import prj1.Prj1Test;

public class Prj2Test extends Prj1Test
{

public static final Logger LOGGER = LogManager.getLogger( Prj2Test.class );

public Prj2Test() {
super();
}
Expand Down
74 changes: 74 additions & 0 deletions src/it/MCOMPILER-372_modularized_testjar/prj3/pom.xml
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven.plugins.compiler.it.372</groupId>
<artifactId>mcompiler-372</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>prj3-372</artifactId>

<dependencies>

<dependency>
<groupId>org.apache.maven.plugins.compiler.it.372</groupId>
<artifactId>prj2-372</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

<!--
Prj 3 depends on Prj 1 test jar
Prj 2 depends on Prj 1 test jar
Prj 1, 2, 3 are modularized.
This is configuration we want to test.
-->
<dependency>
<groupId>org.apache.maven.plugins.compiler.it.372</groupId>
<artifactId>prj2-372</artifactId>
<version>1.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugins.compiler.it.372</groupId>
<artifactId>prj1-372</artifactId>
<version>1.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
@@ -0,0 +1,25 @@
/*
* 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.
*/

module prj3_372 {

requires prj1_372;
requires prj2_372;

}
@@ -0,0 +1,25 @@
/*
* 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.
*/

package prj3;

public class Dummy
{

}
@@ -0,0 +1,47 @@
/*
* 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.
*/

package prj3;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import prj1.Prj1Test;
import prj2.Prj2Test;

/**
* We want to test that import of 2 levels of modularized test projects is OK
*/
public class Prj3Test extends Prj2Test
{

public static final Logger LOGGER = LogManager.getLogger( Prj3Test.class );

private Prj1Test prj1Test = new Prj1Test();

public Prj3Test() {
super();
}

@Override
public void test() {

}

}