当前位置: 首页>>代码示例>>Java>>正文


Java Phanbedder.unpack方法代码示例

本文整理汇总了Java中net.anthavio.phanbedder.Phanbedder.unpack方法的典型用法代码示例。如果您正苦于以下问题:Java Phanbedder.unpack方法的具体用法?Java Phanbedder.unpack怎么用?Java Phanbedder.unpack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.anthavio.phanbedder.Phanbedder的用法示例。


在下文中一共展示了Phanbedder.unpack方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSeleniumGhostDriver

import net.anthavio.phanbedder.Phanbedder; //导入方法依赖的package包/类
@Test
public void testSeleniumGhostDriver() {

	File phantomjs = Phanbedder.unpack();
	DesiredCapabilities dcaps = new DesiredCapabilities();
	dcaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, phantomjs.getAbsolutePath());
	PhantomJSDriver driver = new PhantomJSDriver(dcaps);
	try {
		driver.get("https://www.google.com");
		WebElement query = driver.findElement(By.name("q"));
		query.sendKeys("Phanbedder");
		query.submit();

		Assertions.assertThat(driver.getTitle()).contains("Phanbedder");
	} finally {
		driver.quit();
	}
}
 
开发者ID:anthavio,项目名称:phanbedder,代码行数:19,代码来源:PhanbedderTest.java

示例2: testJavaIoTmpDirectory

import net.anthavio.phanbedder.Phanbedder; //导入方法依赖的package包/类
@Test
public void testJavaIoTmpDirectory() throws IOException, InterruptedException {
	File binary = Phanbedder.unpack();

	String javaIoTmpdir = System.getProperty("java.io.tmpdir");
	File expectedDir = new File(javaIoTmpdir, "phantomjs-" + Phanbedder.PHANTOMJS_VERSION);
	Assertions.assertThat(binary.getParentFile()).isEqualTo(expectedDir);
	assertProcessExecution(binary);

	long lastModified = binary.lastModified();

	File binary2 = Phanbedder.unpack(); //existing file is returned
	Assertions.assertThat(binary2.lastModified()).isEqualTo(lastModified); // SAME
	assertProcessExecution(binary2);

	binary.delete(); //purge cached
	Assertions.assertThat(binary.exists()).isFalse();
	Thread.sleep(1000); //1 second at least!

	File binary3 = Phanbedder.unpack(); //new file must be unpacked
	Assertions.assertThat(binary3.lastModified()).isNotEqualTo(lastModified); //DIFF
	assertProcessExecution(binary3);
}
 
开发者ID:anthavio,项目名称:phanbedder,代码行数:24,代码来源:PhanbedderTest.java

示例3: testLocalTargetDirectory

import net.anthavio.phanbedder.Phanbedder; //导入方法依赖的package包/类
@Test
public void testLocalTargetDirectory() throws IOException, InterruptedException {
	String targetDir = "target/phanbedder-test/unpack";
	String binaryPath = Phanbedder.unpack(targetDir);
	File binary = new File(binaryPath);

	String javaUserDir = System.getProperty("user.dir");
	Assertions.assertThat(binary.getParentFile()).isEqualTo(new File(javaUserDir, targetDir));
	assertProcessExecution(binary);

	long lastModified = binary.lastModified();

	String binaryPath2 = Phanbedder.unpack(targetDir); //existing file is returned
	File binary2 = new File(binaryPath2);
	Assertions.assertThat(binary2.lastModified()).isEqualTo(lastModified); // SAME
	assertProcessExecution(binary2);

	binary.delete(); //purge cached
	Assertions.assertThat(binary.exists()).isFalse();
	Thread.sleep(1000); //1 second at least!

	String binaryPath3 = Phanbedder.unpack(targetDir); //new file must be unpacked
	File binary3 = new File(binaryPath3);
	Assertions.assertThat(binary3.lastModified()).isNotEqualTo(lastModified); //DIFF
	assertProcessExecution(binary3);
}
 
开发者ID:anthavio,项目名称:phanbedder,代码行数:27,代码来源:PhanbedderTest.java

示例4: before

import net.anthavio.phanbedder.Phanbedder; //导入方法依赖的package包/类
@Override
public void before() {
    File phantomjs = Phanbedder.unpack();
    DesiredCapabilities dcaps = new DesiredCapabilities();
    dcaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, phantomjs.getAbsolutePath());
    driver = new PhantomJSDriver(dcaps);
}
 
开发者ID:autoschool,项目名称:ya.blogo,代码行数:8,代码来源:PhantomJSRule.java


注:本文中的net.anthavio.phanbedder.Phanbedder.unpack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。