mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
commit
c0edf1e44e
@ -13,8 +13,6 @@
|
||||
*/
|
||||
package com.mysema.codegen;
|
||||
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.tools.*;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
@ -26,6 +24,9 @@ import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.tools.*;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
/**
|
||||
@ -39,7 +40,7 @@ public class SimpleCompiler implements JavaCompiler {
|
||||
|
||||
private static final Joiner pathJoiner = Joiner.on(File.pathSeparator);
|
||||
|
||||
private static boolean isSureFireBooter(URLClassLoader cl) {
|
||||
protected static boolean isSureFireBooter(URLClassLoader cl) {
|
||||
for (URL url : cl.getURLs()) {
|
||||
if (url.getPath().contains("surefirebooter")) {
|
||||
return true;
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
*/
|
||||
package com.mysema.codegen;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
@ -17,9 +19,8 @@ import java.util.List;
|
||||
import javax.tools.JavaCompiler;
|
||||
import javax.tools.ToolProvider;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -75,6 +76,12 @@ public class SimpleCompilerTest {
|
||||
Assert.fail("Compilation Failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Surefire() {
|
||||
URLClassLoader cl = (URLClassLoader) Thread.currentThread().getContextClassLoader();
|
||||
assertTrue(SimpleCompiler.isSureFireBooter(cl));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user