本文整理匯總了Java中org.springframework.boot.loader.TestJarCreator類的典型用法代碼示例。如果您正苦於以下問題:Java TestJarCreator類的具體用法?Java TestJarCreator怎麽用?Java TestJarCreator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TestJarCreator類屬於org.springframework.boot.loader包,在下文中一共展示了TestJarCreator類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createArchive
import org.springframework.boot.loader.TestJarCreator; //導入依賴的package包/類
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();
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:25,代碼來源:ExplodedArchiveTests.java
示例2: setup
import org.springframework.boot.loader.TestJarCreator; //導入依賴的package包/類
@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();
}
示例3: setup
import org.springframework.boot.loader.TestJarCreator; //導入依賴的package包/類
@Before
public void setup() throws Exception {
this.rootJarFile = this.temporaryFolder.newFile();
TestJarCreator.createTestJar(this.rootJarFile);
this.jarFile = new JarFile(this.rootJarFile);
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:JarFileTests.java
示例4: setup
import org.springframework.boot.loader.TestJarCreator; //導入依賴的package包/類
@Before
public void setup() throws Exception {
this.jarFile = this.temporaryFolder.newFile();
TestJarCreator.createTestJar(this.jarFile);
this.jarData = new RandomAccessDataFile(this.jarFile);
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:CentralDirectoryParserTests.java
示例5: setup
import org.springframework.boot.loader.TestJarCreator; //導入依賴的package包/類
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);
}
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:JarFileArchiveTests.java