Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit 4d22947

Browse files
Fix build with Debug.FALSE
Let's use the Firefox driver instead of HTMLUnit, the HTMLUnit is not working properly. I am going to implement it later if necessary.
1 parent a5c455d commit 4d22947

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "java-cookie",
33
"devDependencies": {
4-
"js-cookie": "integration-api"
4+
"js-cookie": "master"
55
}
66
}

src/test/java/org/jscookie/test/integration/encoding/CookiesEncodingIT.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
import org.junit.runner.RunWith;
2424
import org.openqa.selenium.WebDriver;
2525
import org.openqa.selenium.firefox.FirefoxDriver;
26-
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
2726
import org.openqa.selenium.support.PageFactory;
2827

29-
import com.gargoylesoftware.htmlunit.BrowserVersion;
30-
3128
@RunWith( Arquillian.class )
3229
public class CookiesEncodingIT {
33-
private static Debug debug = Debug.TRUE;
30+
private static Debug debug = Debug.FALSE;
3431

3532
@Deployment
3633
public static Archive<?> createDeployment() {
@@ -66,7 +63,7 @@ public static Archive<?> createDeployment() {
6663
@RunAsClient
6764
@Test
6865
public void read_qunit_test( @ArquillianResource URL baseURL ) {
69-
WebDriver driver = createDriver();
66+
WebDriver driver = new FirefoxDriver();
7067
driver.manage().timeouts().implicitlyWait( 20, TimeUnit.SECONDS );
7168

7269
EncodingPageObject encoding = PageFactory.initElements( driver, EncodingPageObject.class );
@@ -78,21 +75,6 @@ public void read_qunit_test( @ArquillianResource URL baseURL ) {
7875
int actualPasses = results.getPassed();
7976
Assert.assertEquals( "should pass all tests", expectedPasses, actualPasses );
8077

81-
dispose( driver );
82-
}
83-
84-
private WebDriver createDriver() {
85-
if ( debug.is( true ) ) {
86-
return new FirefoxDriver();
87-
}
88-
89-
HtmlUnitDriver driver = new HtmlUnitDriver( BrowserVersion.CHROME );
90-
driver.setJavascriptEnabled( true );
91-
92-
return driver;
93-
}
94-
95-
private void dispose( WebDriver driver ) {
9678
if ( debug.is( false ) ) {
9779
driver.quit();
9880
}

src/test/java/org/jscookie/test/integration/encoding/EncodingServlet.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public void doGet( HttpServletRequest request, HttpServletResponse response )
2323
throws ServletException, IOException {
2424
String name = getUTF8Param( "name", request );
2525

26-
System.out.println( "--------------------" );
2726
System.out.println( "Testing: " + name );
2827

2928
Cookies cookies = Cookies.initFromServlet( request, response );
@@ -33,9 +32,6 @@ public void doGet( HttpServletRequest request, HttpServletResponse response )
3332
throw new NullPointerException( "Cookie not found with name: " + name );
3433
}
3534

36-
System.out.println( "Value: " + value );
37-
System.out.println( "--------------------" );
38-
3935
cookies.set( name, value );
4036

4137
response.setContentType( "application/json" );

0 commit comments

Comments
 (0)