-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worked on integration tests, DependencyFacetTest is half done
(dependency resolution and Gradle build properties must be better thought).
- Loading branch information
1 parent
467364f
commit 53b0d09
Showing
13 changed files
with
691 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,44 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>gradle-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>gradle-tests</artifactId> | ||
<name>Forge - Gradle Addon Tests</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>gradle</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>projects</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.test</groupId> | ||
<artifactId>forge-test-harness</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.test</groupId> | ||
<artifactId>arquillian-forge-classpath</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>gradle-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>gradle-tests</artifactId> | ||
<name>Forge - Gradle Addon Tests</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>gradle</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>projects</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.test</groupId> | ||
<artifactId>forge-test-harness</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.test</groupId> | ||
<artifactId>arquillian-forge-classpath</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>parser-java-api</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
tests/src/test/java/org/jboss/forge/addon/gradle/projects/ProjectAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package org.jboss.forge.addon.gradle.projects; | ||
|
||
import static org.junit.Assert.fail; | ||
|
||
import java.util.List; | ||
|
||
import org.jboss.forge.addon.dependencies.Dependency; | ||
import org.jboss.forge.addon.dependencies.DependencyRepository; | ||
import org.jboss.forge.addon.resource.DirectoryResource; | ||
|
||
public class ProjectAssert | ||
{ | ||
public static void assertContainsDirectoryNamed(List<DirectoryResource> dirs, String name) | ||
{ | ||
for (DirectoryResource dir : dirs) | ||
{ | ||
if (dir.getFullyQualifiedName().endsWith(name)) | ||
{ | ||
return; | ||
} | ||
} | ||
fail("List of directories doesn't contain directory named " + name); | ||
} | ||
|
||
public static void assertDirectoryIsOneOf(DirectoryResource dir, String... names) | ||
{ | ||
for (String name : names) | ||
{ | ||
if (dir.getFullyQualifiedName().endsWith(name)) | ||
{ | ||
return; | ||
} | ||
} | ||
fail(String.format("Directory [%s] is not one of %s", dir.getFullyQualifiedName(), names)); | ||
} | ||
|
||
public static void assertContainsDependency(List<Dependency> deps, String scope, String artifact, String group, | ||
String version) | ||
{ | ||
for (Dependency dep : deps) | ||
{ | ||
if (dep.getCoordinate().getArtifactId().equals(artifact) && | ||
dep.getCoordinate().getGroupId().equals(group) && | ||
dep.getCoordinate().getVersion().equals(version) && | ||
dep.getScopeType().equals(scope)) | ||
{ | ||
return; | ||
} | ||
} | ||
fail(String.format("Deps doesn't contain dependency %s '%s:%s:%s'", scope, group, artifact, version)); | ||
} | ||
|
||
public static void assertNotContainsDependency(List<Dependency> deps, String scope, String artifact, String group, | ||
String version) | ||
{ | ||
for (Dependency dep : deps) | ||
{ | ||
if (dep.getCoordinate().getArtifactId().equals(artifact) && | ||
dep.getCoordinate().getGroupId().equals(group) && | ||
dep.getCoordinate().getVersion().equals(version) && | ||
dep.getScopeType().equals(scope)) | ||
{ | ||
fail(String.format("Deps contains dependency %s '%s:%s:%s'", scope, group, artifact, version)); | ||
} | ||
} | ||
} | ||
|
||
public static void assertContainsRepository(List<DependencyRepository> repos, String url) | ||
{ | ||
for (DependencyRepository repo : repos) | ||
{ | ||
if (repo.getUrl().equals(url)) | ||
{ | ||
return; | ||
} | ||
} | ||
fail(String.format("Repositories doesn't contain repository with url %s", url)); | ||
} | ||
|
||
public static void assertNotContainsRepository(List<DependencyRepository> repos, String url) | ||
{ | ||
for (DependencyRepository repo : repos) | ||
{ | ||
if (repo.getUrl().equals(url)) | ||
{ | ||
fail(String.format("Repositories contains repository with url %s", url)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.