Skip to content
Permalink
Browse files

Classpath entry merging for IntelliJ IDEA 2017.2.3

(cherry picked from commit 771cb3ff6bce814b33e37aaec314d2ac87cf3412)

# Conflicts:
#	changelog.txt
  • Loading branch information...
Alex Stockinger
Alex Stockinger committed Sep 13, 2017
1 parent 4cce6a6 commit 9cb6366f5ddef74301d969c45bb9dc33995f0b61
Showing with 34 additions and 0 deletions.
  1. +3 −0 changelog.txt
  2. +31 −0 core/src/main/java/fi/testee/classpath/ClasspathTransform.java
@@ -1,6 +1,9 @@
Version 0.7.0
- Added websocket support to testeefi-rest

Version 0.6.1
- Classpath entry merging for IntelliJ IDEA 2017.2.3

Version 0.6.0
- Hibernate support
- Custom params for @TestData methods can be contributed via TestDataSetupAccessorFactories now
@@ -84,6 +84,37 @@ private static URL getBuildDir(final DirectoryJavaArchive it) {
}

private static URL getBuildDir(final String path) {
{
final URL url = getBuildDirGradle(path);
if (url != null) {
return url;
}
}
{
final URL url = getBuildDirIntellij(path);
if (url != null) {
return url;
}
}
return null;
}

private static URL getBuildDirIntellij(final String path) {
final Pattern pattern = Pattern.compile("(.*/out/)((production)|(test))/((classes)|(resources))/?");
final Matcher matcher = pattern.matcher(path);
if (!matcher.matches()) {
return null;
}
final String url = matcher.group(1) + matcher.group(2) + "/[any]";
LOG.trace("{} -> {}", path, url);
try {
return new URL(url);
} catch (final MalformedURLException e) {
throw new TestEEfiException("Failed to build composite java archive URL", e);
}
}

private static URL getBuildDirGradle(final String path) {
final Pattern pattern = Pattern.compile("(.*/build/)(([^/]+)|([^/]+/[^/]+))/((main)|(test))/?");
final Matcher matcher = pattern.matcher(path);
if (!matcher.matches()) {

0 comments on commit 9cb6366

Please sign in to comment.
You can’t perform that action at this time.