mirror of https://github.com/apache/ant-ivy
add a target to generate javadoc for test cases; fix javadoc for doclint
This commit is contained in:
parent
186fd10776
commit
463a2c89c3
|
|
@ -37,6 +37,7 @@ jacoco.log=${build.dir}/jacoco.data
|
|||
test.report.dir=${reports.dir}/test/html
|
||||
coverage.report.dir=${reports.dir}/coverage
|
||||
javadoc.build.dir=${reports.dir}/api
|
||||
test.javadoc.build.dir=${reports.dir}/test-api
|
||||
ivy.report.dir=${reports.dir}/ivy
|
||||
doc.src.dir=${basedir}/asciidoc
|
||||
checkstyle.report.dir=${reports.dir}/checkstyle
|
||||
|
|
|
|||
21
build.xml
21
build.xml
|
|
@ -90,7 +90,6 @@
|
|||
<path refid="lib.classpath"/>
|
||||
</path>
|
||||
<path id="test.classpath">
|
||||
<pathelement location="${coverage.classes.dir}"/>
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="*.jar"/>
|
||||
<exclude name="ant.jar"/>
|
||||
|
|
@ -101,6 +100,10 @@
|
|||
<pathelement location="${optional.classes.build.dir}"/>
|
||||
<pathelement path="${test.build.dir}"/>
|
||||
</path>
|
||||
<path id="javadoc.test.classpath">
|
||||
<path refid="run.classpath"/>
|
||||
<pathelement path="${test.build.dir}"/>
|
||||
</path>
|
||||
</target>
|
||||
|
||||
<target name="prepare" depends="init">
|
||||
|
|
@ -518,6 +521,22 @@
|
|||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target name="javadoc-test" depends="init" unless="skip.javadoc">
|
||||
<tstamp>
|
||||
<format pattern="2007-yyyy" property="years"/>
|
||||
</tstamp>
|
||||
<property name="copyright" value="Copyright &copy;${years} The Apache Software Foundation, Licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a>."/>
|
||||
<property name="title" value="Apache Ivy&trade; dependency manager ${target.ivy.version} API"/>
|
||||
<javadoc destdir="${test.javadoc.build.dir}"
|
||||
useexternalfile="true"
|
||||
windowtitle="Apache Ivy&trade;"
|
||||
doctitle="${title}"
|
||||
bottom="${copyright}"
|
||||
classpathref="javadoc.test.classpath">
|
||||
<fileset dir="${test.dir}" includes="**/*.java"/>
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target name="sources" depends="default-version" description="Create source archive files">
|
||||
<mkdir dir="${artifacts.build.dir}/sources/"/>
|
||||
<jar destfile="${artifacts.build.dir}/sources/${final.name}">
|
||||
|
|
|
|||
|
|
@ -158,11 +158,12 @@ public class RetrieveOptions extends LogOptions {
|
|||
return makeSymlinks || makeSymlinksInMass;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* @return false
|
||||
* @deprecated Starting 2.5, creating symlinks in mass is no longer supported and this
|
||||
* method will always return false
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isMakeSymlinksInMass() {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -173,6 +174,8 @@ public class RetrieveOptions extends LogOptions {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param makeSymlinksInMass ditto
|
||||
* @return RetrieveOptions
|
||||
* @deprecated Starting 2.5, creating symlinks in mass is no longer supported and this
|
||||
* method plays no role in creation of symlinks. Use {@link #setMakeSymlinks(boolean)} instead
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class RelativeURLRepository extends URLRepository {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param baseUrl
|
||||
* @param baseUrl ditto
|
||||
* @deprecated Since 2.5. Use {@link #RelativeURLRepository(URL, TimeoutConstraint)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
|||
|
|
@ -263,6 +263,7 @@ public final class SshCache {
|
|||
* @param session
|
||||
* to connect to
|
||||
* @return channelSftp or null if not successful (channel not existent or dead)
|
||||
* @throws IOException should never happen
|
||||
*/
|
||||
public ChannelSftp getChannelSftp(Session session) throws IOException {
|
||||
ChannelSftp channel = null;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public final class FileUtil {
|
|||
* @param overwrite {@code true} if any existing file at {@code link} has to be overwritten. False otherwise
|
||||
* @return Returns true if the symlink was successfully created. Returns false if the symlink creation couldn't
|
||||
* be done
|
||||
* @throws IOException
|
||||
* @throws IOException if {@link Files#createSymbolicLink} fails
|
||||
*/
|
||||
public static boolean symlink(final File target, final File link, final boolean overwrite)
|
||||
throws IOException {
|
||||
|
|
|
|||
|
|
@ -109,11 +109,12 @@ public interface URLHandler {
|
|||
* <p>
|
||||
* Please use {@link #getURLInfo(URL, TimeoutConstraint)} if more one information about the <code>url</code>
|
||||
* is needed
|
||||
* </p>
|
||||
*
|
||||
* @param url The URL to access
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @return
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
boolean isReachable(URL url, TimeoutConstraint timeoutConstraint);
|
||||
|
|
@ -147,7 +148,7 @@ public interface URLHandler {
|
|||
* @param url The URL to access
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @return
|
||||
* @return long
|
||||
* @since 2.5
|
||||
*/
|
||||
long getContentLength(URL url, TimeoutConstraint timeoutConstraint);
|
||||
|
|
@ -178,11 +179,12 @@ public interface URLHandler {
|
|||
* <p>
|
||||
* Please use {@link #getURLInfo(URL, TimeoutConstraint)} if more one information about the <code>url</code>
|
||||
* is needed
|
||||
* </p>
|
||||
*
|
||||
* @param url The URL to access
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @return
|
||||
* @return long
|
||||
* @since 2.5
|
||||
*/
|
||||
long getLastModified(URL url, TimeoutConstraint timeoutConstraint);
|
||||
|
|
@ -213,15 +215,15 @@ public interface URLHandler {
|
|||
* @param url The URL for which the information is to be retrieved
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @return
|
||||
* @return URLInfo
|
||||
* @since 2.5
|
||||
*/
|
||||
URLInfo getURLInfo(URL url, TimeoutConstraint timeoutConstraint);
|
||||
|
||||
/**
|
||||
* @param url
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @param url ditto
|
||||
* @return InputStream
|
||||
* @throws IOException if something goes wrong
|
||||
* @deprecated Use {@link #openStream(URL, TimeoutConstraint)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
@ -233,17 +235,17 @@ public interface URLHandler {
|
|||
* @param url The URL to which an {@link InputStream} has to be opened
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @return InputStream
|
||||
* @throws IOException if something goes wrong
|
||||
* @since 2.5
|
||||
*/
|
||||
InputStream openStream(URL url, TimeoutConstraint timeoutConstraint) throws IOException;
|
||||
|
||||
/**
|
||||
* @param src
|
||||
* @param dest
|
||||
* @param l
|
||||
* @throws IOException
|
||||
* @param src URL
|
||||
* @param dest File
|
||||
* @param l CopyProgressListener
|
||||
* @throws IOException if something goes wrong
|
||||
* @deprecated Use {@link #download(URL, File, CopyProgressListener, TimeoutConstraint)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
@ -257,16 +259,16 @@ public interface URLHandler {
|
|||
* @param listener The listener that will be notified of the download progress
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @throws IOException
|
||||
* @throws IOException if something goes wrong
|
||||
* @since 2.5
|
||||
*/
|
||||
void download(URL src, File dest, CopyProgressListener listener, TimeoutConstraint timeoutConstraint) throws IOException;
|
||||
|
||||
/**
|
||||
* @param src
|
||||
* @param dest
|
||||
* @param l
|
||||
* @throws IOException
|
||||
* @param src File
|
||||
* @param dest URL
|
||||
* @param l CopyProgressListener
|
||||
* @throws IOException if something goes wrong
|
||||
* @deprecated Use {@link #upload(File, URL, CopyProgressListener, TimeoutConstraint)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
@ -280,7 +282,7 @@ public interface URLHandler {
|
|||
* @param listener The listener that will be notified of the upload progress
|
||||
* @param timeoutConstraint The connectivity timeout constraints. Can be null, in which case the timeouts
|
||||
* are implementation specific
|
||||
* @throws IOException
|
||||
* @throws IOException if something goes wrong
|
||||
* @since 2.5
|
||||
*/
|
||||
void upload(File src, URL dest, CopyProgressListener listener, TimeoutConstraint timeoutConstraint) throws IOException;
|
||||
|
|
|
|||
|
|
@ -136,10 +136,11 @@ public class MainTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that the {@code types} argument to the command line is parsed correctly when it's passed
|
||||
* more than one value for the argument
|
||||
* Test case for IVY-1355.
|
||||
* {@code types} argument to the command line must be parsed correctly when it's passed
|
||||
* more than one value for the argument.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1355">IVY-1355</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -160,7 +161,7 @@ public class MainTest {
|
|||
/**
|
||||
* Tests that the {@code overwriteMode} passed for the retrieve command works as expected
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testRetrieveOverwriteMode() throws Exception {
|
||||
|
|
|
|||
|
|
@ -34,25 +34,26 @@ import org.apache.ivy.plugins.resolver.util.ResolvedResource;
|
|||
|
||||
/**
|
||||
* Fixture easing the development of tests requiring to set up a simple repository with some
|
||||
* modules, using micro ivy format to describe the repository. <br/>
|
||||
* modules, using micro ivy format to describe the repository.
|
||||
* <p>
|
||||
* Example of use:
|
||||
*
|
||||
* </p>
|
||||
* <pre>
|
||||
* public class MyTest {
|
||||
* private TestFixture fixture;
|
||||
*
|
||||
* @Before
|
||||
* @Before
|
||||
* public void setUp() throws Exception {
|
||||
* fixture = new TestFixture();
|
||||
* // additional setup here
|
||||
* }
|
||||
*
|
||||
* @After
|
||||
* @After
|
||||
* public void tearDown() throws Exception {
|
||||
* fixture.clean();
|
||||
* }
|
||||
*
|
||||
* @Test
|
||||
* @Test
|
||||
* public void testXXX() throws Exception {
|
||||
* fixture.addMD("#A;1-> { #B;[1.5,1.6] #C;2.5 }").addMD("#B;1.5->#D;2.0")
|
||||
* .addMD("#B;1.6->#D;2.0").addMD("#C;2.5->#D;[1.0,1.6]").addMD("#D;1.5")
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import org.apache.tools.ant.DefaultLogger;
|
|||
import org.apache.tools.ant.Project;
|
||||
import org.apache.tools.ant.taskdefs.Delete;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -144,25 +143,19 @@ public class TestHelper {
|
|||
* Parses a string representation of a module descriptor in micro ivy format.
|
||||
* <p>
|
||||
* Examples:
|
||||
*
|
||||
* </p>
|
||||
* <pre>
|
||||
* #A;1
|
||||
* </pre>
|
||||
*
|
||||
* <hr/>
|
||||
*
|
||||
* <hr>
|
||||
* <pre>
|
||||
* #A;2-> #B;[1.0,1.5]
|
||||
* #A;2-> #B;[1.0,1.5]
|
||||
* </pre>
|
||||
*
|
||||
* <hr/>
|
||||
*
|
||||
* <hr>
|
||||
* <pre>
|
||||
* #A;3-> { #B;[1.0,1.5] #C;[2.0,2.5] }
|
||||
* #A;3-> { #B;[1.0,1.5] #C;[2.0,2.5] }
|
||||
* </pre>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @param microIvy
|
||||
* the micro ivy description of the module descriptor
|
||||
* @return the parsed module descriptor
|
||||
|
|
@ -391,8 +384,8 @@ public class TestHelper {
|
|||
* @param serverAddress The address to which the server will be bound
|
||||
* @param webAppContext The context root of the application which will be handling the requests to the server
|
||||
* @param localFilesystemRepoRoot The path to the root directory containing the module descriptors and artifacts
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @return AutoCloseable
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
public static AutoCloseable createHttpServerBackedRepository(final InetSocketAddress serverAddress, final String webAppContext,
|
||||
final Path localFilesystemRepoRoot) throws IOException {
|
||||
|
|
@ -426,8 +419,8 @@ public class TestHelper {
|
|||
* @param realm The realm to use for the {@code BASIC} auth mechanism
|
||||
* @param validCredentials A {@link Map} of valid credentials, the key being the user name and the value being the password,
|
||||
* that the server will use during the authentication process of the incoming requests
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @return AutoCloseable
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
public static AutoCloseable createBasicAuthHttpServerBackedRepo(final InetSocketAddress serverAddress, final String webAppContext,
|
||||
final Path localFilesystemRepoRoot, final String realm,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class FileUtilTest {
|
|||
/**
|
||||
* Tests that {@link FileUtil#normalize(String)} works as expected for some basic file paths
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testSimpleNormalize() throws Exception {
|
||||
|
|
@ -50,7 +50,7 @@ public class FileUtilTest {
|
|||
* Tests that {@link FileUtil#normalize(String)} works as expected when passed a path that starts with
|
||||
* {@link File#listRoots() filesystem roots}
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testNormalizeOfFileSystemRootPath() throws Exception {
|
||||
|
|
|
|||
|
|
@ -62,9 +62,13 @@ public class IvyAntSettingsBuildFileTest {
|
|||
buildRule.getProject().getReference("ivy.instance"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-925.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-925">IVY-925</a>
|
||||
*/
|
||||
@Test
|
||||
public void testSettingsWithIdIvyInstance() {
|
||||
// IVY-925
|
||||
buildRule.executeTarget("testSettingsWithPropertyAsId");
|
||||
ResolveReport report = buildRule.getProject().getReference("ivy.resolved.report");
|
||||
assertNotNull(report);
|
||||
|
|
@ -72,9 +76,13 @@ public class IvyAntSettingsBuildFileTest {
|
|||
assertEquals(1, report.getDependencies().size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-924.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-924">IVY-924</a>
|
||||
*/
|
||||
@Test
|
||||
public void testStackOverflow() {
|
||||
// IVY-924
|
||||
buildRule.configureProject("test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml");
|
||||
buildRule.executeTarget("testStackOverflow");
|
||||
ResolveReport report = buildRule.getProject().getReference("ivy.resolved.report");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class IvyArtifactPropertyTest {
|
|||
/**
|
||||
* Test must fail because no resolve was performed
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testWithResolveIdWithoutResolve() throws Exception {
|
||||
|
|
|
|||
|
|
@ -180,9 +180,14 @@ public class IvyBuildNumberTest {
|
|||
assertEquals("1", buildNumber.getProject().getProperty("ivy.new.build.number"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1037.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1037">IVY-1037</a>
|
||||
*/
|
||||
@Test
|
||||
public void testChainResolver() throws Exception {
|
||||
// IVY-1037
|
||||
Project project = TestHelper.newProject();
|
||||
project.setProperty("ivy.settings.file", "test/repositories/IVY-1037/ivysettings.xml");
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class IvyCacheFilesetTest {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailure() throws Exception {
|
||||
|
|
@ -124,7 +124,7 @@ public class IvyCacheFilesetTest {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testInvalidPattern() throws Exception {
|
||||
|
|
@ -202,10 +202,11 @@ public class IvyCacheFilesetTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that the {@link IvyCacheFileset} fails with an exception if it can't determine a common base directory
|
||||
* while dealing with cached artifacts
|
||||
* Test case for IVY-1475.
|
||||
* {@link IvyCacheFileset} must fail with an exception if it cannot determine
|
||||
* a common base directory while dealing with cached artifacts.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1475">IVY-1475</a> for more details
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1475">IVY-1475</a>
|
||||
*/
|
||||
@Test
|
||||
public void getBaseDirNoCommonBaseDir() {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class IvyCachePathTest {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailure() throws Exception {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class IvyCleanCacheTest {
|
|||
/**
|
||||
* clean cache must fail with unknown cache
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testUnknownCache() throws Exception {
|
||||
|
|
|
|||
|
|
@ -222,9 +222,14 @@ public class IvyConfigureTest {
|
|||
assertEquals("value", configure.getProject().getProperty("ivy.test.variable.this.id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-601.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-601">IVY-601</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIncludeTwice() throws Exception {
|
||||
// IVY-601
|
||||
configure.setFile(new File("test/java/org/apache/ivy/ant/ivysettings-include-twice.xml"));
|
||||
|
||||
configure.execute();
|
||||
|
|
@ -270,7 +275,7 @@ public class IvyConfigureTest {
|
|||
/**
|
||||
* Calling settings twice with the same id with override=notallowed must fail
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testOverrideNotAllowed() throws Exception {
|
||||
|
|
@ -295,7 +300,7 @@ public class IvyConfigureTest {
|
|||
/**
|
||||
* Settings override with invalid value must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testInvalidOverride() throws Exception {
|
||||
|
|
@ -310,7 +315,7 @@ public class IvyConfigureTest {
|
|||
* Tests that if the Ivy settings file <code>include</code>s another file as <code>optional</code>,
|
||||
* then the absence of that file doesn't lead to failures
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testOptionalFileInclude() throws Exception {
|
||||
|
|
|
|||
|
|
@ -297,9 +297,14 @@ public class IvyDeliverTest {
|
|||
md.getModuleRevisionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-404.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-404">IVY-404</a>
|
||||
*/
|
||||
@Test
|
||||
public void testWithBranch() throws Exception {
|
||||
// test case for IVY-404
|
||||
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-latest-branch.xml");
|
||||
IvyResolve res = new IvyResolve();
|
||||
res.setProject(project);
|
||||
|
|
@ -358,9 +363,14 @@ public class IvyDeliverTest {
|
|||
dds[0].getDynamicConstraintDependencyRevisionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-415.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-415">IVY-415</a>
|
||||
*/
|
||||
@Test
|
||||
public void testWithExtraAttributes() throws Exception {
|
||||
// test case for IVY-415
|
||||
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-latest-extra.xml");
|
||||
IvyResolve res = new IvyResolve();
|
||||
res.setValidate(false);
|
||||
|
|
@ -432,10 +442,15 @@ public class IvyDeliverTest {
|
|||
expectedFileSet, actualFileSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-707.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-707">IVY-707</a>
|
||||
*/
|
||||
@Test
|
||||
public void testWithDynEvicted2() throws Exception {
|
||||
// same as previous but dynamic dependency is placed after the one causing the conflict
|
||||
// test case for IVY-707
|
||||
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-dyn-evicted2.xml");
|
||||
IvyResolve res = new IvyResolve();
|
||||
res.setValidate(false);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class IvyDependencyTreeTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Task must fail because no resolve was performed.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testWithResolveIdWithoutResolve() throws Exception {
|
||||
|
|
@ -118,10 +118,11 @@ public class IvyDependencyTreeTest extends AntTaskTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that dependency tree task doesn't run into an infinite loop due to circular dependencies
|
||||
* Test case for IVY-1540.
|
||||
* Dependency tree task must not run into an infinite loop due to circular dependencies.
|
||||
*
|
||||
* @throws Exception
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1540">IVY-1540</a> for more details
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1540">IVY-1540</a>
|
||||
*/
|
||||
@Test
|
||||
public void testCircularDep() throws Exception {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testInlineForNonExistingModule() throws Exception {
|
||||
|
|
@ -135,7 +135,7 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailure() throws Exception {
|
||||
|
|
@ -147,7 +147,7 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Test must fail because of missing configurations.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testFailureWithMissingConfigurations() throws Exception {
|
||||
|
|
@ -163,7 +163,7 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailureOnBadDependencyIvyFile() throws Exception {
|
||||
|
|
@ -175,7 +175,7 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailureOnBadStatusInDependencyIvyFile() throws Exception {
|
||||
|
|
@ -215,9 +215,13 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
assertFalse(project.getProperty("ivy.resolved.configurations").contains("default"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-396.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-396">IVY-396</a>
|
||||
*/
|
||||
@Test
|
||||
public void testResolveWithAbsoluteFile() {
|
||||
// IVY-396
|
||||
File ivyFile = new File("test/java/org/apache/ivy/ant/ivy-simple.xml");
|
||||
dependencyUpdateChecker.getProject().setProperty("ivy.dep.file", ivyFile.getAbsolutePath());
|
||||
dependencyUpdateChecker.execute();
|
||||
|
|
@ -226,9 +230,13 @@ public class IvyDependencyUpdateCheckerTest extends AntTaskTestCase {
|
|||
// ModuleRevisionId.newInstance("apache", "resolve-simple", "1.0")).exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-396.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-396">IVY-396</a>
|
||||
*/
|
||||
@Test
|
||||
public void testResolveWithRelativeFile() {
|
||||
// IVY-396
|
||||
dependencyUpdateChecker.getProject().setProperty("ivy.dep.file",
|
||||
"test/java/org/apache/ivy/ant/ivy-simple.xml");
|
||||
dependencyUpdateChecker.execute();
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@ public class IvyInfoTest {
|
|||
assertNull(info.getProject().getProperty("ivy.configuration.private.desc"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-726.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-726">IVY-726</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY726() throws Exception {
|
||||
info.setFile(new File("test/java/org/apache/ivy/ant/ivy-info-all.xml"));
|
||||
|
|
@ -83,6 +89,12 @@ public class IvyInfoTest {
|
|||
assertTrue(info.getProject().getProperty("ivy.extra.branch") == null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-395.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-395">IVY-395</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY395() throws Exception {
|
||||
info.setFile(new File("test/java/org/apache/ivy/ant/ivy-artifact-info.xml"));
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public class IvyInstallTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Normal case; no confs set (should use the default->* configuration).
|
||||
* Normal case; no confs set (should use the default->* configuration).
|
||||
*/
|
||||
@Test
|
||||
public void testInstallWithConfsDefaultSettings() {
|
||||
|
|
@ -147,7 +147,10 @@ public class IvyInstallTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Test retrieving artifacts under only the master and runtime configuration.
|
||||
* Test case for IVY-1313.
|
||||
* Retrieve artifacts only for the master and runtime configuration.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1313">IVY-1313</a>
|
||||
*/
|
||||
@Test
|
||||
public void testInstallWithConfsRuntimeOnly() {
|
||||
|
|
@ -167,9 +170,14 @@ public class IvyInstallTest {
|
|||
assertFalse(new File("build/test/install/org1/mod3/jars/mod3-1.0.jar").exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1324.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1324">IVY-1324</a>
|
||||
*/
|
||||
@Test
|
||||
public void testInstallWithClassifiers() throws Exception {
|
||||
// IVY-1324
|
||||
project.setProperty("ivy.settings.url", new File("test/repositories/m2/ivysettings.xml")
|
||||
.toURI().toURL().toExternalForm());
|
||||
install.setOrganisation("org.apache");
|
||||
|
|
@ -236,6 +244,11 @@ public class IvyInstallTest {
|
|||
assertTrue(new File("build/test/install/org.apache/test/test-1.0.pom").exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-843.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-843">IVY-843</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY843() {
|
||||
project.setProperty("ivy.settings.file", "test/repositories/ivysettings-IVY843.xml");
|
||||
|
|
@ -288,9 +301,9 @@ public class IvyInstallTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Installing a module with namespace coordinates instead of system one should fail.
|
||||
* Installing a module with namespace coordinates instead of system one must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testInstallWithNamespace2() throws Exception {
|
||||
|
|
@ -323,7 +336,7 @@ public class IvyInstallTest {
|
|||
/**
|
||||
* Fail on unknown dependency when haltonfailure=true.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testDependencyNotFoundFailure() throws Exception {
|
||||
|
|
|
|||
|
|
@ -160,12 +160,17 @@ public class IvyPublishTest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1248.
|
||||
*
|
||||
* @throws IOException if something goes wrong
|
||||
* @throws ParseException if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1248">IVY-1248</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMergeParentWithoutPublishingParent() throws IOException, ParseException {
|
||||
// here we directly publish a module extending ivy-multiconf.xml,
|
||||
// the module parent is not published not yet in cache
|
||||
// See : IVY-1248
|
||||
|
||||
// update=true implies merge=true
|
||||
// project.setProperty("ivy.dep.file",
|
||||
// "test/java/org/apache/ivy/ant/ivy-extends-multiconf.xml");
|
||||
|
|
@ -185,13 +190,18 @@ public class IvyPublishTest {
|
|||
checkPublishedFile(published, "ivy-extends-merged.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1248.
|
||||
* Here we directly publish a module extending ivy-multiconf.xml,
|
||||
* the module parent is not published not yet in cache.
|
||||
*
|
||||
* @throws IOException if something goes wrong
|
||||
* @throws ParseException if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1248">IVY-1248</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMergeParentWithoutPublishingParentForceDeliver()
|
||||
throws IOException, ParseException {
|
||||
// here we directly publish a module extending ivy-multiconf.xml,
|
||||
// the module parent is not published not yet in cache
|
||||
// See : IVY-1248
|
||||
|
||||
IvyResolve resolve = new IvyResolve();
|
||||
resolve.setProject(project);
|
||||
resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-extends-multiconf.xml"));
|
||||
|
|
@ -218,8 +228,6 @@ public class IvyPublishTest {
|
|||
|
||||
@Test
|
||||
public void testMergeParentWithoutLocationAttribute() throws IOException, ParseException {
|
||||
// See : IVY-XXX
|
||||
|
||||
IvyResolve resolve = new IvyResolve();
|
||||
resolve.setProject(project);
|
||||
resolve.setFile(new File("test/java/org/apache/ivy/ant/extends/child1/ivy-child1.xml"));
|
||||
|
|
@ -711,7 +719,7 @@ public class IvyPublishTest {
|
|||
/**
|
||||
* Test must not publish ivy file with bad revision.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testBadNoDeliver() throws Exception {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ public class IvyResolveTest {
|
|||
TestHelper.cleanCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1455.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1455">IVY-1455</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY1455() throws Exception {
|
||||
project.setProperty("ivy.settings.file", "test/repositories/IVY-1455/ivysettings.xml");
|
||||
|
|
@ -87,6 +93,12 @@ public class IvyResolveTest {
|
|||
parallel.execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-779.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-779">IVY-779</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY779() throws Exception {
|
||||
Project project = TestHelper.newProject();
|
||||
|
|
@ -122,9 +134,14 @@ public class IvyResolveTest {
|
|||
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-630.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-630">IVY-630</a>
|
||||
*/
|
||||
@Test
|
||||
public void testResolveWithoutIvyFile() throws Exception {
|
||||
// IVY-630
|
||||
resolve.getProject().setProperty("ivy.settings.file",
|
||||
"test/repositories/IVY-630/ivysettings.xml");
|
||||
|
||||
|
|
@ -444,9 +461,13 @@ public class IvyResolveTest {
|
|||
assertFalse(project.getProperty("ivy.resolved.configurations").contains("default"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-396.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-396">IVY-396</a>
|
||||
*/
|
||||
@Test
|
||||
public void testResolveWithAbsoluteFile() {
|
||||
// IVY-396
|
||||
File ivyFile = new File("test/java/org/apache/ivy/ant/ivy-simple.xml");
|
||||
resolve.getProject().setProperty("ivy.dep.file", ivyFile.getAbsolutePath());
|
||||
resolve.execute();
|
||||
|
|
@ -455,9 +476,13 @@ public class IvyResolveTest {
|
|||
ModuleRevisionId.newInstance("apache", "resolve-simple", "1.0")).exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-396.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-396">IVY-396</a>
|
||||
*/
|
||||
@Test
|
||||
public void testResolveWithRelativeFile() {
|
||||
// IVY-396
|
||||
resolve.getProject().setProperty("ivy.dep.file",
|
||||
"test/java/org/apache/ivy/ant/ivy-simple.xml");
|
||||
resolve.execute();
|
||||
|
|
@ -615,7 +640,7 @@ public class IvyResolveTest {
|
|||
/**
|
||||
* Test a failing resolve.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testChildsFail() throws Exception {
|
||||
|
|
|
|||
|
|
@ -89,9 +89,14 @@ public class IvyRetrieveTest {
|
|||
"mod3.2", "jar", "jar", "private")).exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-992.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-992">IVY-992</a>
|
||||
*/
|
||||
@Test
|
||||
public void testValidateInIvySettings() throws Exception {
|
||||
// cfr IVY-992
|
||||
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-latest-extra.xml");
|
||||
retrieve.getSettings().setValidate(false);
|
||||
retrieve.execute();
|
||||
|
|
@ -222,9 +227,14 @@ public class IvyRetrieveTest {
|
|||
"mod1.2", "jar", "jar")).exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-304.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-304">IVY-304</a>
|
||||
*/
|
||||
@Test
|
||||
public void testUseOrigin() throws Exception {
|
||||
// test case for IVY-304
|
||||
// first we do a resolve with useOrigin=true in another project
|
||||
Project project = TestHelper.newProject();
|
||||
project.init();
|
||||
|
|
@ -268,6 +278,12 @@ public class IvyRetrieveTest {
|
|||
"ivy", "ivy", "xml")).exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-631.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-631">IVY-631</a>
|
||||
*/
|
||||
@Test
|
||||
public void testRetrieveWithOriginalNamePattern() throws Exception {
|
||||
retrieve.setFile(new File("test/java/org/apache/ivy/ant/ivy-631.xml"));
|
||||
|
|
@ -282,7 +298,7 @@ public class IvyRetrieveTest {
|
|||
/**
|
||||
* Retrieve without previous resolve must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailureWithoutAPreviousResolve() throws Exception {
|
||||
|
|
@ -295,7 +311,7 @@ public class IvyRetrieveTest {
|
|||
/**
|
||||
* Test must fail with default haltonfailure setting.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = BuildException.class)
|
||||
public void testFailure() throws Exception {
|
||||
|
|
@ -392,9 +408,13 @@ public class IvyRetrieveTest {
|
|||
assertFalse(new File("build/test/lib/default/unknown").exists());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-315.
|
||||
*
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-315">IVY-315</a>
|
||||
*/
|
||||
@Test
|
||||
public void testDoubleRetrieveWithDifferentConfigurations() {
|
||||
// IVY-315
|
||||
project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-doubleretrieve.xml");
|
||||
|
||||
retrieve.setConf("compile");
|
||||
|
|
|
|||
|
|
@ -70,6 +70,12 @@ public class DeliverTest {
|
|||
cache.mkdirs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-1111.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1111">IVY-1111</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY1111() throws Exception {
|
||||
Project project = ivyDeliver.getProject();
|
||||
|
|
|
|||
|
|
@ -55,11 +55,13 @@ public class IvyMakePomTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that a Ivy file containing a <code>classifier</code> extra-attribute in its dependency, when converted to a
|
||||
* POM file through {@link IvyMakePom}, retains the <code>classifier</code> in the generated POM
|
||||
* Test case for IVY-1528.
|
||||
* An Ivy file containing a <code>classifier</code> extra attribute in its dependency,
|
||||
* must retain the <code>classifier</code> in the generated POM when converted to
|
||||
* a POM file through {@link IvyMakePom}.
|
||||
*
|
||||
* @throws Exception
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1528">IVY-1528</a> for more details
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1528">IVY-1528</a>
|
||||
*/
|
||||
@Test
|
||||
public void testClassifier() throws Exception {
|
||||
|
|
|
|||
|
|
@ -178,6 +178,8 @@ public class PublishEventsTest {
|
|||
|
||||
/**
|
||||
* Test a simple artifact publish, without errors or overwrite settings.
|
||||
*
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testPublishNoOverwrite() throws IOException {
|
||||
|
|
@ -197,6 +199,8 @@ public class PublishEventsTest {
|
|||
|
||||
/**
|
||||
* Test a simple artifact publish, with overwrite set to true.
|
||||
*
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testPublishWithOverwrite() throws IOException {
|
||||
|
|
@ -220,6 +224,8 @@ public class PublishEventsTest {
|
|||
|
||||
/**
|
||||
* Test an attempted publish with an invalid data file path.
|
||||
*
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testPublishMissingFile() throws IOException {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -261,7 +261,7 @@ public class RetrieveTest {
|
|||
* This test is here to just test the deprecated {@code symlinkmass} option for retrieve task.
|
||||
* A version or two down the line, after 2.5 release, we can remove this test and the option altogether
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
|
|
@ -293,7 +293,7 @@ public class RetrieveTest {
|
|||
* {@link Files#exists(Path, LinkOption...) exists}
|
||||
*
|
||||
* @param filePath
|
||||
* @throws IOException
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
private void assertLinkOrExists(final String filePath) throws IOException {
|
||||
if (systemHasSymlinkAbility) {
|
||||
|
|
@ -416,9 +416,11 @@ public class RetrieveTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that the {@link RetrieveEngine} retrieves artifacts with the correct extension if the artifact is unpacked
|
||||
* Test case for IVY-1478.
|
||||
* {@link RetrieveEngine} must retrieve artifacts with the correct extension if the artifact
|
||||
* is unpacked.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1478">IVY-1478</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -445,31 +447,35 @@ public class RetrieveTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that more than one retrieve, with one having symlink enabled and the other not, doesn't lead to repository
|
||||
* cache corruption as reported in https://issues.apache.org/jira/browse/IVY-1498
|
||||
* Test case for IVY-1498.
|
||||
* More than one retrieve, one having symlink enabled and the other not,
|
||||
* must not lead to repository cache corruption.
|
||||
* <p>
|
||||
* The test does the following:
|
||||
* - Resolves a module, let's call it "irrelevant-A" which has a dependency on "org:foo-bar:1.2.3"
|
||||
* <p>
|
||||
* - Invokes a retrieve RT1, with {@link RetrieveOptions#setMakeSymlinks(boolean) symlinks true}
|
||||
* on that resolved module with a pattern that translates to a path "a/b/c/foo-bar.jar". When the RT1 retrieve is
|
||||
* done, the path "a/b/c/foo-bar.jar" will be a symlink to a path "repo/cache/org/foo-bar/foo-bar-1.2.3.jar" in the
|
||||
* Ivy cache.
|
||||
* on that resolved module with a pattern that translates to a path "a/b/c/foo-bar.jar". When the
|
||||
* RT1 retrieve is done, the path "a/b/c/foo-bar.jar" will be a symlink to a path
|
||||
* "repo/cache/org/foo-bar/foo-bar-1.2.3.jar" in the Ivy cache.
|
||||
* All fine so far.
|
||||
* <p>
|
||||
* - We then resolve another module, let's call it "irrelevant-B" which has a dependency on "org:foo-bar:2.3.4"
|
||||
* - We then resolve another module, let's call it "irrelevant-B" which has a dependency on
|
||||
* "org:foo-bar:2.3.4"
|
||||
* <p>
|
||||
* - Next, do a new retrieve RT2, on this newly resolved module with
|
||||
* {@link RetrieveOptions#setMakeSymlinks(boolean) symlinks false} and {@link RetrieveOptions#getOverwriteMode()
|
||||
* overwrite semantics enabled} and with the same pattern as before), that translates to a path "a/b/c/foo-bar.jar".
|
||||
* {@link RetrieveOptions#setMakeSymlinks(boolean) symlinks false} and
|
||||
* {@link RetrieveOptions#getOverwriteMode() overwrite semantics enabled}
|
||||
* and with the same pattern as before), that translates to a path "a/b/c/foo-bar.jar".
|
||||
* <p>
|
||||
* When RT2 retrieve is done, we expect the path "a/b/c/foo-bar.jar" will *not* be a symlink and instead be an actual file that represents
|
||||
* the org:foo-bar:2.3.4 artifact jar.
|
||||
* When RT2 retrieve is done, we expect the path "a/b/c/foo-bar.jar" will *not* be a symlink and
|
||||
* instead be an actual file that represents the org:foo-bar:2.3.4 artifact jar.
|
||||
* <p>
|
||||
* We also expect that this RT2 retrieve will not update/overwrite the file at path "repo/cache/org/foo-bar/foo-bar-1.2.3.jar"
|
||||
* in the Ivy cache - the file that was the end target of the symlink generated by the previous RT1.
|
||||
* We also expect that this RT2 retrieve will not update/overwrite the file at path
|
||||
* "repo/cache/org/foo-bar/foo-bar-1.2.3.jar" in the Ivy cache - the file that was the end
|
||||
* target of the symlink generated by the previous RT1.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1498">IVY-1498</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ public class XmlSettingsParserTest {
|
|||
/**
|
||||
* Test of resolver referencing a non existent cache.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testInvalidCache() throws Exception {
|
||||
|
|
@ -400,9 +400,14 @@ public class XmlSettingsParserTest {
|
|||
ivyPatterns.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-319.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-319">IVY-319</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMacroAndRef() throws Exception {
|
||||
// test case for IVY-319
|
||||
IvySettings settings = new IvySettings();
|
||||
XmlSettingsParser parser = new XmlSettingsParser(settings);
|
||||
parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-macro+ref.xml"));
|
||||
|
|
@ -423,9 +428,14 @@ public class XmlSettingsParserTest {
|
|||
assertTrue(shared instanceof FileSystemResolver);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-860.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-860">IVY-860</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMacroAndRef2() throws Exception {
|
||||
// test case for IVY-860
|
||||
IvySettings settings = new IvySettings();
|
||||
XmlSettingsParser parser = new XmlSettingsParser(settings);
|
||||
parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-macro+ref2.xml"));
|
||||
|
|
@ -646,10 +656,11 @@ public class XmlSettingsParserTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that a <code><ttl></code> containing the <code>matcher</code> attribute, in a ivy settings file,
|
||||
* works as expected.
|
||||
* Test case for IVY-1495.
|
||||
* <code><ttl></code> containing the <code>matcher</code> attribute,
|
||||
* in an ivy settings file, must work as expected.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1495">IVY-1495</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -673,7 +684,7 @@ public class XmlSettingsParserTest {
|
|||
/**
|
||||
* Tests that the <code>timeout-constraint</code> elements in a Ivy settings file are parsed correctly
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testTimeoutConstraints() throws Exception {
|
||||
|
|
@ -707,10 +718,10 @@ public class XmlSettingsParserTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that timeout constraints referenced by resolvers, in an ivy settings file, are processed correctly and the
|
||||
* corresponding resolvers use the right timeout constraints
|
||||
* Tests that timeout constraints referenced by resolvers, in an ivy settings file, are
|
||||
* processed correctly and the corresponding resolvers use the right timeout constraints
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testResolverTimeoutConstraintRefs() throws Exception {
|
||||
|
|
|
|||
|
|
@ -90,8 +90,10 @@ public class SortTest {
|
|||
|
||||
/**
|
||||
* Sorter does not throw circular dependency, circular dependencies are handled at resolve time
|
||||
* only. However the sort respect the transitive order when it is unambiguous. (if A depends
|
||||
* transitively of B, but B doesn't depends transitively on A then B always comes before A).
|
||||
* only. However the sort respect the transitive order when it is unambiguous. (If A depends
|
||||
* transitively of B, but B doesn't depends transitively on A, then B always comes before A.)
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testCircularDependency() throws Exception {
|
||||
|
|
@ -127,7 +129,12 @@ public class SortTest {
|
|||
}
|
||||
}
|
||||
|
||||
// Test IVY-624
|
||||
/**
|
||||
* Test case for IVY-624
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-624">IVY-624</a>
|
||||
*/
|
||||
@Test
|
||||
public void testCircularDependencyInfiniteLoop() throws Exception {
|
||||
addDependency(md1, "md2", "rev2");
|
||||
|
|
@ -213,8 +220,8 @@ public class SortTest {
|
|||
|
||||
/**
|
||||
* When the version asked by a dependency is not compatible with the version declared in the
|
||||
* module to order, the two modules should be considered as independent NB: I'm sure of what
|
||||
* 'compatible' means !
|
||||
* module to order, the two modules should be considered as independent.
|
||||
* NB: I'm sure of what 'compatible' means !
|
||||
*/
|
||||
@Test
|
||||
public void testDifferentVersionNotConsidered() {
|
||||
|
|
@ -339,7 +346,9 @@ public class SortTest {
|
|||
fail(errorMessage.toString());
|
||||
}
|
||||
|
||||
/** Returns a collection of lists that contains the elements a,b,c and d */
|
||||
/**
|
||||
* Returns a collection of lists that contains the elements a, b, c and d
|
||||
*/
|
||||
private Collection<List<ModuleDescriptor>> getAllLists(ModuleDescriptor a, ModuleDescriptor b,
|
||||
ModuleDescriptor c, ModuleDescriptor d) {
|
||||
final int nbOfList = 24;
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ public class OSGiManifestParserTest extends AbstractModuleDescriptorParserTester
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that the {@link OSGiManifestParser#parseDescriptor(ParserSettings, URL, Resource, boolean)} works fine for descriptors
|
||||
* that are backed by {@link FileResource}
|
||||
* Tests that the {@link OSGiManifestParser#parseDescriptor(ParserSettings, URL, Resource, boolean)}
|
||||
* works fine for descriptors that are backed by {@link FileResource}
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testFileResource() throws Exception {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public class LatestCompatibleConflictManagerTest {
|
|||
/**
|
||||
* Resolve must fail with a conflict.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = StrictConflictException.class)
|
||||
public void testConflict() throws Exception {
|
||||
|
|
@ -152,7 +152,7 @@ public class LatestCompatibleConflictManagerTest {
|
|||
/**
|
||||
* Resolve must fail with a conflict.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = StrictConflictException.class)
|
||||
public void testDynamicRootConflict() throws Exception {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,12 @@ public class LatestConflictManagerTest {
|
|||
FileUtil.forceDelete(_cache);
|
||||
}
|
||||
|
||||
// Test case for issue IVY-388
|
||||
/**
|
||||
* Test case for IVY-388.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-388">IVY-388</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIvy388() throws Exception {
|
||||
ResolveReport report = ivy.resolve(
|
||||
|
|
@ -78,7 +83,12 @@ public class LatestConflictManagerTest {
|
|||
}
|
||||
}
|
||||
|
||||
// Test case for issue IVY-383
|
||||
/**
|
||||
* Test case for IVY-383.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-383">IVY-383</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIvy383() throws Exception {
|
||||
ResolveReport report = ivy.resolve(
|
||||
|
|
@ -93,7 +103,12 @@ public class LatestConflictManagerTest {
|
|||
}
|
||||
}
|
||||
|
||||
// Test case for issue IVY-407
|
||||
/**
|
||||
* Test case for IVY-407.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-407">IVY-407</a>
|
||||
*/
|
||||
@Test
|
||||
public void testLatestTime1() throws Exception {
|
||||
ivy = new Ivy();
|
||||
|
|
@ -146,12 +161,19 @@ public class LatestConflictManagerTest {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Test case for issue IVY-407 (with transitivity) There are 5 modules A, B, C, D and E. 1)
|
||||
* publish C-1.0.0, C-1.0.1 and C-1.0.2 2) B needs C-1.0.0 : retrieve ok and publish B-1.0.0 3)
|
||||
* A needs B-1.0.0 and C-1.0.2 : retrieve ok and publish A-1.0.0 4) D needs C-1.0.1 : retrieve
|
||||
* ok and publish D-1.0.0 5) E needs D-1.0.0 and A-1.0.0 (D before A in ivy file) retrieve
|
||||
* failed to get C-1.0.2 from A (get apparently C-1.0.1 from D)
|
||||
/**
|
||||
* Test case for IVY-407 (with transitivity). There are 5 modules A, B, C, D and E.
|
||||
* <ol>
|
||||
* <li>publish C-1.0.0, C-1.0.1 and C-1.0.2</li>
|
||||
* <li>B needs C-1.0.0 : retrieve ok and publish B-1.0.0</li>
|
||||
* <li>A needs B-1.0.0 and C-1.0.2 : retrieve ok and publish A-1.0.0</li>
|
||||
* <li>D needs C-1.0.1 : retrieve ok and publish D-1.0.0</li>
|
||||
* <li>E needs D-1.0.0 and A-1.0.0 (D before A in ivy file) :
|
||||
* retrieve failed to get C-1.0.2 from A (get apparently C-1.0.1 from D)</li>
|
||||
* </ol>
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-407">IVY-407</a>
|
||||
*/
|
||||
@Test
|
||||
public void testLatestTimeTransitivity() throws Exception {
|
||||
|
|
@ -187,9 +209,10 @@ public class LatestConflictManagerTest {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Test case for issue IVY-1399:
|
||||
/**
|
||||
* Test case for IVY-1399.
|
||||
* Dependency tree:
|
||||
* <pre>
|
||||
* Mycompany#target;1
|
||||
* MyCompany#A;1
|
||||
* conflicting-dependency#dep;1
|
||||
|
|
@ -202,6 +225,10 @@ public class LatestConflictManagerTest {
|
|||
* ...
|
||||
* MyCompany#C;1
|
||||
* conflicting-dependency#dep;1
|
||||
* </pre>
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1399">IVY-1399</a>
|
||||
*/
|
||||
@Test
|
||||
public void testEvictedModules() throws Exception {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class StrictConflictManagerTest {
|
|||
/**
|
||||
* Resolve must fail with a conflict.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = StrictConflictException.class)
|
||||
public void testConflictResolve() throws Exception {
|
||||
|
|
@ -78,7 +78,7 @@ public class StrictConflictManagerTest {
|
|||
/**
|
||||
* Resolve must fail with a conflict.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = StrictConflictException.class)
|
||||
public void testConflictWithDynamicRevisionResolve() throws Exception {
|
||||
|
|
|
|||
|
|
@ -376,7 +376,12 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
dds[1].getDependencyRevisionId());
|
||||
}
|
||||
|
||||
// IVY-392
|
||||
/**
|
||||
* Test case for IVY-392.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-392">IVY-392</a>
|
||||
*/
|
||||
@Test
|
||||
public void testDependenciesWithInactiveProfile() throws Exception {
|
||||
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
|
||||
|
|
@ -451,9 +456,14 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
md.getModuleRevisionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-425.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-425">IVY-425</a>
|
||||
*/
|
||||
@Test
|
||||
public void testVariables() throws Exception {
|
||||
// test case for IVY-425
|
||||
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
|
||||
getClass().getResource("spring-hibernate3-2.0.2.pom"), false);
|
||||
assertNotNull(md);
|
||||
|
|
@ -469,9 +479,14 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
dds[10].getDependencyRevisionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-423.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-423">IVY-423</a>
|
||||
*/
|
||||
@Test
|
||||
public void testDependenciesInProfile() throws Exception {
|
||||
// test case for IVY-423
|
||||
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
|
||||
getClass().getResource("mule-module-builders-1.3.3.pom"), false);
|
||||
assertNotNull(md);
|
||||
|
|
@ -481,9 +496,14 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
md.getModuleRevisionId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-424.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-424">IVY-424</a>
|
||||
*/
|
||||
@Test
|
||||
public void testIVY424() throws Exception {
|
||||
// test case for IVY-424
|
||||
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
|
||||
getClass().getResource("shale-tiger-1.1.0-SNAPSHOT.pom"), false);
|
||||
assertNotNull(md);
|
||||
|
|
@ -634,9 +654,14 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
excludeAllTransitiveDepsDescriptor.isTransitive());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-417.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-417">IVY-417</a>
|
||||
*/
|
||||
@Test
|
||||
public void testWithPlugins() throws Exception {
|
||||
// test case for IVY-417
|
||||
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
|
||||
getClass().getResource("mule-1.3.3.pom"), false);
|
||||
assertNotNull(md);
|
||||
|
|
@ -683,7 +708,7 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
* Tests that if a module doesn't have a license specified, then parent pom's license (if any)
|
||||
* is used for the child module
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testLicenseFromParent() throws Exception {
|
||||
|
|
@ -704,7 +729,7 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
* Tests that if a project explicitly specifies the licenses, then the licenses (if any) from
|
||||
* its parent pom aren't applied to the child project
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testOverriddenLicense() throws Exception {
|
||||
|
|
@ -1059,10 +1084,11 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that a pom.xml which has references to properties that are either set via environment variables or system
|
||||
* properties, has its properties evaluated correctly.
|
||||
* Test case for IVY-1561.
|
||||
* A pom.xml which has references to properties that are either set via environment variables
|
||||
* or system properties, must have its properties evaluated correctly.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1561">IVY-1561</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -200,8 +200,8 @@ public class XmlModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
/**
|
||||
* Test must fail because of bad version.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ParseException
|
||||
* @throws IOException if something goes wrong
|
||||
* @throws ParseException if something goes wrong
|
||||
*/
|
||||
@Test(expected = ParseException.class)
|
||||
public void testBadVersion() throws IOException, ParseException {
|
||||
|
|
@ -1090,9 +1090,10 @@ public class XmlModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
}
|
||||
|
||||
/**
|
||||
* IVY-442: test for parser failure.
|
||||
* Test case for IVY-442: expect parser failure.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-442">IVY-442</a>
|
||||
*/
|
||||
@Test(expected = ParseException.class)
|
||||
public void testWithNonExistingConfigInDependency() throws Exception {
|
||||
|
|
@ -1103,7 +1104,7 @@ public class XmlModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
/**
|
||||
* Test for parser failure.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = ParseException.class)
|
||||
public void testWithNonExistingConfigInPublications() throws Exception {
|
||||
|
|
@ -1112,9 +1113,10 @@ public class XmlModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
}
|
||||
|
||||
/**
|
||||
* IVY-441: test for parser failure.
|
||||
* Test case for IVY-441: expect parser failure.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-441">IVY-441</a>
|
||||
*/
|
||||
@Test(expected = ParseException.class)
|
||||
public void testWithExistingConfigsInPublicationsSeparatedBySemiColon() throws Exception {
|
||||
|
|
@ -1459,8 +1461,8 @@ public class XmlModuleDescriptorParserTest extends AbstractModuleDescriptorParse
|
|||
* as encoded characters (for example <code>%2F</code>) then the module descriptor and the location of
|
||||
* the parent descriptor, are resolved and parsed correctly.
|
||||
*
|
||||
* @throws Exception
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1562">IVY-1562</a> for more details
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1562">IVY-1562</a>
|
||||
*/
|
||||
@Test
|
||||
public void testExtendsAbsoluteLocation() throws Exception {
|
||||
|
|
|
|||
|
|
@ -189,10 +189,10 @@ public class XmlModuleDescriptorWriterTest {
|
|||
/**
|
||||
* Test that the transitive attribute is written for non-transitive configurations.
|
||||
*
|
||||
* <code><conf ... transitive="false" ... /></code>
|
||||
* <code><conf ... transitive="false" ... /></code>
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1207">IVY-1207</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testTransitiveAttributeForNonTransitiveConfs() throws Exception {
|
||||
|
|
@ -219,8 +219,8 @@ public class XmlModuleDescriptorWriterTest {
|
|||
* This is the default and writing it will only add noise and cause a deviation from the known
|
||||
* behavior (before fixing IVY-1207).
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1207">IVY-1207</a>
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testTransitiveAttributeNotWrittenForTransitiveConfs() throws Exception {
|
||||
|
|
|
|||
|
|
@ -337,7 +337,12 @@ public class XmlModuleUpdaterTest {
|
|||
}
|
||||
}
|
||||
|
||||
// IVY-1356
|
||||
/**
|
||||
* Test case for IVY-1356.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1356">IVY-1356</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMergedUpdateWithExtendsAndExcludes() throws Exception {
|
||||
URL url = XmlModuleUpdaterTest.class.getResource("test-extends-dependencies-exclude.xml");
|
||||
|
|
|
|||
|
|
@ -29,19 +29,29 @@ import org.junit.Test;
|
|||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Testing Testing was the single biggest hurdle I faced. I have tried to provide a complete test
|
||||
* Testing was the single biggest hurdle I faced. I have tried to provide a complete test
|
||||
* suite that covers all protocols and which can be easily extended. It does differ - somewhat - in
|
||||
* structure from the resolver/repository test suites. Setting up smb, ftp, sftp will undoubtedly be
|
||||
* your biggest headache (it was mine). Here are a few notes about the setup: - the VFS test suite
|
||||
* uses the build/test/repositories area - when setting samba, sftp, etc. the corresponding user
|
||||
* needs both read and write privileges. - the tests assume that the user and password is the same
|
||||
* for all services. - a limited amount of configuration is available by setting the following
|
||||
* properties in the ivy.properties file: * vfs.host * vfs.username * vfs.password * vfs.samba_share
|
||||
* Running the test requires that commons-io and ant.jar are on the classpath. Also, I would
|
||||
* recommend that at some time the tests be converted from straight junit to something which betters
|
||||
* supports functional testing. Although somewhat crude I am using jsystem
|
||||
* your biggest headache (it was mine). Here are a few notes about the setup:
|
||||
* <ul>
|
||||
* <li>the VFS test suite uses the build/test/repositories area;
|
||||
* when setting samba, sftp, etc. the corresponding user needs both read and write privileges.</li>
|
||||
* <li>the tests assume that the user and password is the same for all services.</li>
|
||||
* <li>a limited amount of configuration is available by setting the following properties in the
|
||||
* <code>ivy.properties</code> file:</li>
|
||||
* </ul>
|
||||
* <pre>
|
||||
* vfs.host
|
||||
* vfs.username
|
||||
* vfs.password
|
||||
* vfs.samba_share
|
||||
* </pre>
|
||||
* Running the test requires that commons-io and ant jars are on the classpath. Also, I would
|
||||
* recommend that at some time the tests be converted from straight junit to something which better
|
||||
* supports functional testing. Although somewhat crude, I am using jsystem
|
||||
* (http://jsystemtest.sourceforge.net/) in other projects and am finding it a much better solution
|
||||
* than straight junit. Stephen Nesbitt
|
||||
* than straight junit.
|
||||
* <p>Stephen Nesbitt</p>
|
||||
*/
|
||||
public class VfsRepositoryTest {
|
||||
private VfsRepository repo = null;
|
||||
|
|
@ -70,7 +80,7 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Basic validation of happy path put - valid VFS URI and no conflict with existing file
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testPutValid() throws Exception {
|
||||
|
|
@ -98,7 +108,7 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Validate that we can overwrite an existing file
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testPutOverwriteTrue() throws Exception {
|
||||
|
|
@ -133,7 +143,7 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Validate that we put will respect a request not to overwrite an existing file
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test(expected = IOException.class)
|
||||
public void testPutOverwriteFalse() throws Exception {
|
||||
|
|
@ -152,7 +162,7 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Test the retrieval of an artifact from the repository creating a new artifact
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testGetNoExisting() throws Exception {
|
||||
|
|
@ -178,7 +188,7 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Test the retrieval of an artifact from the repository overwriting an existing artifact
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testGetOverwriteExisting() throws Exception {
|
||||
|
|
@ -209,6 +219,8 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Validate that we get a non null Resource instance when passed a well-formed VfsURI pointing
|
||||
* to an existing file
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testGetResourceValidExist() throws Exception {
|
||||
|
|
@ -227,6 +239,8 @@ public class VfsRepositoryTest {
|
|||
/**
|
||||
* Validate that we get a non null Resource instance when passed a well-formed VfsURI pointing
|
||||
* to a non-existent file.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testGetResourceValidNoExist() throws Exception {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public class VfsResourceTest {
|
|||
|
||||
/**
|
||||
* Validate VFSResource creation for a valid VFS URI pointing to an physically existing file
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testCreateResourceThatExists() throws Exception {
|
||||
|
|
@ -87,6 +89,8 @@ public class VfsResourceTest {
|
|||
/**
|
||||
* Validating that resource can be created for files which don't physically exists - e.g.
|
||||
* resources that are going to created.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testCreateResourceThatDoesntExist() throws Exception {
|
||||
|
|
@ -112,6 +116,8 @@ public class VfsResourceTest {
|
|||
|
||||
/**
|
||||
* Validate VFSResource creation when given a poorly formed VFS identifier
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testBadURI() throws Exception {
|
||||
|
|
@ -132,6 +138,8 @@ public class VfsResourceTest {
|
|||
|
||||
/**
|
||||
* Validate getChildren when given a VFS URI for a directory
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testListFolderChildren() throws Exception {
|
||||
|
|
@ -165,6 +173,8 @@ public class VfsResourceTest {
|
|||
/**
|
||||
* Validate that we don't get any results when we query a VFSResource file object for its
|
||||
* children
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testListFileChildren() throws Exception {
|
||||
|
|
@ -179,6 +189,8 @@ public class VfsResourceTest {
|
|||
/**
|
||||
* Validate that we don't get any results if we ask an IMAGINARY VFSResource - a nonexistent
|
||||
* file - for a list of its children
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testListImaginary() throws Exception {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class VfsTestHelper {
|
|||
*
|
||||
* @param resource
|
||||
* name of the resource
|
||||
* @return <class>List</class> of well-formed VFS resource identifiers
|
||||
* @return {@link List} of well-formed VFS resource identifiers
|
||||
*/
|
||||
public List<VfsURI> createVFSUriSet(String resource) {
|
||||
List<VfsURI> set = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public class VfsURI {
|
|||
/**
|
||||
* Return a well-formed VFS Resource identifier
|
||||
*
|
||||
* @return <code>String<code> representing a well formed VFS resource identifier
|
||||
* @return <code>String</code> representing a well formed VFS resource identifier
|
||||
*/
|
||||
public String getVfsURI() {
|
||||
StringBuilder uri = new StringBuilder();
|
||||
|
|
|
|||
|
|
@ -326,9 +326,14 @@ public class ChainResolverTest extends AbstractDependencyResolverTest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-206.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-206">IVY-206</a>
|
||||
*/
|
||||
@Test
|
||||
public void testFixedWithDefaultAndRealResolver() throws Exception {
|
||||
// test case for IVY-206
|
||||
ChainResolver chain = new ChainResolver();
|
||||
chain.setName("chain");
|
||||
chain.setSettings(settings);
|
||||
|
|
@ -416,9 +421,14 @@ public class ChainResolverTest extends AbstractDependencyResolverTest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-389.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-389">IVY-389</a>
|
||||
*/
|
||||
@Test
|
||||
public void testReturnFirstWithDefaultAndCacheAndRealResolver() throws Exception {
|
||||
// test case for IVY-389
|
||||
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
|
||||
ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), false);
|
||||
|
||||
|
|
@ -437,10 +447,14 @@ public class ChainResolverTest extends AbstractDependencyResolverTest {
|
|||
assertEquals(true, rmr.getDescriptor().isDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-207.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-207">IVY-207</a>
|
||||
*/
|
||||
public void testReturnFirstWithCheckModifiedAndDefaultAndCacheAndRealResolver()
|
||||
throws Exception {
|
||||
// test case for IVY-207
|
||||
|
||||
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
|
||||
ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), false);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ public class DualResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Test fails due to bad resolver configuration.
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws ParseException
|
||||
* @throws IOException if something goes wrong
|
||||
* @throws ParseException if something goes wrong
|
||||
*/
|
||||
@Test(expected = ParseException.class)
|
||||
public void testFromBadConf() throws IOException, ParseException {
|
||||
|
|
@ -99,7 +99,7 @@ public class DualResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Test fails due to bad resolver configuration
|
||||
*
|
||||
* @throws ParseException
|
||||
* @throws ParseException if something goes wrong
|
||||
*/
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testBad() throws ParseException {
|
||||
|
|
|
|||
|
|
@ -165,9 +165,14 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-676.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-676">IVY-676</a>
|
||||
*/
|
||||
@Test
|
||||
public void testFindIvyFileRefWithMultipleIvyPatterns() throws Exception {
|
||||
// cfr IVY-676
|
||||
FileSystemResolver resolver = new FileSystemResolver();
|
||||
resolver.setName("test");
|
||||
resolver.setSettings(settings);
|
||||
|
|
@ -263,7 +268,8 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
|
||||
/**
|
||||
* Tests that <code>SHA-256</code> algorithm can be used for checksums on resolvers
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testSHA256Checksum() throws Exception {
|
||||
|
|
@ -294,7 +300,7 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Tests that <code>SHA-512</code> algorithm can be used for checksums on resolvers
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testSHA512Checksum() throws Exception {
|
||||
|
|
@ -887,7 +893,7 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Publishing with transaction=true and an unsupported pattern must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testUnsupportedTransaction() throws Exception {
|
||||
|
|
@ -916,7 +922,7 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Publishing with transaction=true and an unsupported combination of patterns must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testUnsupportedTransaction2() throws Exception {
|
||||
|
|
@ -948,7 +954,7 @@ public class FileSystemResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Publishing with transaction=true and overwrite mode must fail.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testUnsupportedTransaction3() throws Exception {
|
||||
|
|
|
|||
|
|
@ -95,9 +95,10 @@ public class IvyRepResolverTest extends AbstractDependencyResolverTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* IVY-625: should fail if no ivyroot specified.
|
||||
* Test case for IVY-625. Must fail if no ivyroot specified.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-625">IVY-625</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMandatoryRoot() throws Exception {
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ public class URLResolverTest extends AbstractDependencyResolverTest {
|
|||
/**
|
||||
* Tests that the timeout constraint set on the URL resolver is used correctly by the resolver
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testTimeoutConstraint() throws Exception {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class TestXmlHelper {
|
|||
* @param xPathExpression The XPath expression to evaluate
|
||||
* @param returnType The expected return type of the {@link XPathExpression#evaluate(Object, QName) evaluation}
|
||||
* @return The result
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
public static Object evaluateXPathExpr(final File xmlFile, final XPathExpression xPathExpression, final QName returnType)
|
||||
throws Exception {
|
||||
|
|
@ -67,7 +67,7 @@ public class TestXmlHelper {
|
|||
* @param xpathExpression The XPath expression to evaluate
|
||||
* @param returnType The expected return type of the {@link XPathExpression#evaluate(Object, QName) evaluation}
|
||||
* @return The result
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
public static Object evaluateXPathExpr(final File xmlFile, final String xpathExpression, final QName returnType) throws Exception {
|
||||
return evaluateXPathExpr(xmlFile, XPathFactory.newInstance().newXPath().compile(xpathExpression), returnType);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,10 @@ import static org.junit.Assert.assertEquals;
|
|||
public class AbstractURLHandlerTest {
|
||||
|
||||
/**
|
||||
* JUnit test for IVY-923.
|
||||
* Test case for IVY-923.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-923">IVY-923</a>
|
||||
*/
|
||||
@Test
|
||||
public void testNormalizeToStringWithSpaceURL() throws Exception {
|
||||
|
|
@ -43,7 +46,10 @@ public class AbstractURLHandlerTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* JUnit test for IVY-923.
|
||||
* Test case for IVY-923.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-923">IVY-923</a>
|
||||
*/
|
||||
@Test
|
||||
public void testNormalizeToStringWithPlusCharacter() throws Exception {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class ApacheURLListerTest {
|
|||
/**
|
||||
* Tests {@link ApacheURLLister#retrieveListing(URL, boolean, boolean)}.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testRetrieveListing() throws Exception {
|
||||
|
|
@ -62,7 +62,7 @@ public class ApacheURLListerTest {
|
|||
/**
|
||||
* Tests {@link ApacheURLLister#retrieveListing(URL, boolean, boolean)}.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
*/
|
||||
@Test
|
||||
public void testRetrieveListingWithSpaces() throws Exception {
|
||||
|
|
|
|||
|
|
@ -80,10 +80,15 @@ public class HttpclientURLHandlerTest {
|
|||
assertFalse("URL resource was expected to be unreachable", handler.isReachable(new URL("http://www.google.fr/unknownpage.html"), defaultTimeoutConstraint));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for IVY-390.
|
||||
*
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-390">IVY-390</a>
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
public void testGetURLInfo() throws Exception {
|
||||
// IVY-390
|
||||
URLHandler handler = new HttpClientHandler();
|
||||
URLInfo info = handler
|
||||
.getURLInfo(new URL(
|
||||
|
|
@ -115,7 +120,7 @@ public class HttpclientURLHandlerTest {
|
|||
* Tests that the {@link HttpClientHandler}, backed by {@link CredentialsStore Ivy credentials store}
|
||||
* works as expected when it interacts with a HTTP server which requires authentication for accessing resources.
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1336">IVY-1336</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class IvyAuthenticatorTest {
|
|||
* relevant requesting information, including the {@link Authenticator#getRequestingURL() requesting URL} and
|
||||
* {@link Authenticator#getRequestorType() request type}
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws Exception if something goes wrong
|
||||
* @see <a href="https://issues.apache.org/jira/browse/IVY-1557">IVY-1557</a>
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue