Java 类org.springframework.boot.loader.TestJarCreator 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ExplodedArchiveTests.java   
private void createArchive(String folderName) throws Exception {
    File file = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(file);

    this.rootFolder = StringUtils.hasText(folderName)
            ? this.temporaryFolder.newFolder(folderName)
            : this.temporaryFolder.newFolder();
    JarFile jarFile = new JarFile(file);
    Enumeration<JarEntry> entries = jarFile.entries();
    while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        File destination = new File(
                this.rootFolder.getAbsolutePath() + File.separator + entry.getName());
        destination.getParentFile().mkdirs();
        if (entry.isDirectory()) {
            destination.mkdir();
        }
        else {
            copy(jarFile.getInputStream(entry), new FileOutputStream(destination));
        }
    }
    this.archive = new ExplodedArchive(this.rootFolder);
    jarFile.close();
}
项目:spring-boot-concourse    文件:ExplodedArchiveTests.java   
@Before
public void setup() throws Exception {
    File file = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(file);

    this.rootFolder = this.temporaryFolder.newFolder();
    JarFile jarFile = new JarFile(file);
    Enumeration<JarEntry> entries = jarFile.entries();
    while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        File destination = new File(
                this.rootFolder.getAbsolutePath() + File.separator + entry.getName());
        destination.getParentFile().mkdirs();
        if (entry.isDirectory()) {
            destination.mkdir();
        }
        else {
            copy(jarFile.getInputStream(entry), new FileOutputStream(destination));
        }
    }
    this.archive = new ExplodedArchive(this.rootFolder);
    jarFile.close();
}
项目:contestparser    文件:ExplodedArchiveTests.java   
@Before
public void setup() throws Exception {
    File file = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(file);

    this.rootFolder = this.temporaryFolder.newFolder();
    JarFile jarFile = new JarFile(file);
    Enumeration<JarEntry> entries = jarFile.entries();
    while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        File destination = new File(
                this.rootFolder.getAbsolutePath() + File.separator + entry.getName());
        destination.getParentFile().mkdirs();
        if (entry.isDirectory()) {
            destination.mkdir();
        }
        else {
            copy(jarFile.getInputStream(entry), new FileOutputStream(destination));
        }
    }
    this.archive = new ExplodedArchive(this.rootFolder);
    jarFile.close();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JarFileTests.java   
@Before
public void setup() throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.rootJarFile);
    this.jarFile = new JarFile(this.rootJarFile);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JarURLConnectionTests.java   
@Before
public void setup() throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.rootJarFile);
    this.jarFile = new JarFile(this.rootJarFile);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CentralDirectoryParserTests.java   
@Before
public void setup() throws Exception {
    this.jarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.jarFile);
    this.jarData = new RandomAccessDataFile(this.jarFile);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JarFileArchiveTests.java   
private void setup(boolean unpackNested) throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    this.rootJarFileUrl = this.rootJarFile.toURI().toString();
    TestJarCreator.createTestJar(this.rootJarFile, unpackNested);
    this.archive = new JarFileArchive(this.rootJarFile);
}
项目:spring-boot-concourse    文件:JarFileTests.java   
@Before
public void setup() throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.rootJarFile);
    this.jarFile = new JarFile(this.rootJarFile);
}
项目:spring-boot-concourse    文件:CentralDirectoryParserTests.java   
@Before
public void setup() throws Exception {
    this.jarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.jarFile);
    this.jarData = new RandomAccessDataFile(this.jarFile);
}
项目:spring-boot-concourse    文件:JarFileArchiveTests.java   
private void setup(boolean unpackNested) throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    this.rootJarFileUrl = this.rootJarFile.toURI().toString();
    TestJarCreator.createTestJar(this.rootJarFile, unpackNested);
    this.archive = new JarFileArchive(this.rootJarFile);
}
项目:contestparser    文件:JarFileTests.java   
@Before
public void setup() throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(this.rootJarFile);
    this.jarFile = new JarFile(this.rootJarFile);
}
项目:contestparser    文件:JarFileArchiveTests.java   
private void setup(boolean unpackNested) throws Exception {
    this.rootJarFile = this.temporaryFolder.newFile();
    this.rootJarFileUrl = this.rootJarFile.toURI().toString();
    TestJarCreator.createTestJar(this.rootJarFile, unpackNested);
    this.archive = new JarFileArchive(this.rootJarFile);
}