tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Borut BolĨina" <borut.bolc...@gmail.com>
Subject Re: First try at tapestry-test with no success
Date Thu, 04 Dec 2008 17:10:13 GMT
Hi,

I created src/test/java/bb.sandbox/myapp/integration/IntegrationTests.java

package bb.sandbox.myapp.integration;

import org.apache.tapestry5.test.AbstractIntegrationTestSuite;
import org.testng.annotations.Test;

@Test(timeOut = 50000, sequential = true)
public class IntegrationTests extends AbstractIntegrationTestSuite {

    @Test
    public void indexPageForCRUD() {
        open(BASE_URL);
        assertTextPresent("Foo Bar");
    }
}

but the test is not executing after running mvn test

...
[INFO] [surefire:test]
[INFO] Surefire report directory: C:\workarea\myapp\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------

I use T 5.0.17. Do I have to configure something else. In my POM I have a
dependency to tapestry-test of course.

Regards,
Borut


2008/8/1 Hugo Palma <hugo.m.palma@gmail.com>

> phew, it seems that you have to define a default servlet in the
> webdefault.xml file for this to work.
> I've created an issue for this to get documented (
> https://issues.apache.org/jira/browse/TAPESTRY-2549)
>
>
> Hugo Palma wrote:
>
>> Ok, it seems that this is because of a bug in Selenium (
>> http://jira.openqa.org/browse/SRC-225)
>> I don't this anymore after i started using Selenium 1.0-SNAPSHOT.
>>
>> Now i seem to be having a problem with JettyRunner. The jetty instance
>> seems to be up and running, i get no exceptions. But when i access the
>> application all i get is an empty page. I tried changing the location path
>> in the constructor to the place where maven creates the exploded war but
>> that didn't help.
>>
>> Again, any ideas ?
>>
>> Hugo Palma wrote:
>>
>>> This is my first try at using tapestry-test.
>>>
>>> I created a test class with a test method:
>>>
>>> public class SecurityTest extends AbstractIntegrationTestSuite
>>> {
>>> @Test
>>> public void redirectToLogin_test() throws Exception
>>> {
>>>  open(BASE_URL);
>>> }
>>> }
>>>
>>> I added an empty webdefault.xml file to the test/conf directory ( by the
>>> way, is there any way i can put this file in test/resources instead):
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>>>        version="2.4">
>>> </web-app>
>>>
>>> When i try to run the test from maven i starts fine, i even see the
>>> Tapestry outputing the list of pages and services, but then:
>>>
>>> - The test fails with:
>>> com.thoughtworks.selenium.SeleniumException: ERROR Server Exception:
>>> sessionId should not be null; has this session been started yet?
>>>   at
>>> com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:73)
>>>
>>>   at
>>> com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:154)
>>>
>>>   at
>>> org.apache.tapestry5.test.ErrorReportingCommandProcessor.reportError(ErrorReportingCommandProcessor.java:55)
>>>
>>>   at
>>> org.apache.tapestry5.test.ErrorReportingCommandProcessor.doCommand(ErrorReportingCommandProcessor.java:71)
>>>
>>>   at
>>> com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:234)
>>>   at
>>> org.apache.tapestry5.test.AbstractIntegrationTestSuite.open(AbstractIntegrationTestSuite.java:467)
>>>
>>>   at pt.myapp.SecurityTest.redirectToLogin_test(SecurityTest.java:11)
>>>
>>> - Even if i empty the test method i always get this exception in the end:
>>>
>>> java.lang.RuntimeException: Firefox refused shutdown while preparing a
>>> profile
>>>   at
>>> org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277)
>>>
>>>   at
>>> org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.launch(FirefoxCustomProfileLauncher.java:147)
>>>
>>>   at
>>> org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchRemoteSession(AbstractBrowserLauncher.java:24)
>>>
>>>   at
>>> org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:312)
>>>
>>>   at
>>> org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:113)
>>>
>>>   at
>>> org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:78)
>>>
>>>   at
>>> org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:653)
>>>
>>>   at
>>> org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:410)
>>>
>>>   at
>>> org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:388)
>>>
>>>   at
>>> org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:135)
>>>
>>>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>>>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>>>   at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>>>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
>>>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
>>>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
>>>   at
>>> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>>>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>>>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>>> Caused by:
>>> org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher$FileLockRemainedException:
>>> Lock file still present!
>>> C:\Windows\TEMP\customProfileDird7f55a38313b4af6ac2b1be07c127fc0\parent.lock
>>>
>>>   at
>>> org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFileLockToGoAway(FirefoxCustomProfileLauncher.java:235)
>>>
>>>   at
>>> org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:275)
>>>
>>>   ... 18 more
>>>
>>> Any ideas ?
>>>
>>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message