Re: unit testing Tapestry Services (5.4)

2015-05-27 Thread Lance Java
The ApplicationStateManager is injected by TapestryModule.class you will
either need to add this module to the registry or mock the service in a
test module (eg using mockito). Or, you might choose to split your own
module into smaller logical groups (eg core and web) for easier testing.

You might also find the TapestryIOCJUnit4ClassRunner useful which is
specifically designed to unit test tapestry-ioc services, examples here:

https://github.com/apache/tapestry-5/blob/master/tapestry-ioc-junit/src/test/java/org/apache/tapestry5/ioc/junit/


unit testing Tapestry Services (5.4)

2015-05-27 Thread Sumanth
Hi All,

I'm trying to unit test services (these are already existing services)  and
facing a few challenges.  I have a ProjectService which extends a
baseService and this base service has another service which is injected
into it.

Interface IProjectService {

Event getEvents(Long key)
}

ProjectService extends BaseSerivce implements IProjectService {

getEvents(Long key) {

  clientSession = getClientSession();
}
}

BaseService {

@Inject SessionService sessionService;

public ClientSession getClientSession() {

  return sessionService.getClientSession();
}
}

// Test Code //

public class IProjectServiceTest   {

  protected static Registry registry;

  @BeforeClass
  public void beforeTest() {
registry = new RegistryBuilder().add(AppModule.class).build();
registry.performRegistryStartup();
  }


  @Test
  public void getEvent() {

IProjectService projectService =
registry.getService(IProjectService.class);
Event event = projectService.getEvent(null);

Assert.assertEquals(event, null);
  }
}
// End ///


I'm trying to test this using testng and when i try to run this i get an
exception in AppModule
FAILED CONFIGURATION: @BeforeClass beforeTest
java.lang.IllegalArgumentException: Contribution
.wp.services.AppModule.CacheManagerCreator(MappedConfiguration) (at
AppModule.java:260) is for service 'interface
org.apache.tapestry5.services.ApplicationStateManager' qualified with
marker annotations [], which does not exist.

and if i extend IprojectServiceTest with extend TapestryTestCase then the
exception is
FAILED CONFIGURATION: @BeforeClass beforeTest
java.lang.IllegalArgumentException: Contribution
wp.services.AppModule.contributeComponentRequestHandler(OrderedConfiguration)
(at AppModule.java:108) is for service 'ComponentRequestHandler', which
does not exist.


 I just need to get the clientSession to get my event from a server call.

Thanks in advance,


Re: Testing Tapestry

2013-09-24 Thread Martin Kersten
Well I might have misunderstood the user guide here but the following is
true by checking the code:

1. The first (!) encountered constructor with a given annotation is choosen.
 Since the JVM makes no statement about the ordering of methods (and
constructors) in the class definition after the compile process,
 we have to rephrase the userguide statements to: A random method /
constructor being annotated with @Inject is choosen.

private static T extends Annotation Constructor
findConstructorByAnnotation(Constructor[] constructors,

ClassT annotationClass)
{
for (Constructor c : constructors)
{
if (c.getAnnotation(annotationClass) != null)
return c;
}

return null;
}


2. The method with the most parameters win. There is no distinction between
those parameters that can be injected and those who cant.

So we have to rephrase the inspect parameters and the method with the
most parameters that can (!) be injected by the IOC wins to
simply the constructor with the most parameters win regardless the
injectability. I dreamed about having more then one constructor
and just configure different services applying to different scenarios
(like using a certain library instead of providing a abstraction on top),
but nope I have to deal with it myself.

Here is the code part of selecting note the pragmatism by using sort
instead of a iterator with compare. I like it (really, straight forward
and fast enough).

 // Choose a constructor with the most parameters.
ComparatorConstructor comparator = new ComparatorConstructor() {
public int compare(Constructor o1, Constructor o2) {
return o2.getParameterTypes().length -
o1.getParameterTypes().length;
}
};
Arrays.sort(constructors, comparator);
return constructors[0];

I was looking for a way to ask the registry whether a service object for a
given class exists or can be created (there is no way to
ask if a certain service is already instanciated or at least proxiated). No
way to do that.

3. Annotating a parameter inside a constructor to mark it as Injectable is
not the same as putting a @Inject on top of the
constructor itself. Dont ask... just listen :(.


So here is what I do now, I just iterate over candidate methods and if it
finds more than one candidate it just spills out a certain
exception.

Invoker.on(target).call(methodName).with([informalName], [Type,]
value).annotatedWith(annotations...).invoke();

The with part fills in a parameter if the given type is spotted in the
parameter and the parameter does not have a inject
annotation. The order of with is valued. The informalName is just ignored
it is for documentation only to increase
readability.

I was eager to implement a overwrite where you can specify a certain
service interface being not injected but used
as provided. This way I would be able to pass a certain dependency to the
target but I dont have a concrete use
case so this would be overengineering, so its left out.

So invoker.on(myTask).call(process).with(timeout, 60).with(delay,
15).invoke();
This will make it possible to have a method, without knowing it.

MyTask {
 boolean process(@Inject service, int timeout, int delay) {
 }
}

I also added Invoker.newInstance(class) which just calls autobuild or
Invoker.getService(class) which asks the registry.

Thats it. Simple straight forward and does the job. And I only use it for
some spare situations where
I have to or just dont know what the given implementation will look like
since I will have processing tasks
that do not use the database at all etc. So I dont care for if(task
instanceof foo) anymore and I have
optional before and after methods.

Invoker.on(myTask).callAnyMethod().annotatedWith(Setup.class).invokeIfExists();

And yes this method calls really any method, not just the first found.



Cheers,

Martin (Kersten)


PS: @Thiago Pesti comes from pest and marks something as being sort of a
distraction or an annoyance.



2013/9/23 Thiago H de Paula Figueiredo thiag...@gmail.com

 On Mon, 23 Sep 2013 17:07:54 -0300, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Yeah thats what I was thinking about exactly. This way I can get rid of
 the pesti constructor injection.


 Pesti? What is that? If you were talking Brazilian Portuguese, I'd knew. :D


  Does anyone knows if the autobuild / build process fails if a property
 annotated @inject could not be injected? Kind of should be but I am quite
 not sure... .


 Try it and tell us what happened. ;)


 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: Testing Tapestry

2013-09-24 Thread Thiago H de Paula Figueiredo
On Tue, 24 Sep 2013 04:13:27 -0300, Martin Kersten  
martin.kersten...@gmail.com wrote:



Thats it. Simple straight forward and does the job. And I only use it for
some spare situations where I have to or just dont know what the given  
implementation will look like
since I will have processing tasks that do not use the database at all  
etc. So I dont care for if(task

instanceof foo) anymore and I have optional before and after methods.

Invoker.on(myTask).callAnyMethod().annotatedWith(Setup.class).invokeIfExists();

And yes this method calls really any method, not just the first found.


Nice! Any plans of opensourcing it? I'm curious to take a look.


PS: @Thiago Pesti comes from pest and marks something as being sort of a
distraction or an annoyance.


Same as in Brazilian Portuguese (peste). :)

--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry

2013-09-24 Thread Thiago H de Paula Figueiredo
On Tue, 24 Sep 2013 08:57:41 -0300, Martin Kersten  
martin.kersten...@gmail.com wrote:



Also the IOC needs a public constructor for autobuild. Fine I dont have
any... . Would have been a bug report. But I wont mind... .


That's not a bug, that OOP and Java working as they should. How could any  
code instantiate a class without a public constructor? That would be a  
violation of access constraints, and the JVM checks for that.


--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry

2013-09-24 Thread Martin Kersten
Well its a bug. I dont habe any constructor at all. Calm down and relax.
You dont need ans. Just call Class.newInstance and you are fine. That is
pro.level OOP. :-)
Am 24.09.2013 14:34 schrieb Thiago H de Paula Figueiredo 
thiag...@gmail.com:

 On Tue, 24 Sep 2013 08:57:41 -0300, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Also the IOC needs a public constructor for autobuild. Fine I dont have
 any... . Would have been a bug report. But I wont mind... .


 That's not a bug, that OOP and Java working as they should. How could any
 code instantiate a class without a public constructor? That would be a
 violation of access constraints, and the JVM checks for that.

 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: Testing Tapestry

2013-09-24 Thread Martin Kersten
Ok I found out what happends. The class is a private static class and so
the default constructor is private too. Boomer. You can still pass the
class along and issue newInstance on it. What a funny thing. So I just
check for it and do the newInstance myself and do field injection myself.
If I add a public empty constructor tapestry just does it. But I have the
inject field dependencies stuff already done (was a almost no brainer so
its ok.).


2013/9/24 Martin Kersten martin.kersten...@gmail.com

 Well its a bug. I dont habe any constructor at all. Calm down and relax.
 You dont need ans. Just call Class.newInstance and you are fine. That is
 pro.level OOP. :-)
 Am 24.09.2013 14:34 schrieb Thiago H de Paula Figueiredo 
 thiag...@gmail.com:

 On Tue, 24 Sep 2013 08:57:41 -0300, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Also the IOC needs a public constructor for autobuild. Fine I dont have
 any... . Would have been a bug report. But I wont mind... .


 That's not a bug, that OOP and Java working as they should. How could any
 code instantiate a class without a public constructor? That would be a
 violation of access constraints, and the JVM checks for that.

 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: Testing Tapestry

2013-09-24 Thread Thiago H de Paula Figueiredo
On Tue, 24 Sep 2013 13:18:25 -0300, Martin Kersten  
martin.kersten...@gmail.com wrote:



Well its a bug. I dont habe any constructor at all. Calm down and relax.
You dont need ans. Just call Class.newInstance and you are fine. That is
pro.level OOP. :-)


In the next message in this thread you said there was no accessible  
constructor due to the class being an inner static *private* one. I don't  
need to chill down (I really don't know why you said that) nor pro-level  
OOP lessons. By the way, that's called 'reflection'. ;) Actually, I taught  
OOP at graduate-level courses. ;)


Cheers!

--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry

2013-09-24 Thread Martin Kersten
 Actually, I taught OOP at graduate-level courses. ;)
Well I attended those Nothing much to say about. But maybe yours are
better than the one I needed to attend.

Also newInstance works just fine. Even on private static classes. No access
restriction here. Also having no default constructor seams to create a
private constructor. Weird but fun. Well if I add a public constructor
Tapestry also complains about the class being not public. Thanks. Redone it
myself and it works. No access restriction nothing. Even when doing it
outside of the package.

You wanna know why this works? Think about serialization etc. Wont work
without being that lax about access restrictions I think. And if you
wonder, Its just JDK 7 nothing special. Maybe it blows with sun but i dont
think so. Lets wait and see. And thats the way it always worked as long as
I can remember.


Cheers,

Martin Kersten,
Germany

PS: The OOP pro level stuff was just added with a smiely. It wasnt there to
get you on the chair.




2013/9/24 Thiago H de Paula Figueiredo thiag...@gmail.com

 On Tue, 24 Sep 2013 13:18:25 -0300, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Well its a bug. I dont habe any constructor at all. Calm down and relax.
 You dont need ans. Just call Class.newInstance and you are fine. That is
 pro.level OOP. :-)


 In the next message in this thread you said there was no accessible
 constructor due to the class being an inner static *private* one. I don't
 need to chill down (I really don't know why you said that) nor pro-level
 OOP lessons. By the way, that's called 'reflection'. ;) Actually, I taught
 OOP at graduate-level courses. ;)

 Cheers!


 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Testing Tapestry

2013-09-23 Thread Martin Kersten
I want some real hands on experiences. So please if you have any please
provide.

I am currently reworking the testing settup since the maven stuff is to
slow for my program test cycle.

Since I wont use testng I need to rewrite some test code. I need to do unit
testing in java
since I program in java. Integration test and Acceptance test may be done
in groovy
but I am in doupt this would be such a gain.

Well the unit testing I want to elaborate the IOC directly using only a
fraction of the
services the application is about. The IOC setup seams to be fairly fast so
it is ok
(Hibernate takes way longer)

I use a embedded jetty for the integration testing with a presetup in
memory database (h2).

I dont use mvn jetty:run since it is dead slow with all the dependency
setup and stuff.

So in the end I want to hear what you use for testing, what speed means and
if you
use IOC, jetty or something else.


And yes I searched the web high and low, I want just personal experiences
with
the background of embedding either a web application server or an IOC.


Cheers,

Martin (Kersten)


Re: Testing Tapestry

2013-09-23 Thread Dmitry Gusev
I use JUnit for unit testing with T5 services, and TestNG for (smoke)
integration testing my apps with URLs.

All my JUnit test classes inherited from BaseIntegrationTest (
https://gist.github.com/dmitrygusev/6672859),
all TestNG classes inherited from a copy of SeleniumTestCase with with this
patch applied:
https://issues.apache.org/jira/browse/TAP5-2107

Which is something you may already read while browsing the web.

Do you have any problems with this?


On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten martin.kersten...@gmail.com
 wrote:

 I want some real hands on experiences. So please if you have any please
 provide.

 I am currently reworking the testing settup since the maven stuff is to
 slow for my program test cycle.

 Since I wont use testng I need to rewrite some test code. I need to do unit
 testing in java
 since I program in java. Integration test and Acceptance test may be done
 in groovy
 but I am in doupt this would be such a gain.

 Well the unit testing I want to elaborate the IOC directly using only a
 fraction of the
 services the application is about. The IOC setup seams to be fairly fast so
 it is ok
 (Hibernate takes way longer)

 I use a embedded jetty for the integration testing with a presetup in
 memory database (h2).

 I dont use mvn jetty:run since it is dead slow with all the dependency
 setup and stuff.

 So in the end I want to hear what you use for testing, what speed means and
 if you
 use IOC, jetty or something else.


 And yes I searched the web high and low, I want just personal experiences
 with
 the background of embedding either a web application server or an IOC.


 Cheers,

 Martin (Kersten)




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Problems nope. I just habe to overhowle the system and wonder what people
nicht use. I will check your base clase out. Thanks for sharing.
Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:

 I use JUnit for unit testing with T5 services, and TestNG for (smoke)
 integration testing my apps with URLs.

 All my JUnit test classes inherited from BaseIntegrationTest (
 https://gist.github.com/dmitrygusev/6672859),
 all TestNG classes inherited from a copy of SeleniumTestCase with with this
 patch applied:
 https://issues.apache.org/jira/browse/TAP5-2107

 Which is something you may already read while browsing the web.

 Do you have any problems with this?


 On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
 martin.kersten...@gmail.com
  wrote:

  I want some real hands on experiences. So please if you have any please
  provide.
 
  I am currently reworking the testing settup since the maven stuff is to
  slow for my program test cycle.
 
  Since I wont use testng I need to rewrite some test code. I need to do
 unit
  testing in java
  since I program in java. Integration test and Acceptance test may be done
  in groovy
  but I am in doupt this would be such a gain.
 
  Well the unit testing I want to elaborate the IOC directly using only a
  fraction of the
  services the application is about. The IOC setup seams to be fairly fast
 so
  it is ok
  (Hibernate takes way longer)
 
  I use a embedded jetty for the integration testing with a presetup in
  memory database (h2).
 
  I dont use mvn jetty:run since it is dead slow with all the dependency
  setup and stuff.
 
  So in the end I want to hear what you use for testing, what speed means
 and
  if you
  use IOC, jetty or something else.
 
 
  And yes I searched the web high and low, I want just personal experiences
  with
  the background of embedding either a web application server or an IOC.
 
 
  Cheers,
 
  Martin (Kersten)
 



 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com



Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Is there anything to aid me with the usual service test. Currently I use
constructors to ease setup of the services. I will try out providing a test
module setting up the services and use tapestry IOC to create those. Should
have done so more early on, but wanted it simple first. But now when I have
three or four services to setup it becomes cumbersome.


2013/9/23 Martin Kersten martin.kersten...@gmail.com

 Thanks daniel. I will check the testify stuff in a real example.


 2013/9/23 Daniel Jue teamp...@gmail.com

 I don't have spare minutes at the moment, I just want to drop these links
 for you to look at (if you haven't seen them already).  Hope it helps.

 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

 and then this one

 http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


 Dan


 On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Problems nope. I just habe to overhowle the system and wonder what
 people
  nicht use. I will check your base clase out. Thanks for sharing.
  Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:
 
   I use JUnit for unit testing with T5 services, and TestNG for (smoke)
   integration testing my apps with URLs.
  
   All my JUnit test classes inherited from BaseIntegrationTest (
   https://gist.github.com/dmitrygusev/6672859),
   all TestNG classes inherited from a copy of SeleniumTestCase with with
  this
   patch applied:
   https://issues.apache.org/jira/browse/TAP5-2107
  
   Which is something you may already read while browsing the web.
  
   Do you have any problems with this?
  
  
   On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
   martin.kersten...@gmail.com
wrote:
  
I want some real hands on experiences. So please if you have any
 please
provide.
   
I am currently reworking the testing settup since the maven stuff
 is to
slow for my program test cycle.
   
Since I wont use testng I need to rewrite some test code. I need to
 do
   unit
testing in java
since I program in java. Integration test and Acceptance test may be
  done
in groovy
but I am in doupt this would be such a gain.
   
Well the unit testing I want to elaborate the IOC directly using
 only a
fraction of the
services the application is about. The IOC setup seams to be fairly
  fast
   so
it is ok
(Hibernate takes way longer)
   
I use a embedded jetty for the integration testing with a presetup
 in
memory database (h2).
   
I dont use mvn jetty:run since it is dead slow with all the
 dependency
setup and stuff.
   
So in the end I want to hear what you use for testing, what speed
 means
   and
if you
use IOC, jetty or something else.
   
   
And yes I searched the web high and low, I want just personal
  experiences
with
the background of embedding either a web application server or an
 IOC.
   
   
Cheers,
   
Martin (Kersten)
   
  
  
  
   --
   Dmitry Gusev
  
   AnjLab Team
   http://anjlab.com
  
 





Re: Testing Tapestry

2013-09-23 Thread Thiago H de Paula Figueiredo
http://tapestryxpath.sourceforge.net/ implements XPath over Tapestry  
Element objects.


On Mon, 23 Sep 2013 14:34:34 -0300, Daniel Jue teamp...@gmail.com wrote:


I don't have spare minutes at the moment, I just want to drop these links
for you to look at (if you haven't seen them already).  Hope it helps.

http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

and then this one

http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


Dan


On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
martin.kersten...@gmail.com wrote:

Problems nope. I just habe to overhowle the system and wonder what  
people

nicht use. I will check your base clase out. Thanks for sharing.
Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:

 I use JUnit for unit testing with T5 services, and TestNG for (smoke)
 integration testing my apps with URLs.

 All my JUnit test classes inherited from BaseIntegrationTest (
 https://gist.github.com/dmitrygusev/6672859),
 all TestNG classes inherited from a copy of SeleniumTestCase with with
this
 patch applied:
 https://issues.apache.org/jira/browse/TAP5-2107

 Which is something you may already read while browsing the web.

 Do you have any problems with this?


 On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
 martin.kersten...@gmail.com
  wrote:

  I want some real hands on experiences. So please if you have any  
please

  provide.
 
  I am currently reworking the testing settup since the maven stuff  
is to

  slow for my program test cycle.
 
  Since I wont use testng I need to rewrite some test code. I need to  
do

 unit
  testing in java
  since I program in java. Integration test and Acceptance test may be
done
  in groovy
  but I am in doupt this would be such a gain.
 
  Well the unit testing I want to elaborate the IOC directly using  
only a

  fraction of the
  services the application is about. The IOC setup seams to be fairly
fast
 so
  it is ok
  (Hibernate takes way longer)
 
  I use a embedded jetty for the integration testing with a presetup  
in

  memory database (h2).
 
  I dont use mvn jetty:run since it is dead slow with all the  
dependency

  setup and stuff.
 
  So in the end I want to hear what you use for testing, what speed  
means

 and
  if you
  use IOC, jetty or something else.
 
 
  And yes I searched the web high and low, I want just personal
experiences
  with
  the background of embedding either a web application server or an  
IOC.

 
 
  Cheers,
 
  Martin (Kersten)
 



 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com





--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You'll probably find better examples online, but in my Test classes I
usually have a method like this:


private MyDAOMyPojo,MyQueryObject dao;
@BeforeClass
public void beforeClass() {

// TODO Auto-generated constructor stub
System.out.println(MyDAOTest);
Registry registry;
RegistryBuilder builder = new RegistryBuilder();
builder.add(MyDAOModule.class);
registry = builder.build();
registry.performRegistryStartup();
dao = registry.getService(MyDAO.class);

}

@Test
public void f() {
MyQueryObject q = new MyQueryObject();
q.setAttribute(Martin);
ListMyPojo = dao.findByQuery(q);
//assert something here
}


In MyDAOModule.class, you can set up your services to build via
auto-binding, interface binding, or using a build method (public static
MyDAO buildMyDAO() { ... }  )
depending on your needs.


On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten martin.kersten...@gmail.com
 wrote:

 Is there anything to aid me with the usual service test. Currently I use
 constructors to ease setup of the services. I will try out providing a test
 module setting up the services and use tapestry IOC to create those. Should
 have done so more early on, but wanted it simple first. But now when I have
 three or four services to setup it becomes cumbersome.


 2013/9/23 Martin Kersten martin.kersten...@gmail.com

  Thanks daniel. I will check the testify stuff in a real example.
 
 
  2013/9/23 Daniel Jue teamp...@gmail.com
 
  I don't have spare minutes at the moment, I just want to drop these
 links
  for you to look at (if you haven't seen them already).  Hope it helps.
 
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/
 
  and then this one
 
  http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/
 
 
  Dan
 
 
  On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
  martin.kersten...@gmail.com wrote:
 
   Problems nope. I just habe to overhowle the system and wonder what
  people
   nicht use. I will check your base clase out. Thanks for sharing.
   Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:
  
I use JUnit for unit testing with T5 services, and TestNG for
 (smoke)
integration testing my apps with URLs.
   
All my JUnit test classes inherited from BaseIntegrationTest (
https://gist.github.com/dmitrygusev/6672859),
all TestNG classes inherited from a copy of SeleniumTestCase with
 with
   this
patch applied:
https://issues.apache.org/jira/browse/TAP5-2107
   
Which is something you may already read while browsing the web.
   
Do you have any problems with this?
   
   
On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
martin.kersten...@gmail.com
 wrote:
   
 I want some real hands on experiences. So please if you have any
  please
 provide.

 I am currently reworking the testing settup since the maven stuff
  is to
 slow for my program test cycle.

 Since I wont use testng I need to rewrite some test code. I need
 to
  do
unit
 testing in java
 since I program in java. Integration test and Acceptance test may
 be
   done
 in groovy
 but I am in doupt this would be such a gain.

 Well the unit testing I want to elaborate the IOC directly using
  only a
 fraction of the
 services the application is about. The IOC setup seams to be
 fairly
   fast
so
 it is ok
 (Hibernate takes way longer)

 I use a embedded jetty for the integration testing with a presetup
  in
 memory database (h2).

 I dont use mvn jetty:run since it is dead slow with all the
  dependency
 setup and stuff.

 So in the end I want to hear what you use for testing, what speed
  means
and
 if you
 use IOC, jetty or something else.


 And yes I searched the web high and low, I want just personal
   experiences
 with
 the background of embedding either a web application server or an
  IOC.


 Cheers,

 Martin (Kersten)

   
   
   
--
Dmitry Gusev
   
AnjLab Team
http://anjlab.com
   
  
 
 
 



Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Yeah thats what I was thinking about exactly. This way I can get rid of the
pesti constructor injection.

Does anyone knows if the autobuild / build process fails if a property
annotated @inject could not be injected? Kind of should be but I am quite
not sure... .


2013/9/23 Daniel Jue teamp...@gmail.com

 You'll probably find better examples online, but in my Test classes I
 usually have a method like this:


 private MyDAOMyPojo,MyQueryObject dao;
 @BeforeClass
 public void beforeClass() {

 // TODO Auto-generated constructor stub
 System.out.println(MyDAOTest);
 Registry registry;
 RegistryBuilder builder = new RegistryBuilder();
 builder.add(MyDAOModule.class);
 registry = builder.build();
 registry.performRegistryStartup();
 dao = registry.getService(MyDAO.class);

 }

 @Test
 public void f() {
 MyQueryObject q = new MyQueryObject();
 q.setAttribute(Martin);
 ListMyPojo = dao.findByQuery(q);
 //assert something here
 }


 In MyDAOModule.class, you can set up your services to build via
 auto-binding, interface binding, or using a build method (public static
 MyDAO buildMyDAO() { ... }  )
 depending on your needs.


 On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten 
 martin.kersten...@gmail.com
  wrote:

  Is there anything to aid me with the usual service test. Currently I use
  constructors to ease setup of the services. I will try out providing a
 test
  module setting up the services and use tapestry IOC to create those.
 Should
  have done so more early on, but wanted it simple first. But now when I
 have
  three or four services to setup it becomes cumbersome.
 
 
  2013/9/23 Martin Kersten martin.kersten...@gmail.com
 
   Thanks daniel. I will check the testify stuff in a real example.
  
  
   2013/9/23 Daniel Jue teamp...@gmail.com
  
   I don't have spare minutes at the moment, I just want to drop these
  links
   for you to look at (if you haven't seen them already).  Hope it helps.
  
  
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/
  
   and then this one
  
   http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/
  
  
   Dan
  
  
   On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
   martin.kersten...@gmail.com wrote:
  
Problems nope. I just habe to overhowle the system and wonder what
   people
nicht use. I will check your base clase out. Thanks for sharing.
Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com
 :
   
 I use JUnit for unit testing with T5 services, and TestNG for
  (smoke)
 integration testing my apps with URLs.

 All my JUnit test classes inherited from BaseIntegrationTest (
 https://gist.github.com/dmitrygusev/6672859),
 all TestNG classes inherited from a copy of SeleniumTestCase with
  with
this
 patch applied:
 https://issues.apache.org/jira/browse/TAP5-2107

 Which is something you may already read while browsing the web.

 Do you have any problems with this?


 On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
 martin.kersten...@gmail.com
  wrote:

  I want some real hands on experiences. So please if you have any
   please
  provide.
 
  I am currently reworking the testing settup since the maven
 stuff
   is to
  slow for my program test cycle.
 
  Since I wont use testng I need to rewrite some test code. I need
  to
   do
 unit
  testing in java
  since I program in java. Integration test and Acceptance test
 may
  be
done
  in groovy
  but I am in doupt this would be such a gain.
 
  Well the unit testing I want to elaborate the IOC directly using
   only a
  fraction of the
  services the application is about. The IOC setup seams to be
  fairly
fast
 so
  it is ok
  (Hibernate takes way longer)
 
  I use a embedded jetty for the integration testing with a
 presetup
   in
  memory database (h2).
 
  I dont use mvn jetty:run since it is dead slow with all the
   dependency
  setup and stuff.
 
  So in the end I want to hear what you use for testing, what
 speed
   means
 and
  if you
  use IOC, jetty or something else.
 
 
  And yes I searched the web high and low, I want just personal
experiences
  with
  the background of embedding either a web application server or
 an
   IOC.
 
 
  Cheers,
 
  Martin (Kersten)
 



 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com

   
  
  
  
 



Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
I don't have spare minutes at the moment, I just want to drop these links
for you to look at (if you haven't seen them already).  Hope it helps.

http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

and then this one

http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


Dan


On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
martin.kersten...@gmail.com wrote:

 Problems nope. I just habe to overhowle the system and wonder what people
 nicht use. I will check your base clase out. Thanks for sharing.
 Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:

  I use JUnit for unit testing with T5 services, and TestNG for (smoke)
  integration testing my apps with URLs.
 
  All my JUnit test classes inherited from BaseIntegrationTest (
  https://gist.github.com/dmitrygusev/6672859),
  all TestNG classes inherited from a copy of SeleniumTestCase with with
 this
  patch applied:
  https://issues.apache.org/jira/browse/TAP5-2107
 
  Which is something you may already read while browsing the web.
 
  Do you have any problems with this?
 
 
  On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   I want some real hands on experiences. So please if you have any please
   provide.
  
   I am currently reworking the testing settup since the maven stuff is to
   slow for my program test cycle.
  
   Since I wont use testng I need to rewrite some test code. I need to do
  unit
   testing in java
   since I program in java. Integration test and Acceptance test may be
 done
   in groovy
   but I am in doupt this would be such a gain.
  
   Well the unit testing I want to elaborate the IOC directly using only a
   fraction of the
   services the application is about. The IOC setup seams to be fairly
 fast
  so
   it is ok
   (Hibernate takes way longer)
  
   I use a embedded jetty for the integration testing with a presetup in
   memory database (h2).
  
   I dont use mvn jetty:run since it is dead slow with all the dependency
   setup and stuff.
  
   So in the end I want to hear what you use for testing, what speed means
  and
   if you
   use IOC, jetty or something else.
  
  
   And yes I searched the web high and low, I want just personal
 experiences
   with
   the background of embedding either a web application server or an IOC.
  
  
   Cheers,
  
   Martin (Kersten)
  
 
 
 
  --
  Dmitry Gusev
 
  AnjLab Team
  http://anjlab.com
 



Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Thanks daniel. I will check the testify stuff in a real example.


2013/9/23 Daniel Jue teamp...@gmail.com

 I don't have spare minutes at the moment, I just want to drop these links
 for you to look at (if you haven't seen them already).  Hope it helps.

 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

 and then this one

 http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


 Dan


 On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Problems nope. I just habe to overhowle the system and wonder what people
  nicht use. I will check your base clase out. Thanks for sharing.
  Am 23.09.2013 18:12 schrieb Dmitry Gusev dmitry.gu...@gmail.com:
 
   I use JUnit for unit testing with T5 services, and TestNG for (smoke)
   integration testing my apps with URLs.
  
   All my JUnit test classes inherited from BaseIntegrationTest (
   https://gist.github.com/dmitrygusev/6672859),
   all TestNG classes inherited from a copy of SeleniumTestCase with with
  this
   patch applied:
   https://issues.apache.org/jira/browse/TAP5-2107
  
   Which is something you may already read while browsing the web.
  
   Do you have any problems with this?
  
  
   On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
   martin.kersten...@gmail.com
wrote:
  
I want some real hands on experiences. So please if you have any
 please
provide.
   
I am currently reworking the testing settup since the maven stuff is
 to
slow for my program test cycle.
   
Since I wont use testng I need to rewrite some test code. I need to
 do
   unit
testing in java
since I program in java. Integration test and Acceptance test may be
  done
in groovy
but I am in doupt this would be such a gain.
   
Well the unit testing I want to elaborate the IOC directly using
 only a
fraction of the
services the application is about. The IOC setup seams to be fairly
  fast
   so
it is ok
(Hibernate takes way longer)
   
I use a embedded jetty for the integration testing with a presetup in
memory database (h2).
   
I dont use mvn jetty:run since it is dead slow with all the
 dependency
setup and stuff.
   
So in the end I want to hear what you use for testing, what speed
 means
   and
if you
use IOC, jetty or something else.
   
   
And yes I searched the web high and low, I want just personal
  experiences
with
the background of embedding either a web application server or an
 IOC.
   
   
Cheers,
   
Martin (Kersten)
   
  
  
  
   --
   Dmitry Gusev
  
   AnjLab Team
   http://anjlab.com
  
 



Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You can still use a constructor/constructor injection when registering your
service in your module, if you want. (In fact the auto binding looks for
the constructor with the most parameters, if none are marked with @Inject.)
 Or, you can use Field Injection.  Not sure if you can use both, probably
not.

If you have @Inject in your class X, and then register the class X in your
module, Tapestry should throw an error if it can't find the class Y to
inject into X.

HOWEVER, if you are instantiating the class outside of the registry, the
@Inject annotations are ignored.  I know this because I have an old-school
coworker who does not believe in Injection, and I have to make some
services construct-able by him.. *le sigh*






On Mon, Sep 23, 2013 at 4:07 PM, Martin Kersten martin.kersten...@gmail.com
 wrote:

 Yeah thats what I was thinking about exactly. This way I can get rid of the
 pesti constructor injection.

 Does anyone knows if the autobuild / build process fails if a property
 annotated @inject could not be injected? Kind of should be but I am quite
 not sure... .


 2013/9/23 Daniel Jue teamp...@gmail.com

  You'll probably find better examples online, but in my Test classes I
  usually have a method like this:
 
 
  private MyDAOMyPojo,MyQueryObject dao;
  @BeforeClass
  public void beforeClass() {
 
  // TODO Auto-generated constructor stub
  System.out.println(MyDAOTest);
  Registry registry;
  RegistryBuilder builder = new RegistryBuilder();
  builder.add(MyDAOModule.class);
  registry = builder.build();
  registry.performRegistryStartup();
  dao = registry.getService(MyDAO.class);
 
  }
 
  @Test
  public void f() {
  MyQueryObject q = new MyQueryObject();
  q.setAttribute(Martin);
  ListMyPojo = dao.findByQuery(q);
  //assert something here
  }
 
 
  In MyDAOModule.class, you can set up your services to build via
  auto-binding, interface binding, or using a build method (public static
  MyDAO buildMyDAO() { ... }  )
  depending on your needs.
 
 
  On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   Is there anything to aid me with the usual service test. Currently I
 use
   constructors to ease setup of the services. I will try out providing a
  test
   module setting up the services and use tapestry IOC to create those.
  Should
   have done so more early on, but wanted it simple first. But now when I
  have
   three or four services to setup it becomes cumbersome.
  
  
   2013/9/23 Martin Kersten martin.kersten...@gmail.com
  
Thanks daniel. I will check the testify stuff in a real example.
   
   
2013/9/23 Daniel Jue teamp...@gmail.com
   
I don't have spare minutes at the moment, I just want to drop these
   links
for you to look at (if you haven't seen them already).  Hope it
 helps.
   
   
  
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/
   
and then this one
   
http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/
   
   
Dan
   
   
On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
martin.kersten...@gmail.com wrote:
   
 Problems nope. I just habe to overhowle the system and wonder what
people
 nicht use. I will check your base clase out. Thanks for sharing.
 Am 23.09.2013 18:12 schrieb Dmitry Gusev 
 dmitry.gu...@gmail.com
  :

  I use JUnit for unit testing with T5 services, and TestNG for
   (smoke)
  integration testing my apps with URLs.
 
  All my JUnit test classes inherited from BaseIntegrationTest (
  https://gist.github.com/dmitrygusev/6672859),
  all TestNG classes inherited from a copy of SeleniumTestCase
 with
   with
 this
  patch applied:
  https://issues.apache.org/jira/browse/TAP5-2107
 
  Which is something you may already read while browsing the web.
 
  Do you have any problems with this?
 
 
  On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
  martin.kersten...@gmail.com
   wrote:
 
   I want some real hands on experiences. So please if you have
 any
please
   provide.
  
   I am currently reworking the testing settup since the maven
  stuff
is to
   slow for my program test cycle.
  
   Since I wont use testng I need to rewrite some test code. I
 need
   to
do
  unit
   testing in java
   since I program in java. Integration test and Acceptance test
  may
   be
 done
   in groovy
   but I am in doupt this would be such a gain.
  
   Well the unit testing I want to elaborate the IOC directly
 using
only a
   fraction of the
   services the application is about. The IOC setup seams to be
   fairly
 fast
  so
   it is ok
   (Hibernate takes way longer)
  
   I use a embedded jetty for the integration testing with a
  presetup
in
   memory database (h2).
  
   I dont use mvn jetty:run since it is dead slow with all the

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Well I knew that with the constructor it is exactly what the internal
method createMethodInvocationPlan is doing. The sad thing is I have to
recreate it since its internal.

This ignore Inject works for me since I use autobild method of the regitry.

PS: Everyone is aware of the @Autobuild method? You can create a property
or parameter, annotate with it and Tapestry builds it on the fly using
autobuild.

Just like:
Constructor(@Autobuild ArrayList list1, @Autobuild ArrayList list2) {
   assert list1 != list2;
}


Cheers,

Martin (Kersten)


2013/9/23 Daniel Jue teamp...@gmail.com

 You can still use a constructor/constructor injection when registering your
 service in your module, if you want. (In fact the auto binding looks for
 the constructor with the most parameters, if none are marked with @Inject.)
  Or, you can use Field Injection.  Not sure if you can use both, probably
 not.

 If you have @Inject in your class X, and then register the class X in your
 module, Tapestry should throw an error if it can't find the class Y to
 inject into X.

 HOWEVER, if you are instantiating the class outside of the registry, the
 @Inject annotations are ignored.  I know this because I have an old-school
 coworker who does not believe in Injection, and I have to make some
 services construct-able by him.. *le sigh*






 On Mon, Sep 23, 2013 at 4:07 PM, Martin Kersten 
 martin.kersten...@gmail.com
  wrote:

  Yeah thats what I was thinking about exactly. This way I can get rid of
 the
  pesti constructor injection.
 
  Does anyone knows if the autobuild / build process fails if a property
  annotated @inject could not be injected? Kind of should be but I am quite
  not sure... .
 
 
  2013/9/23 Daniel Jue teamp...@gmail.com
 
   You'll probably find better examples online, but in my Test classes I
   usually have a method like this:
  
  
   private MyDAOMyPojo,MyQueryObject dao;
   @BeforeClass
   public void beforeClass() {
  
   // TODO Auto-generated constructor stub
   System.out.println(MyDAOTest);
   Registry registry;
   RegistryBuilder builder = new RegistryBuilder();
   builder.add(MyDAOModule.class);
   registry = builder.build();
   registry.performRegistryStartup();
   dao = registry.getService(MyDAO.class);
  
   }
  
   @Test
   public void f() {
   MyQueryObject q = new MyQueryObject();
   q.setAttribute(Martin);
   ListMyPojo = dao.findByQuery(q);
   //assert something here
   }
  
  
   In MyDAOModule.class, you can set up your services to build via
   auto-binding, interface binding, or using a build method (public static
   MyDAO buildMyDAO() { ... }  )
   depending on your needs.
  
  
   On Mon, Sep 23, 2013 at 2:58 PM, Martin Kersten 
   martin.kersten...@gmail.com
wrote:
  
Is there anything to aid me with the usual service test. Currently I
  use
constructors to ease setup of the services. I will try out providing
 a
   test
module setting up the services and use tapestry IOC to create those.
   Should
have done so more early on, but wanted it simple first. But now when
 I
   have
three or four services to setup it becomes cumbersome.
   
   
2013/9/23 Martin Kersten martin.kersten...@gmail.com
   
 Thanks daniel. I will check the testify stuff in a real example.


 2013/9/23 Daniel Jue teamp...@gmail.com

 I don't have spare minutes at the moment, I just want to drop
 these
links
 for you to look at (if you haven't seen them already).  Hope it
  helps.


   
  
 
 http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/

 and then this one

 http://blog.tapestry5.de/index.php/2010/11/18/find-your-elements/


 Dan


 On Mon, Sep 23, 2013 at 12:49 PM, Martin Kersten 
 martin.kersten...@gmail.com wrote:

  Problems nope. I just habe to overhowle the system and wonder
 what
 people
  nicht use. I will check your base clase out. Thanks for sharing.
  Am 23.09.2013 18:12 schrieb Dmitry Gusev 
  dmitry.gu...@gmail.com
   :
 
   I use JUnit for unit testing with T5 services, and TestNG for
(smoke)
   integration testing my apps with URLs.
  
   All my JUnit test classes inherited from BaseIntegrationTest (
   https://gist.github.com/dmitrygusev/6672859),
   all TestNG classes inherited from a copy of SeleniumTestCase
  with
with
  this
   patch applied:
   https://issues.apache.org/jira/browse/TAP5-2107
  
   Which is something you may already read while browsing the
 web.
  
   Do you have any problems with this?
  
  
   On Mon, Sep 23, 2013 at 7:02 PM, Martin Kersten 
   martin.kersten...@gmail.com
wrote:
  
I want some real hands on experiences. So please if you have
  any
 please
provide.
   
I am currently reworking the testing settup since the maven
   stuff
 is to
slow for my program test cycle.
   
  

Re: Testing Tapestry

2013-09-23 Thread Thiago H de Paula Figueiredo
On Mon, 23 Sep 2013 17:07:54 -0300, Martin Kersten  
martin.kersten...@gmail.com wrote:


Yeah thats what I was thinking about exactly. This way I can get rid of  
the pesti constructor injection.


Pesti? What is that? If you were talking Brazilian Portuguese, I'd knew. :D


Does anyone knows if the autobuild / build process fails if a property
annotated @inject could not be injected? Kind of should be but I am quite
not sure... .


Try it and tell us what happened. ;)

--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Testing Tapestry without Seleinum

2012-10-29 Thread mbrooks
So I have a fairly complicated page that has a slider that filters by a date
range.  It gets all entries whose copyright dates fall in between the min
and max years.

I've tried like mad to figure out how to get the slider to activate properly
with Selenium and everything that was suggested online ended up hanging
Selenium and didn't work.

I then started looking to test this functionality outside of Selenium, but
since the parameters that I am dealing with are marked @Property
(copyrightMax, copyrightMin), my test class doesn't have any way to set
these two values - which would allow me to circumvent using Selenium to set
them via the slider).

Has anyone out there tried testing a page outside of Selenium?
If so, how did you set something that is marked @Property?

Thanks!
Melanie



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Testing-Tapestry-without-Seleinum-tp5717383.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry without Seleinum

2012-10-29 Thread Chris Poulsen
Replace @Property with getter/setter for the property?

-- 
Chris

On Mon, Oct 29, 2012 at 2:09 PM, mbrooks mela...@ifactory.com wrote:
 So I have a fairly complicated page that has a slider that filters by a date
 range.  It gets all entries whose copyright dates fall in between the min
 and max years.

 I've tried like mad to figure out how to get the slider to activate properly
 with Selenium and everything that was suggested online ended up hanging
 Selenium and didn't work.

 I then started looking to test this functionality outside of Selenium, but
 since the parameters that I am dealing with are marked @Property
 (copyrightMax, copyrightMin), my test class doesn't have any way to set
 these two values - which would allow me to circumvent using Selenium to set
 them via the slider).

 Has anyone out there tried testing a page outside of Selenium?
 If so, how did you set something that is marked @Property?

 Thanks!
 Melanie



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Testing-Tapestry-without-Seleinum-tp5717383.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry without Seleinum

2012-10-29 Thread mbrooks
Right. Except that Selenium keeps freezing whenever I try to get it to move a
slider. It works great for all the other components and I don't have time to
keep trying to drive a square peg into a round hole.

Just because something is supposed to work doesn't mean it always will.
I'd rather just try to test this outside of Selenium.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Testing-Tapestry-without-Seleinum-tp5717383p5717387.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry without Seleinum

2012-10-29 Thread mbrooks
Oh man, I wish I was using jQuery.  It's a component that lives in ProtoType. 
Might be why Selenium is choking on it .

Though, that's a good idea to see if I can't just set those values and still
use Selenium.
Thanks!




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Testing-Tapestry-without-Seleinum-tp5717383p5717390.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



RE: testing Tapestry applications (in general) [I]

2011-11-07 Thread Paul Field
Classification: For internal use only

You may also find Tapestry Testify useful 
(http://tapestry.formos.com/nightly/tapestry-testify/) - it's designed for the 
class of tests where you want to test the web aspects of your application 
(particularly in a unit-test style) but aren't concerned with browser 
functionality (e.g. Javascript).

On my projects, we used Selenium to drive tests of browser behaviour 
(Javascript etc) and to drive smoke tests of a complete running system. We used 
Testify to do unit testing of pages/components and (integrated with Fitnesse) 
to do acceptance tests where the web was involved (e.g. when the user does 
A,B,C then the page shows a table like this: . ). And then JUnit etc... to 
do the non-web unit testing.

Best wishes,
Paul



-Original Message-
From: Christian Köberl [mailto:tapestry.christian.koeb...@gmail.com]
Sent: 04 November 2011 18:55
To: Tapestry users
Subject: Re: testing Tapestry applications (in general)

2011/11/04 15:01, Markus Johnston:
 We very much would like to start writing view and controller tests.  I
 was wondering what other Tapestry users are doing, as far as testing
 is concerned.  What problems have you run into?  What tools or
 approaches have you found that work especially well?

We have a quite big application (200k lines) and needed some 
integration/acceptance end-to-end tests (as an addition to our unit tests).

Our first approach were TestNG tests based on Selenium 1.x and backend calls in 
the same VM as the application itself. The pros are that you can use the 
backend directly but you cannot test the app in the target environment. Another 
problem is that the QA and our customer cannot understand the TestNG specs. We 
also had big compatibility problems with Selenium and browsers.

Our current tests are built on BDD with cuke4duke with Selenium 2.x web driver. 
The tests run standalone and can be run against our QA or other environments. 
We are porting our old tests when we're changing/refactoring stuff.
Our experience with this stack:
cuke4duke is a Ruby port and not a 1st class JVM citizen, so you get some 
problems. That's why we think about migrating to JBehave - but that's no big 
deal because it works exactly the same. Selenium web driver is very good and 
also works perfectly with IE and different versions of Firefox. For acceptance 
tests and especially for UI tests consider to organize your tests in layers 
(see http://cuke4ninja.com/chp_three_layers.html).
We have a testhelper for making direct backend calls through Spring remoting - 
but just for things you cannot do via UI.

A really good book about organizing your builds and tests (and especially about 
automated testing) is Continuous Delivery from Jez Humble and David Farley: 
http://amzn.to/qy2rc5

After all tries (and some failures) I'd advise this:
 * Use BDD if you need to communicate tests in any way, use JUnit/TestNG 
otherwise
 * Layer your tests in workflows and technical stuff
 * Use Selenium 2.x web driver for UI tests
 * Write tests that run against any environment (your local started IDE 
instance, your QA server - even your prod environment)

Hope this helps ...

--
Chris

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional 
EU corporate and regulatory disclosures.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



testing Tapestry applications (in general)

2011-11-04 Thread Markus Johnston
We have been struggling (in my opinion) with a strategy to properly and
completely test our web application (developed using Tapestry).  We have
some unit tests, but they are all centered on the code closer to the model.
 We have very few, if any, view and controller tests.  We made some
attempts in the past to write selenium tests, but for whatever reason, that
did not catch on.  We have also attempted to use WebDriver along with Geb,
but continued to run into reliability issues with WebDriver and were
frustrated with the inability of the WebDriver developers to settle on an
API.  Geb has some nice features to it, though.

We very much would like to start writing view and controller tests.  I was
wondering what other Tapestry users are doing, as far as testing is
concerned.  What problems have you run into?  What tools or approaches have
you found that work especially well?


Re: testing Tapestry applications (in general)

2011-11-04 Thread Kalle Korhonen
Your mileage may vary but for my perspective, see
http://docs.codehaus.org/display/TYNAMO/2010/07/30/Full+web+integration+testing+in+a+single+JVM.
For service level tests, I tend to use Mockito a lot.

Kalle


On Fri, Nov 4, 2011 at 7:01 AM, Markus Johnston tapes...@garstasio.com wrote:
 We have been struggling (in my opinion) with a strategy to properly and
 completely test our web application (developed using Tapestry).  We have
 some unit tests, but they are all centered on the code closer to the model.
  We have very few, if any, view and controller tests.  We made some
 attempts in the past to write selenium tests, but for whatever reason, that
 did not catch on.  We have also attempted to use WebDriver along with Geb,
 but continued to run into reliability issues with WebDriver and were
 frustrated with the inability of the WebDriver developers to settle on an
 API.  Geb has some nice features to it, though.

 We very much would like to start writing view and controller tests.  I was
 wondering what other Tapestry users are doing, as far as testing is
 concerned.  What problems have you run into?  What tools or approaches have
 you found that work especially well?


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: testing Tapestry applications (in general)

2011-11-04 Thread Markus Johnston
I've found HTMLUnit, in the past to be utterly awful.  At least with our
web app (lots of ajax) HTMLUnit struggled and I ran into a lot of bugs.

On Fri, Nov 4, 2011 at 9:18 AM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:

 Your mileage may vary but for my perspective, see

 http://docs.codehaus.org/display/TYNAMO/2010/07/30/Full+web+integration+testing+in+a+single+JVM
 .
 For service level tests, I tend to use Mockito a lot.

 Kalle


 On Fri, Nov 4, 2011 at 7:01 AM, Markus Johnston tapes...@garstasio.com
 wrote:
  We have been struggling (in my opinion) with a strategy to properly and
  completely test our web application (developed using Tapestry).  We have
  some unit tests, but they are all centered on the code closer to the
 model.
   We have very few, if any, view and controller tests.  We made some
  attempts in the past to write selenium tests, but for whatever reason,
 that
  did not catch on.  We have also attempted to use WebDriver along with
 Geb,
  but continued to run into reliability issues with WebDriver and were
  frustrated with the inability of the WebDriver developers to settle on an
  API.  Geb has some nice features to it, though.
 
  We very much would like to start writing view and controller tests.  I
 was
  wondering what other Tapestry users are doing, as far as testing is
  concerned.  What problems have you run into?  What tools or approaches
 have
  you found that work especially well?
 

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: testing Tapestry applications (in general)

2011-11-04 Thread Kalle Korhonen
On Fri, Nov 4, 2011 at 10:25 AM, Markus Johnston tapes...@garstasio.com wrote:
 I've found HTMLUnit, in the past to be utterly awful.  At least with our
 web app (lots of ajax) HTMLUnit struggled and I ran into a lot of bugs.

Yeah, I've heard that a few times and my own experience in the past
was also that HTMLUnit couldn't cope with the bigger Javascript
stacks, however the newer versions (2.8, 2.9) manage to run current
versions of Prototype, jQuery in my apps just fine.

Kalle



 On Fri, Nov 4, 2011 at 9:18 AM, Kalle Korhonen
 kalle.o.korho...@gmail.comwrote:

 Your mileage may vary but for my perspective, see

 http://docs.codehaus.org/display/TYNAMO/2010/07/30/Full+web+integration+testing+in+a+single+JVM
 .
 For service level tests, I tend to use Mockito a lot.

 Kalle


 On Fri, Nov 4, 2011 at 7:01 AM, Markus Johnston tapes...@garstasio.com
 wrote:
  We have been struggling (in my opinion) with a strategy to properly and
  completely test our web application (developed using Tapestry).  We have
  some unit tests, but they are all centered on the code closer to the
 model.
   We have very few, if any, view and controller tests.  We made some
  attempts in the past to write selenium tests, but for whatever reason,
 that
  did not catch on.  We have also attempted to use WebDriver along with
 Geb,
  but continued to run into reliability issues with WebDriver and were
  frustrated with the inability of the WebDriver developers to settle on an
  API.  Geb has some nice features to it, though.
 
  We very much would like to start writing view and controller tests.  I
 was
  wondering what other Tapestry users are doing, as far as testing is
  concerned.  What problems have you run into?  What tools or approaches
 have
  you found that work especially well?
 

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: testing Tapestry applications (in general)

2011-11-04 Thread Markus Johnston
Thanks for the info.  I'll probably check out newer versions of HTMLUnit
then, to see if it is an option for us.

On Fri, Nov 4, 2011 at 12:48 PM, Kalle Korhonen
kalle.o.korho...@gmail.comwrote:

 On Fri, Nov 4, 2011 at 10:25 AM, Markus Johnston tapes...@garstasio.com
 wrote:
  I've found HTMLUnit, in the past to be utterly awful.  At least with our
  web app (lots of ajax) HTMLUnit struggled and I ran into a lot of bugs.

 Yeah, I've heard that a few times and my own experience in the past
 was also that HTMLUnit couldn't cope with the bigger Javascript
 stacks, however the newer versions (2.8, 2.9) manage to run current
 versions of Prototype, jQuery in my apps just fine.

 Kalle


 
  On Fri, Nov 4, 2011 at 9:18 AM, Kalle Korhonen
  kalle.o.korho...@gmail.comwrote:
 
  Your mileage may vary but for my perspective, see
 
 
 http://docs.codehaus.org/display/TYNAMO/2010/07/30/Full+web+integration+testing+in+a+single+JVM
  .
  For service level tests, I tend to use Mockito a lot.
 
  Kalle
 
 
  On Fri, Nov 4, 2011 at 7:01 AM, Markus Johnston tapes...@garstasio.com
 
  wrote:
   We have been struggling (in my opinion) with a strategy to properly
 and
   completely test our web application (developed using Tapestry).  We
 have
   some unit tests, but they are all centered on the code closer to the
  model.
We have very few, if any, view and controller tests.  We made some
   attempts in the past to write selenium tests, but for whatever reason,
  that
   did not catch on.  We have also attempted to use WebDriver along with
  Geb,
   but continued to run into reliability issues with WebDriver and were
   frustrated with the inability of the WebDriver developers to settle
 on an
   API.  Geb has some nice features to it, though.
  
   We very much would like to start writing view and controller tests.  I
  was
   wondering what other Tapestry users are doing, as far as testing is
   concerned.  What problems have you run into?  What tools or approaches
  have
   you found that work especially well?
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: testing Tapestry applications (in general)

2011-11-04 Thread Christian Köberl
2011/11/04 15:01, Markus Johnston:
 We very much would like to start writing view and controller tests.  I was
 wondering what other Tapestry users are doing, as far as testing is
 concerned.  What problems have you run into?  What tools or approaches have
 you found that work especially well?

We have a quite big application (200k lines) and needed some
integration/acceptance end-to-end tests (as an addition to our unit tests).

Our first approach were TestNG tests based on Selenium 1.x and backend
calls in the same VM as the application itself. The pros are that you
can use the backend directly but you cannot test the app in the target
environment. Another problem is that the QA and our customer cannot
understand the TestNG specs. We also had big compatibility problems with
Selenium and browsers.

Our current tests are built on BDD with cuke4duke with Selenium 2.x web
driver. The tests run standalone and can be run against our QA or other
environments. We are porting our old tests when we're
changing/refactoring stuff.
Our experience with this stack:
cuke4duke is a Ruby port and not a 1st class JVM citizen, so you get
some problems. That's why we think about migrating to JBehave - but
that's no big deal because it works exactly the same. Selenium web
driver is very good and also works perfectly with IE and different
versions of Firefox. For acceptance tests and especially for UI tests
consider to organize your tests in layers (see
http://cuke4ninja.com/chp_three_layers.html).
We have a testhelper for making direct backend calls through Spring
remoting - but just for things you cannot do via UI.

A really good book about organizing your builds and tests (and
especially about automated testing) is Continuous Delivery from Jez
Humble and David Farley: http://amzn.to/qy2rc5

After all tries (and some failures) I'd advise this:
 * Use BDD if you need to communicate tests in any way, use JUnit/TestNG
otherwise
 * Layer your tests in workflows and technical stuff
 * Use Selenium 2.x web driver for UI tests
 * Write tests that run against any environment (your local started IDE
instance, your QA server - even your prod environment)

Hope this helps ...

-- 
Chris

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Unit testing Tapestry within intellij?

2011-07-14 Thread Julien Martin
yes. I actually sorted the problem. I had forgotten to include servet api as
a provided dependency in my pom.xml.
Thanks Mark.
Julien.

2011/7/14 Mark mark-li...@xeric.net

 Do you actually have a page in com.cheetah.web.pages that is called
 CreateJobPosting that you can view in a web browser when the app is
 running?

 Mark


 On Tue, Jul 12, 2011 at 12:11 PM, Julien Martin bal...@gmail.com wrote:

  *public class CreateJobPosting{
 
 @Test
 public void test1() {
 String appPackage = com.cheetah.web;
 String appName = app;
 PageTester tester = new PageTester(appPackage, appName,
  src/main/webapp);
 Document doc = tester.renderPage(CreateJobPosting);
 }
  }
  *
 

 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




Re: Unit testing Tapestry within intellij?

2011-07-13 Thread Mark
Do you actually have a page in com.cheetah.web.pages that is called
CreateJobPosting that you can view in a web browser when the app is
running?

Mark


On Tue, Jul 12, 2011 at 12:11 PM, Julien Martin bal...@gmail.com wrote:

 *public class CreateJobPosting{

    @Test
    public void test1() {
        String appPackage = com.cheetah.web;
        String appName = app;
        PageTester tester = new PageTester(appPackage, appName,
 src/main/webapp);
        Document doc = tester.renderPage(CreateJobPosting);
    }
 }
 *


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Unit testing Tapestry within intellij?

2011-07-12 Thread Julien Martin
Hello,
I am trying to follow the unit testing tutorial provided here:
http://tapestry.apache.org/unit-testing-pages-or-components.html and I am
not able to run the tests from Intellij. Here is what I get:

*com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4
tests.CreateJobPosting
log4j:WARN No appenders could be found for logger
(org.apache.tapestry5.ioc.RegistryBuilder).
log4j:WARN Please initialize the log4j system properly.

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)
at java.lang.Class.privateGetPublicMethods(Class.java:2564)
at java.lang.Class.getMethods(Class.java:1427)
at
org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl.init(DefaultModuleDefImpl.java:148)
at
org.apache.tapestry5.ioc.RegistryBuilder.add(RegistryBuilder.java:124)
at
org.apache.tapestry5.internal.TapestryAppInitializer.addModules(TapestryAppInitializer.java:186)
at
org.apache.tapestry5.internal.TapestryAppInitializer.init(TapestryAppInitializer.java:136)
at org.apache.tapestry5.test.PageTester.init(PageTester.java:106)
at tests.CreateJobPosting.test1(CreateJobPosting.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException:
javax.servlet.http.HttpServletRequest
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 36 more


Process finished with exit code 255
*
Can anyone please help me: I am new to Tapestry and Intellij...

Thanks in advance,

Julien.

PS. Here is the content of my java class:

*public class CreateJobPosting{

@Test
public void test1() {
String appPackage = com.cheetah.web;
String appName = app;
PageTester tester = new PageTester(appPackage, appName,
src/main/webapp);
Document doc = tester.renderPage(CreateJobPosting);
}
}
*


Re: Testing Tapestry webapps with Selenium

2011-01-27 Thread Mark
On Thu, Jan 27, 2011 at 1:54 AM, Ulrich Stärk u...@spielviel.de wrote:
 Since these are edit or delete links this would be ambigous. I guess there
 will be dozens of links called edit on that page.

Hm.  So do you know anything about the item you are trying to delete
or edit? If you know the id, you can work that into the id tag and
select on that.  If you know the position, you can select based on the
position.   There might be a way to use Xpath to basically say:
select the edit link after the words 'blue widget' but I'm not sure
exactly how you would do that.

If you don't know any of these things about what you are trying to
click, I'm not sure you can run selenium in any type of deterministic
manner because your selection must be based on something outside the
system.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-26 Thread Matias Moran
Hi!

It's probably better to use an approach like Mark's suggestion in my case, 
given that I have no idea the IDs of the elements, because these depend on the 
database.
But, the problem here is that I don't know the position in the Grid of the 
elements. So, is there a way to iterate the rows of a Grid, looking for a 
particular element?

Thanks for the responses! Cheers!

Matias.


--- El mar 25-ene-11, Mark mark-li...@xeric.net escribió:

 De: Mark mark-li...@xeric.net
 Asunto: Re: Testing Tapestry webapps with Selenium
 Para: Tapestry users users@tapestry.apache.org
 Fecha: martes, 25 de enero de 2011, 20:36
 Using the userId as shown above is
 probably your best bet. However, if
 you don't have a userId an you are getting ids like:
 modifyUserLink_f8ab4c23
 
 You might try something like this:
 click(xpath=(//a[starts-with(@id,'modifyUserLink')])[3]);
 
 That would click on the third item that is found with an id
 starting
 with modifyUserLink.
 
 Mark
 
 On Tue, Jan 25, 2011 at 2:10 PM, Igor Drobiazko
 igor.drobia...@gmail.com
 wrote:
  If you don't like to provide client-ids besides t:id,
 you might create a
  mixin which will force t:id to be id as well.
 
  On Tue, Jan 25, 2011 at 9:03 PM, Matias Moran 
  matiasmo...@yahoo.com.arwrote:
 
  Thanks a lot Thiago!
 
  I will try something like this, I was hoping I
 didn't need to use IDs, but
  if there is no other solution, it is better than
 nothing.
 
  Thanks again! Greetings!
 
  Matias.
 
 
  --- El mar 25-ene-11, Thiago H. de Paula
 Figueiredo thiag...@gmail.com
  escribió:
 
   De: Thiago H. de Paula Figueiredo thiag...@gmail.com
   Asunto: Re: Testing Tapestry webapps with
 Selenium
   Para: Tapestry users users@tapestry.apache.org
   Fecha: martes, 25 de enero de 2011, 17:57
   On Tue, 25 Jan 2011 17:51:53 -0200,
   Matias Moran matiasmo...@yahoo.com.ar
   wrote:
  
The code generated by Selenium is
 something like
   this:
   
  
 
 selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);
  
   When inside a loop, if you don't provide the
 id for your
   ActionLinks, they'll generate different ids
 for them.
  
   Try something like this:
  
   t:actionLink t:id=modifyUserLink
 context=user.id
   id=actionLink-${user.id}/
   selenium.click(actionLink-1); // or some
 valid user id
   instead of 1
  
   --Thiago H. de Paula Figueiredo
   Independent Java, Apache Tapestry 5 and
 Hibernate
   consultant, developer, and instructor
   Owner, Ars Machina Tecnologia da Informação
 Ltda.
   http://www.arsmachina.com.br
  
  
 -
   To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
   For additional commands, e-mail: users-h...@tapestry.apache.org
  
  
 
 
 
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
  --
  Best regards,
 
  Igor Drobiazko
  http://tapestry5.de
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 




-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-26 Thread Mark
On Wed, Jan 26, 2011 at 5:14 AM, Matias Moran matiasmo...@yahoo.com.ar wrote:

 But, the problem here is that I don't know the position in the Grid of the 
 elements. So, is there a way to iterate the rows of a Grid, looking for a 
 particular element?

Do you know the name of the link? Can you use something like:
click(“link=Text Of Link”);

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-26 Thread Ulrich Stärk
Since these are edit or delete links this would be ambigous. I guess there will be dozens of links 
called edit on that page.


On 26.01.2011 15:49, Mark wrote:

On Wed, Jan 26, 2011 at 5:14 AM, Matias Moranmatiasmo...@yahoo.com.ar  wrote:


But, the problem here is that I don't know the position in the Grid of the 
elements. So, is there a way to iterate the rows of a Grid, looking for a 
particular element?


Do you know the name of the link? Can you use something like:
click(“link=Text Of Link”);

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Testing Tapestry webapps with Selenium

2011-01-25 Thread Matias Moran
Dear Tapestry users, how are you?

I'm writing because in the last few days we have been implementing integration 
tests using Selenium, but we have found a few issues that I'm not sure if these 
are our mistakes, or maybe it is not possible to be tested.

One of those issues appear when trying to click on an actionLink inside a Grid 
component, lets say a link to Delete or Modify one of the rows. The error is 
always the same: com.thoughtworks.selenium.SeleniumException: ERROR: Element 
nameOfTheElement not found.

We tried different variations of the element name, including using XPath. But 
none of these worked. The question is: is it possible to test Tapestry 
actionLinks inside Grids or other components using Selenium generated tests?

Thanks in advance! Greetings. 

Matias.




 

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Igor Drobiazko
Yes, it is possible. If you provide your code, probably we'll be able to
help you.

On Tue, Jan 25, 2011 at 8:20 PM, Matias Moran matiasmo...@yahoo.com.arwrote:

 Dear Tapestry users, how are you?

 I'm writing because in the last few days we have been implementing
 integration tests using Selenium, but we have found a few issues that I'm
 not sure if these are our mistakes, or maybe it is not possible to be
 tested.

 One of those issues appear when trying to click on an actionLink inside a
 Grid component, lets say a link to Delete or Modify one of the rows. The
 error is always the same: com.thoughtworks.selenium.SeleniumException:
 ERROR: Element nameOfTheElement not found.

 We tried different variations of the element name, including using XPath.
 But none of these worked. The question is: is it possible to test Tapestry
 actionLinks inside Grids or other components using Selenium generated tests?

 Thanks in advance! Greetings.

 Matias.






 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Thiago H. de Paula Figueiredo
On Tue, 25 Jan 2011 17:20:38 -0200, Matias Moran  
matiasmo...@yahoo.com.ar wrote:



Dear Tapestry users, how are you?


Hi!

One of those issues appear when trying to click on an actionLink inside  
a Grid component, lets say a link to Delete or Modify one of the rows.  
The error is always the same:  
com.thoughtworks.selenium.SeleniumException: ERROR: Element  
nameOfTheElement not found.


You're probably using an id locator. You can provide your own ids (just  
add an id attribute to it) or use another locator (XPath or CSS).


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Matias Moran
Thanks for the quick response!

Here is a piece of the code I'm trying to test:

t:grid t:source=userList row=user add=modify
p:modifycell
t:actionLink t:id=modifyUserLink context=user.id/
/p:modifycell
/t:grid



The code generated by Selenium is something like this:

selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);


But it always fails, giving the error I posted before, that it doesn't find 
that element.


Thanks again! Cheers.

Matias.




-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Thiago H. de Paula Figueiredo
On Tue, 25 Jan 2011 17:51:53 -0200, Matias Moran  
matiasmo...@yahoo.com.ar wrote:



The code generated by Selenium is something like this:
selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);


When inside a loop, if you don't provide the id for your ActionLinks,  
they'll generate different ids for them.


Try something like this:

t:actionLink t:id=modifyUserLink context=user.id  
id=actionLink-${user.id}/

selenium.click(actionLink-1); // or some valid user id instead of 1

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Matias Moran
Thanks a lot Thiago!

I will try something like this, I was hoping I didn't need to use IDs, but if 
there is no other solution, it is better than nothing.

Thanks again! Greetings!

Matias.


--- El mar 25-ene-11, Thiago H. de Paula Figueiredo thiag...@gmail.com 
escribió:

 De: Thiago H. de Paula Figueiredo thiag...@gmail.com
 Asunto: Re: Testing Tapestry webapps with Selenium
 Para: Tapestry users users@tapestry.apache.org
 Fecha: martes, 25 de enero de 2011, 17:57
 On Tue, 25 Jan 2011 17:51:53 -0200,
 Matias Moran matiasmo...@yahoo.com.ar
 wrote:
 
  The code generated by Selenium is something like
 this:
 
 selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);
 
 When inside a loop, if you don't provide the id for your
 ActionLinks, they'll generate different ids for them.
 
 Try something like this:
 
 t:actionLink t:id=modifyUserLink context=user.id
 id=actionLink-${user.id}/
 selenium.click(actionLink-1); // or some valid user id
 instead of 1
 
 --Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate
 consultant, developer, and instructor
 Owner, Ars Machina Tecnologia da Informação Ltda.
 http://www.arsmachina.com.br
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 


 

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Igor Drobiazko
If you don't like to provide client-ids besides t:id, you might create a
mixin which will force t:id to be id as well.

On Tue, Jan 25, 2011 at 9:03 PM, Matias Moran matiasmo...@yahoo.com.arwrote:

 Thanks a lot Thiago!

 I will try something like this, I was hoping I didn't need to use IDs, but
 if there is no other solution, it is better than nothing.

 Thanks again! Greetings!

 Matias.


 --- El mar 25-ene-11, Thiago H. de Paula Figueiredo thiag...@gmail.com
 escribió:

  De: Thiago H. de Paula Figueiredo thiag...@gmail.com
  Asunto: Re: Testing Tapestry webapps with Selenium
  Para: Tapestry users users@tapestry.apache.org
  Fecha: martes, 25 de enero de 2011, 17:57
  On Tue, 25 Jan 2011 17:51:53 -0200,
  Matias Moran matiasmo...@yahoo.com.ar
  wrote:
 
   The code generated by Selenium is something like
  this:
  
 
 selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);
 
  When inside a loop, if you don't provide the id for your
  ActionLinks, they'll generate different ids for them.
 
  Try something like this:
 
  t:actionLink t:id=modifyUserLink context=user.id
  id=actionLink-${user.id}/
  selenium.click(actionLink-1); // or some valid user id
  instead of 1
 
  --Thiago H. de Paula Figueiredo
  Independent Java, Apache Tapestry 5 and Hibernate
  consultant, developer, and instructor
  Owner, Ars Machina Tecnologia da Informação Ltda.
  http://www.arsmachina.com.br
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 




 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


Re: Testing Tapestry webapps with Selenium

2011-01-25 Thread Mark
Using the userId as shown above is probably your best bet. However, if
you don't have a userId an you are getting ids like:
modifyUserLink_f8ab4c23

You might try something like this:
click(xpath=(//a[starts-with(@id,'modifyUserLink')])[3]);

That would click on the third item that is found with an id starting
with modifyUserLink.

Mark

On Tue, Jan 25, 2011 at 2:10 PM, Igor Drobiazko
igor.drobia...@gmail.com wrote:
 If you don't like to provide client-ids besides t:id, you might create a
 mixin which will force t:id to be id as well.

 On Tue, Jan 25, 2011 at 9:03 PM, Matias Moran matiasmo...@yahoo.com.arwrote:

 Thanks a lot Thiago!

 I will try something like this, I was hoping I didn't need to use IDs, but
 if there is no other solution, it is better than nothing.

 Thanks again! Greetings!

 Matias.


 --- El mar 25-ene-11, Thiago H. de Paula Figueiredo thiag...@gmail.com
 escribió:

  De: Thiago H. de Paula Figueiredo thiag...@gmail.com
  Asunto: Re: Testing Tapestry webapps with Selenium
  Para: Tapestry users users@tapestry.apache.org
  Fecha: martes, 25 de enero de 2011, 17:57
  On Tue, 25 Jan 2011 17:51:53 -0200,
  Matias Moran matiasmo...@yahoo.com.ar
  wrote:
 
   The code generated by Selenium is something like
  this:
  
 
 selenium.click(//a[@id='modifyUserLink']/div);selenium.waitForPageToLoad(3);
 
  When inside a loop, if you don't provide the id for your
  ActionLinks, they'll generate different ids for them.
 
  Try something like this:
 
  t:actionLink t:id=modifyUserLink context=user.id
  id=actionLink-${user.id}/
  selenium.click(actionLink-1); // or some valid user id
  instead of 1
 
  --Thiago H. de Paula Figueiredo
  Independent Java, Apache Tapestry 5 and Hibernate
  consultant, developer, and instructor
  Owner, Ars Machina Tecnologia da Informação Ltda.
  http://www.arsmachina.com.br
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 




 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




 --
 Best regards,

 Igor Drobiazko
 http://tapestry5.de


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Integration testing Tapestry 4 applications

2007-08-22 Thread carlos f

Hugo,

Have you run into any snags using this in the past month?

Carlos

-- 
View this message in context: 
http://www.nabble.com/Integration-testing-Tapestry-4-applications-tf3927683.html#a12283397
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Integration testing Tapestry 4 applications

2007-06-15 Thread Hugo Palma

Thought i'd share my experience with this.
Hope to get some comments with improvement and more ideas.

http://blogs.logical-software.com/roller/logicalme/entry/1


Cheers,

Hugo


Re: Integration testing Tapestry 4 applications

2007-06-15 Thread Renat Zubairov

Hi

Nice approach, however we are using Cruise Control that runs HTTPUnit
based tests on the reference environment where latest version of the
subsystem was recently reinstalled (also by cruise control, maven and
cargo).
This has an advantage of the independent database schema (our
reference environment is available for the customers). Reference
environment has a stable database schema and stable database content.
Also our web application uses JNDI to lookup resources which makes
jetty configuration a bit more painful.

Renat


On 15/06/07, Hugo Palma [EMAIL PROTECTED] wrote:

Thought i'd share my experience with this.
Hope to get some comments with improvement and more ideas.

http://blogs.logical-software.com/roller/logicalme/entry/1


Cheers,

Hugo




--
Best regards,
Renat Zubairov

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Integration testing Tapestry 4 applications

2007-06-15 Thread Renat Zubairov

Yes, I had the same impression. Also JNDI is not in jetty but in jetty-plus.

On 15/06/07, Hugo Palma [EMAIL PROTECTED] wrote:

Regarding the JNDI lookup, i actually don't know if it's even possible
like this, because the tapestry-test library still uses Jetty 5. Even if
it did use Jetty, i don't think the tapestry-test API allows you to add
resources.

m...i'll have to dig a little more into that...

Renat Zubairov wrote:
 Hi

 Nice approach, however we are using Cruise Control that runs HTTPUnit
 based tests on the reference environment where latest version of the
 subsystem was recently reinstalled (also by cruise control, maven and
 cargo).
 This has an advantage of the independent database schema (our
 reference environment is available for the customers). Reference
 environment has a stable database schema and stable database content.
 Also our web application uses JNDI to lookup resources which makes
 jetty configuration a bit more painful.

 Renat


 On 15/06/07, Hugo Palma [EMAIL PROTECTED] wrote:
 Thought i'd share my experience with this.
 Hope to get some comments with improvement and more ideas.

 http://blogs.logical-software.com/roller/logicalme/entry/1


 Cheers,

 Hugo







--
Best regards,
Renat Zubairov

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-04 Thread Ray McBride

Thanks for you advice. I think I'm a bit further forward.

viewProductDetail is actually a Tapestry component and is instantiated 
using the com.javaforge.tapestry.testng.TestBase; library.


I have removed the expect call from my testGetSaving method and moved 
the replay/verify to my setUp method.


My main problem now relates to the following calls:

webRequest.getSession(true)
viewProductDetail.setRequest(webRequest)

The Mock WebRequest object gets passed ok with the second call, however 
the as far as the viewProductDetail object is concerned the Session 
doesn't exist and I'm not sure how to get access to it.


Any help will be much appreciated

Ray



Jesse Kuhnert wrote:
Hmm .I can't pinpoint the exact problem but if it were up to me I 
would

start out by changing things to look more like:

public void setUp() {
   ...
   webRequest = createMock(WebRequest.class);
   expect(webRequest.getSession(true)).andReturn(webSession);
   ...
 }

public void testGetSaving(Product product) throws Exception{

 viewProductDetail.setProduct(product); // this looks suspicious - if
it's a mock then what you are
// telling easymock is that it should expect someone to call
setProduct(product) when you invoke getSaving() ?
 expect(viewProductDetail.getSaving()).andReturn(saving);

 replay();

 saving = viewProductDetail.getSaving();

 verify();

 assertEquals(saving, 0.02);
}

On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:


Hi,

Thanks for you quick reply.

Sorry, my fault, I must have deleted these while removing my sysouts for
this post.

I have tried using these but unfortunately receive the same exception. I
have also done several searches on google, which seems to suggest the
exception is caused by the omission of the replay() method. However
their inclusion doesn't seem to change anything.

My updated methods are:

public void setUp() {
...
webRequest = createMock(WebRequest.class);
expect(webRequest.getSession(true)).andReturn(webSession);
replay();
webSession = webRequest.getSession(true);
verify();
...
  }

public void testGetSaving(Product product) {
try
{
  viewProductDetail.setProduct(product);
  expect(viewProductDetail.getSaving()).andReturn(saving);
  replay();
  saving = viewProductDetail.getSaving();
  verify();
  assertEquals(saving, 0.02);
}
catch(RuntimeException e){
  System.out.println(e.toString());
}

Thanks for any help

Ray

Jesse Kuhnert wrote:
 You still need to call the replay() / verify() easymock methods, which
 can
 be examined further here:

 http://easymock.org/EasyMock2_2_Documentation.html

 I think getSession(boolean) also returns a value - so you'd have to
 define
 what that return value is with a statement like:

 expect(webRequest.getSession(true)).andReturn(session); (or
 andReturn(null)
 ) .

 On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:

 Hi All,

 We have recently upgrading one of our apps to Tapestry 4.1 and I have
 been asked to write some unit tests for the existing components.

 I am new to Tapestry, TestNG and Easymock, so please bear with me.

 I am trying to get the test to run through an if statement, but I 
keep

 getting the following runtime exception:

 java.lang.IllegalStateException: missing behavior definition for the
 preceeding method call getSession(true)

 The class for the component is as follows:

 public abstract class ViewProductDetail extends BaseComponent
 {
 @InjectObject(infrastructure:request)
   public abstract WebRequest getRequest();
   public abstract void setRequest(WebRequest webRequest);

   @InjectState(visit)
   public abstract Visit getSession();

 public Double getSaving()
   {
 ...

   if(getRequest().getSession(false) != null)
   {
 Visit visit = getSession();
 String discountcode = visit.getDiscountCode();
 Double saving = new Double(rrp.getValue().doubleValue() -
 price.getValue(discountcode).doubleValue());
 return saving;
   }
   else
   {
 ...
 }
   }

 My Test class is as follows:

 public class ViewProductDetailTest extends TestBase
 {
   ...

   @BeforeClass
   public void setUp() {
 viewProductDetail = newInstance(ViewProductDetail.class);
 webRequest = createMock(WebRequest.class);
 webRequest.getSession(true);
 viewProductDetail.setRequest(webRequest);
   }

   @Test (dataProvider = CreateProduct)
   public void testGetSaving(Product product) {
 try
 {
   viewProductDetail.setProduct(product);
   Double saving = viewProductDetail.getSaving();
   assertEquals(saving, 0.02);
 }
 catch(RuntimeException e){
   System.out.println(e.toString());
 }
 }

 I'm not sure to the best way to create a session so that my if
statement
 will be true. I'm trying to use webRequest.getSession(true), but  it
 doesnt seem to work and I don't know if there is a better way or if I
 have missed 

Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Jesse Kuhnert

You still need to call the replay() / verify() easymock methods, which can
be examined further here:

http://easymock.org/EasyMock2_2_Documentation.html

I think getSession(boolean) also returns a value - so you'd have to define
what that return value is with a statement like:

expect(webRequest.getSession(true)).andReturn(session); (or andReturn(null)
) .

On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:


Hi All,

We have recently upgrading one of our apps to Tapestry 4.1 and I have
been asked to write some unit tests for the existing components.

I am new to Tapestry, TestNG and Easymock, so please bear with me.

I am trying to get the test to run through an if statement, but I keep
getting the following runtime exception:

java.lang.IllegalStateException: missing behavior definition for the
preceeding method call getSession(true)

The class for the component is as follows:

public abstract class ViewProductDetail extends BaseComponent
{
@InjectObject(infrastructure:request)
  public abstract WebRequest getRequest();
  public abstract void setRequest(WebRequest webRequest);

  @InjectState(visit)
  public abstract Visit getSession();

public Double getSaving()
  {
...

  if(getRequest().getSession(false) != null)
  {
Visit visit = getSession();
String discountcode = visit.getDiscountCode();
Double saving = new Double(rrp.getValue().doubleValue() -
price.getValue(discountcode).doubleValue());
return saving;
  }
  else
  {
...
}
  }

My Test class is as follows:

public class ViewProductDetailTest extends TestBase
{
  ...

  @BeforeClass
  public void setUp() {
viewProductDetail = newInstance(ViewProductDetail.class);
webRequest = createMock(WebRequest.class);
webRequest.getSession(true);
viewProductDetail.setRequest(webRequest);
  }

  @Test (dataProvider = CreateProduct)
  public void testGetSaving(Product product) {
try
{
  viewProductDetail.setProduct(product);
  Double saving = viewProductDetail.getSaving();
  assertEquals(saving, 0.02);
}
catch(RuntimeException e){
  System.out.println(e.toString());
}
}

I'm not sure to the best way to create a session so that my if statement
will be true. I'm trying to use webRequest.getSession(true), but  it
doesnt seem to work and I don't know if there is a better way or if I
have missed something.

Thanks for any help

Ray


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Ray McBride

Hi,

Thanks for you quick reply.

Sorry, my fault, I must have deleted these while removing my sysouts for 
this post.


I have tried using these but unfortunately receive the same exception. I 
have also done several searches on google, which seems to suggest the 
exception is caused by the omission of the replay() method. However 
their inclusion doesn't seem to change anything.


My updated methods are:

public void setUp() {
   ...
   webRequest = createMock(WebRequest.class);
   expect(webRequest.getSession(true)).andReturn(webSession);
   replay();
   webSession = webRequest.getSession(true);
   verify();
   ...
 }

public void testGetSaving(Product product) {
   try
   {
 viewProductDetail.setProduct(product);
 expect(viewProductDetail.getSaving()).andReturn(saving);
 replay();
 saving = viewProductDetail.getSaving();
 verify();
 assertEquals(saving, 0.02);
   }
   catch(RuntimeException e){
 System.out.println(e.toString());
   }

Thanks for any help

Ray

Jesse Kuhnert wrote:
You still need to call the replay() / verify() easymock methods, which 
can

be examined further here:

http://easymock.org/EasyMock2_2_Documentation.html

I think getSession(boolean) also returns a value - so you'd have to 
define

what that return value is with a statement like:

expect(webRequest.getSession(true)).andReturn(session); (or 
andReturn(null)

) .

On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:


Hi All,

We have recently upgrading one of our apps to Tapestry 4.1 and I have
been asked to write some unit tests for the existing components.

I am new to Tapestry, TestNG and Easymock, so please bear with me.

I am trying to get the test to run through an if statement, but I keep
getting the following runtime exception:

java.lang.IllegalStateException: missing behavior definition for the
preceeding method call getSession(true)

The class for the component is as follows:

public abstract class ViewProductDetail extends BaseComponent
{
@InjectObject(infrastructure:request)
  public abstract WebRequest getRequest();
  public abstract void setRequest(WebRequest webRequest);

  @InjectState(visit)
  public abstract Visit getSession();

public Double getSaving()
  {
...

  if(getRequest().getSession(false) != null)
  {
Visit visit = getSession();
String discountcode = visit.getDiscountCode();
Double saving = new Double(rrp.getValue().doubleValue() -
price.getValue(discountcode).doubleValue());
return saving;
  }
  else
  {
...
}
  }

My Test class is as follows:

public class ViewProductDetailTest extends TestBase
{
  ...

  @BeforeClass
  public void setUp() {
viewProductDetail = newInstance(ViewProductDetail.class);
webRequest = createMock(WebRequest.class);
webRequest.getSession(true);
viewProductDetail.setRequest(webRequest);
  }

  @Test (dataProvider = CreateProduct)
  public void testGetSaving(Product product) {
try
{
  viewProductDetail.setProduct(product);
  Double saving = viewProductDetail.getSaving();
  assertEquals(saving, 0.02);
}
catch(RuntimeException e){
  System.out.println(e.toString());
}
}

I'm not sure to the best way to create a session so that my if statement
will be true. I'm trying to use webRequest.getSession(true), but  it
doesnt seem to work and I don't know if there is a better way or if I
have missed something.

Thanks for any help

Ray


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
__

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unit testing Tapestry 4.1 components with TestNG and Easymock

2007-06-01 Thread Jesse Kuhnert

Hmm .I can't pinpoint the exact problem but if it were up to me I would
start out by changing things to look more like:

public void setUp() {
   ...
   webRequest = createMock(WebRequest.class);
   expect(webRequest.getSession(true)).andReturn(webSession);
   ...
 }

public void testGetSaving(Product product) throws Exception{

 viewProductDetail.setProduct(product); // this looks suspicious - if
it's a mock then what you are
// telling easymock is that it should expect someone to call
setProduct(product) when you invoke getSaving() ?
 expect(viewProductDetail.getSaving()).andReturn(saving);

 replay();

 saving = viewProductDetail.getSaving();

 verify();

 assertEquals(saving, 0.02);
}

On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:


Hi,

Thanks for you quick reply.

Sorry, my fault, I must have deleted these while removing my sysouts for
this post.

I have tried using these but unfortunately receive the same exception. I
have also done several searches on google, which seems to suggest the
exception is caused by the omission of the replay() method. However
their inclusion doesn't seem to change anything.

My updated methods are:

public void setUp() {
...
webRequest = createMock(WebRequest.class);
expect(webRequest.getSession(true)).andReturn(webSession);
replay();
webSession = webRequest.getSession(true);
verify();
...
  }

public void testGetSaving(Product product) {
try
{
  viewProductDetail.setProduct(product);
  expect(viewProductDetail.getSaving()).andReturn(saving);
  replay();
  saving = viewProductDetail.getSaving();
  verify();
  assertEquals(saving, 0.02);
}
catch(RuntimeException e){
  System.out.println(e.toString());
}

Thanks for any help

Ray

Jesse Kuhnert wrote:
 You still need to call the replay() / verify() easymock methods, which
 can
 be examined further here:

 http://easymock.org/EasyMock2_2_Documentation.html

 I think getSession(boolean) also returns a value - so you'd have to
 define
 what that return value is with a statement like:

 expect(webRequest.getSession(true)).andReturn(session); (or
 andReturn(null)
 ) .

 On 6/1/07, Ray McBride [EMAIL PROTECTED] wrote:

 Hi All,

 We have recently upgrading one of our apps to Tapestry 4.1 and I have
 been asked to write some unit tests for the existing components.

 I am new to Tapestry, TestNG and Easymock, so please bear with me.

 I am trying to get the test to run through an if statement, but I keep
 getting the following runtime exception:

 java.lang.IllegalStateException: missing behavior definition for the
 preceeding method call getSession(true)

 The class for the component is as follows:

 public abstract class ViewProductDetail extends BaseComponent
 {
 @InjectObject(infrastructure:request)
   public abstract WebRequest getRequest();
   public abstract void setRequest(WebRequest webRequest);

   @InjectState(visit)
   public abstract Visit getSession();

 public Double getSaving()
   {
 ...

   if(getRequest().getSession(false) != null)
   {
 Visit visit = getSession();
 String discountcode = visit.getDiscountCode();
 Double saving = new Double(rrp.getValue().doubleValue() -
 price.getValue(discountcode).doubleValue());
 return saving;
   }
   else
   {
 ...
 }
   }

 My Test class is as follows:

 public class ViewProductDetailTest extends TestBase
 {
   ...

   @BeforeClass
   public void setUp() {
 viewProductDetail = newInstance(ViewProductDetail.class);
 webRequest = createMock(WebRequest.class);
 webRequest.getSession(true);
 viewProductDetail.setRequest(webRequest);
   }

   @Test (dataProvider = CreateProduct)
   public void testGetSaving(Product product) {
 try
 {
   viewProductDetail.setProduct(product);
   Double saving = viewProductDetail.getSaving();
   assertEquals(saving, 0.02);
 }
 catch(RuntimeException e){
   System.out.println(e.toString());
 }
 }

 I'm not sure to the best way to create a session so that my if
statement
 will be true. I'm trying to use webRequest.getSession(true), but  it
 doesnt seem to work and I don't know if there is a better way or if I
 have missed something.

 Thanks for any help

 Ray


 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit 

RE: Perfomance Testing Tapestry App

2006-11-27 Thread Thomas.Vaughan
I second that advice.  After 30-45 minutes of following their online
demo, you can have JMeter up and running and simulating dozens of users
with form input, logins, etc.

http://jakarta.apache.org/jmeter/
http://jakarta.apache.org/jmeter/usermanual/index.html



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 23, 2006 9:17 AM
To: users@tapestry.apache.org
Subject: RE: Perfomance Testing Tapestry App

I would highly recommend Jakarta JMeter. You can use it as a proxy to
record some user actions, and then play back as many users as you want
to simulate, and much more.

-Greg

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Dennis Sinelnikov
Sent: Wednesday, November 22, 2006 10:48 PM
To: users@tapestry.apache.org
Subject: Perfomance Testing Tapestry App


Hey guys,

I have some performance requirements and would like to gather input from

the tapestry community on what is the right approach.  For example, how 
do I properly simulate X number of users?  I have some UIs that require 
user input.  I guess I can tailor http requests.

Any guidance/links/tips/past experiences are greatly appreciated.

Thanks,
Dennis


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perfomance Testing Tapestry App

2006-11-27 Thread Detlef Schulze
Some tool that I like much more than Jmeter (although I have to admit
that it is quite some time ago I last checked it) is Microsofts Web
Application Stress Test tool.

You can freely download and use it:
http://www.microsoft.com/downloads/details.aspx?FamilyID=E2C0585A-062A-4
39E-A67D-75A89AA36495displaylang=en


Although it is from Microsoft, it is a really nice tool.

Cheers,
Detlef

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Montag, 27. November 2006 15:05
To: users@tapestry.apache.org
Subject: RE: Perfomance Testing Tapestry App

I second that advice.  After 30-45 minutes of following their online
demo, you can have JMeter up and running and simulating dozens of users
with form input, logins, etc.

http://jakarta.apache.org/jmeter/
http://jakarta.apache.org/jmeter/usermanual/index.html



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, November 23, 2006 9:17 AM
To: users@tapestry.apache.org
Subject: RE: Perfomance Testing Tapestry App

I would highly recommend Jakarta JMeter. You can use it as a proxy to
record some user actions, and then play back as many users as you want
to simulate, and much more.

-Greg

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Dennis Sinelnikov
Sent: Wednesday, November 22, 2006 10:48 PM
To: users@tapestry.apache.org
Subject: Perfomance Testing Tapestry App


Hey guys,

I have some performance requirements and would like to gather input from

the tapestry community on what is the right approach.  For example, how
do I properly simulate X number of users?  I have some UIs that require
user input.  I guess I can tailor http requests.

Any guidance/links/tips/past experiences are greatly appreciated.

Thanks,
Dennis


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perfomance Testing Tapestry App

2006-11-27 Thread Konstantin Ignatyev
As usual I recommend The Grinder
http://grinder.sourceforge.net/index.html
 

--- Detlef Schulze [EMAIL PROTECTED] wrote:

 Some tool that I like much more than Jmeter
 (although I have to admit
 that it is quite some time ago I last checked it) is
 Microsofts Web
 Application Stress Test tool.
 
 You can freely download and use it:

http://www.microsoft.com/downloads/details.aspx?FamilyID=E2C0585A-062A-4
 39E-A67D-75A89AA36495displaylang=en
 
 
 Although it is from Microsoft, it is a really nice
 tool.
 
 Cheers,
 Detlef
 
  
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] 
 Sent: Montag, 27. November 2006 15:05
 To: users@tapestry.apache.org
 Subject: RE: Perfomance Testing Tapestry App
 
 I second that advice.  After 30-45 minutes of
 following their online
 demo, you can have JMeter up and running and
 simulating dozens of users
 with form input, logins, etc.
 
 http://jakarta.apache.org/jmeter/

http://jakarta.apache.org/jmeter/usermanual/index.html
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 23, 2006 9:17 AM
 To: users@tapestry.apache.org
 Subject: RE: Perfomance Testing Tapestry App
 
 I would highly recommend Jakarta JMeter. You can use
 it as a proxy to
 record some user actions, and then play back as many
 users as you want
 to simulate, and much more.
 
 -Greg
 
 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of
 Dennis Sinelnikov
 Sent: Wednesday, November 22, 2006 10:48 PM
 To: users@tapestry.apache.org
 Subject: Perfomance Testing Tapestry App
 
 
 Hey guys,
 
 I have some performance requirements and would like
 to gather input from
 
 the tapestry community on what is the right
 approach.  For example, how
 do I properly simulate X number of users?  I have
 some UIs that require
 user input.  I guess I can tailor http requests.
 
 Any guidance/links/tips/past experiences are greatly
 appreciated.
 
 Thanks,
 Dennis
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of 
CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a 
Strategy for Reforming Universities and Public Schools.  New York:  State 
University of New York Press, 1997: (4) (5) (p.206)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perfomance Testing Tapestry App

2006-11-23 Thread Greg.L.Cormier
I would highly recommend Jakarta JMeter. You can use it as a proxy to record 
some user actions, and then play back as many users as you want to simulate, 
and much more.

-Greg

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Dennis Sinelnikov
Sent: Wednesday, November 22, 2006 10:48 PM
To: users@tapestry.apache.org
Subject: Perfomance Testing Tapestry App


Hey guys,

I have some performance requirements and would like to gather input from 
the tapestry community on what is the right approach.  For example, how 
do I properly simulate X number of users?  I have some UIs that require 
user input.  I guess I can tailor http requests.

Any guidance/links/tips/past experiences are greatly appreciated.

Thanks,
Dennis


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perfomance Testing Tapestry App

2006-11-23 Thread Dennis Sinelnikov

s/gooble/gobble/g :)

Dennis Sinelnikov wrote:
Wow. This is great!  Within couple hours I'm already running performance 
tests.  Proxy would not be applicable to my environment right away b/c 
my server is ssl enabled, which makes sense because that would defeat 
the purpose of ssl encryption.  I might use one of the firefox plugins 
to observe https requests.


Thanks Greg!

gooble gooble,
Dennis

[EMAIL PROTECTED] wrote:
I would highly recommend Jakarta JMeter. You can use it as a proxy to 
record some user actions, and then play back as many users as you want 
to simulate, and much more.


-Greg

-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Dennis Sinelnikov
Sent: Wednesday, November 22, 2006 10:48 PM
To: users@tapestry.apache.org
Subject: Perfomance Testing Tapestry App


Hey guys,

I have some performance requirements and would like to gather input 
from the tapestry community on what is the right approach.  For 
example, how do I properly simulate X number of users?  I have some 
UIs that require user input.  I guess I can tailor http requests.


Any guidance/links/tips/past experiences are greatly appreciated.

Thanks,
Dennis


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Perfomance Testing Tapestry App

2006-11-22 Thread Dennis Sinelnikov

Hey guys,

I have some performance requirements and would like to gather input from 
the tapestry community on what is the right approach.  For example, how 
do I properly simulate X number of users?  I have some UIs that require 
user input.  I guess I can tailor http requests.


Any guidance/links/tips/past experiences are greatly appreciated.

Thanks,
Dennis


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Fwd: Re: [Htmlunit-user] Testing Tapestry]

2006-11-10 Thread Dan Adams
FYI, for people using HtmlUnit with 4.1 and Tacos. Marc is the author of
HtmlUnit.

 Forwarded Message 
From: Marc Guillemot [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [Htmlunit-user] Testing Tapestry
Date: Fri, 10 Nov 2006 10:01:10 +0100

I can't say anything on tapestry but htmlunit's AJAX support (and more 
generally javascript support) is continuously improved. Looking quickly 
on tapestry's mailing list I've seen some complaining about stuff that 
fail in htmlunit. Perhaps could it already be fixed if they would have 
reported it to the right place ;-(

Marc.


Dan Adams wrote:
 This is something I'm planning on doing but haven't done yet (which is
 why I'm still using tapestry 4 rather than 4.1). If you haven't already
 I'd suggest email the tapestry list as Jesse has done a bit of work in
 this area.
 
 On Thu, 2006-11-09 at 13:02 -0300, Rodrigo wrote:
 Hi, I'm new to HtmlUnit, and I'm having some trouble testing a
 Tapestry application, mainly with AJAX components.
  
 At first I couldn't make a page using XTile to work at all... I then,
 for a completely different reason, changed the user-language of the
 BrowserVersion (from en-us to es-ar) and xtile started working!...
 but... in my Xtile, in the receiving JavaScript function, I was doing
 a split of a string into an array, and THAT started to fail... instead
 of spliting at the character I said, it splitted every single
 character... 
  
 I'm also having trouble with Tacos, it's not that important, because
 it's just an autocompleter, but of course it would be nice if it
 worked.
  
 Has anyone tried to test a Tapestry application using Xtile and/or
 Tacos? Is there anywhere where I could see some examples?
  
  
 DarkRodro
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Htmlunit-user mailing list 
 [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/htmlunit-user


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Htmlunit-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Fwd: Re: [Htmlunit-user] Testing Tapestry]

2006-11-10 Thread DJ Gredler

I've been using HtmlUnit for the BeanForm integration tests. The one bug I
encountered in HtmlUnit was patched within days. Of course, I'm not using
any of the async stuff :-)

Also FYI, I'm currently pushing to get the unit tests for some of the more
popular JavaScript libraries integrated into the HtmlUnit builds... so for
example HtmlUnit version X could by guaranteed to be compatible with Dojo
version Y and Prototype version Z.

On 11/10/06, Dan Adams [EMAIL PROTECTED] wrote:


FYI, for people using HtmlUnit with 4.1 and Tacos. Marc is the author of
HtmlUnit.

 Forwarded Message 
From: Marc Guillemot [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [Htmlunit-user] Testing Tapestry
Date: Fri, 10 Nov 2006 10:01:10 +0100

I can't say anything on tapestry but htmlunit's AJAX support (and more
generally javascript support) is continuously improved. Looking quickly
on tapestry's mailing list I've seen some complaining about stuff that
fail in htmlunit. Perhaps could it already be fixed if they would have
reported it to the right place ;-(

Marc.


Dan Adams wrote:
 This is something I'm planning on doing but haven't done yet (which is
 why I'm still using tapestry 4 rather than 4.1). If you haven't already
 I'd suggest email the tapestry list as Jesse has done a bit of work in
 this area.

 On Thu, 2006-11-09 at 13:02 -0300, Rodrigo wrote:
 Hi, I'm new to HtmlUnit, and I'm having some trouble testing a
 Tapestry application, mainly with AJAX components.

 At first I couldn't make a page using XTile to work at all... I then,
 for a completely different reason, changed the user-language of the
 BrowserVersion (from en-us to es-ar) and xtile started working!...
 but... in my Xtile, in the receiving JavaScript function, I was doing
 a split of a string into an array, and THAT started to fail... instead
 of spliting at the character I said, it splitted every single
 character...

 I'm also having trouble with Tacos, it's not that important, because
 it's just an autocompleter, but of course it would be nice if it
 worked.

 Has anyone tried to test a Tapestry application using Xtile and/or
 Tacos? Is there anywhere where I could see some examples?


 DarkRodro

-
 Using Tomcat but need to do more? Need to support web services,
security?
 Get stuff done quickly with pre-integrated technology to make your job
easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo

http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Htmlunit-user mailing
list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Htmlunit-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
--
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Testing Tapestry application

2006-07-21 Thread KE Gan

Haha .. alright : .. Thanks a bunch !!

On 7/21/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:


I can't really take credit for it. All I did was move java files around to
different places and made them use the testing infrastructure that
Howard/the team had already created.

You can use it now, just don't ask for documentation yet ;)


http://people.apache.org/repo/m2-snapshot-repository/org/apache/tapestry/tapestry-test/

On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:

 Jesse,

 Thanks a lot for the pointers!! And eagerly looking forward for the
 independent testing module that you will be making available :)

 Could you please make a announcement here once you did ? By the way,
when
 can we expect it ;) ?

 Thanks again.


 On 7/21/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:
 
  Here,
 
 
 

http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/
 
  All ~ 1,500 unit tests in tapestry use the tapestry-testng module from
  howardlewisship.com. There should be enough in there for more complete
  examples :)
 
  I've also already broken the basic base unit test classes in tapestry
 out
  into a new maven project that I've deployed, just haven't genereated a
  site
  for it yet with documentation. Eventually, people should be able to
use
  the
  same testing resources tapestry developers do to test their own
  components/pages.
 
  On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:
  
   Hi,
  
   I have been coding Tapestry for a few months now. It is really nice
to
   work
   with, especially with Hivemind tightly integrated ... hence I get to
   easily
   unit test my POJOs (domain objects, etc).
  
   However, I still have problem unit testing the Tapestry pages of the
   application. I did try to use HtmlUnit, but that that's more like
   integration testing. It requires the tomcat and database server to
be
   running. I am wondering what are other Tapestry users are doing to
 unit
   testing Tapestry pages without need to use the servlet container ?
 This
   would make development much faster!
  
   I read a bit here and there about using TestNG + EasyMock
   [tapestry-testng] (
  
 http://howardlewisship.com/tapestry-javaforge/tapestry-testng/index.html
  ).
   It seems to be what I am looking for (am I right?), but I cannot
find
  any
   example about how to using it, or much documentation of how to go
 about
   that
   either.
  
   I greatly appreciate if fellow Tapestry users can give some
pointers.
  
   By the way, what is the development status of tapestry-testng ?
Seems
  like
   still a 'snapshot' release? When can we see a full release with
  Tapestry?
  
   Thanks.
  
  
 
 
  --
  Jesse Kuhnert
  Tacos/Tapestry, team member/developer
 
  Open source based consulting work centered around
  dojo/tapestry/tacos/hivemind.
 
 




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.




Re: Testing Tapestry application

2006-07-20 Thread Jesse Kuhnert

Here,

http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/

All ~ 1,500 unit tests in tapestry use the tapestry-testng module from
howardlewisship.com. There should be enough in there for more complete
examples :)

I've also already broken the basic base unit test classes in tapestry out
into a new maven project that I've deployed, just haven't genereated a site
for it yet with documentation. Eventually, people should be able to use the
same testing resources tapestry developers do to test their own
components/pages.

On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:


Hi,

I have been coding Tapestry for a few months now. It is really nice to
work
with, especially with Hivemind tightly integrated ... hence I get to
easily
unit test my POJOs (domain objects, etc).

However, I still have problem unit testing the Tapestry pages of the
application. I did try to use HtmlUnit, but that that's more like
integration testing. It requires the tomcat and database server to be
running. I am wondering what are other Tapestry users are doing to unit
testing Tapestry pages without need to use the servlet container ? This
would make development much faster!

I read a bit here and there about using TestNG + EasyMock
[tapestry-testng] (
http://howardlewisship.com/tapestry-javaforge/tapestry-testng/index.html).
It seems to be what I am looking for (am I right?), but I cannot find any
example about how to using it, or much documentation of how to go about
that
either.

I greatly appreciate if fellow Tapestry users can give some pointers.

By the way, what is the development status of tapestry-testng ? Seems like
still a 'snapshot' release? When can we see a full release with Tapestry?

Thanks.





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


Re: Testing Tapestry application

2006-07-20 Thread KE Gan

Jesse,

Thanks a lot for the pointers!! And eagerly looking forward for the
independent testing module that you will be making available :)

Could you please make a announcement here once you did ? By the way, when
can we expect it ;) ?

Thanks again.


On 7/21/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:


Here,


http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/

All ~ 1,500 unit tests in tapestry use the tapestry-testng module from
howardlewisship.com. There should be enough in there for more complete
examples :)

I've also already broken the basic base unit test classes in tapestry out
into a new maven project that I've deployed, just haven't genereated a
site
for it yet with documentation. Eventually, people should be able to use
the
same testing resources tapestry developers do to test their own
components/pages.

On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:

 Hi,

 I have been coding Tapestry for a few months now. It is really nice to
 work
 with, especially with Hivemind tightly integrated ... hence I get to
 easily
 unit test my POJOs (domain objects, etc).

 However, I still have problem unit testing the Tapestry pages of the
 application. I did try to use HtmlUnit, but that that's more like
 integration testing. It requires the tomcat and database server to be
 running. I am wondering what are other Tapestry users are doing to unit
 testing Tapestry pages without need to use the servlet container ? This
 would make development much faster!

 I read a bit here and there about using TestNG + EasyMock
 [tapestry-testng] (
 http://howardlewisship.com/tapestry-javaforge/tapestry-testng/index.html
).
 It seems to be what I am looking for (am I right?), but I cannot find
any
 example about how to using it, or much documentation of how to go about
 that
 either.

 I greatly appreciate if fellow Tapestry users can give some pointers.

 By the way, what is the development status of tapestry-testng ? Seems
like
 still a 'snapshot' release? When can we see a full release with
Tapestry?

 Thanks.




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.




Re: Testing Tapestry application

2006-07-20 Thread Jesse Kuhnert

I can't really take credit for it. All I did was move java files around to
different places and made them use the testing infrastructure that
Howard/the team had already created.

You can use it now, just don't ask for documentation yet ;)

http://people.apache.org/repo/m2-snapshot-repository/org/apache/tapestry/tapestry-test/

On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:


Jesse,

Thanks a lot for the pointers!! And eagerly looking forward for the
independent testing module that you will be making available :)

Could you please make a announcement here once you did ? By the way, when
can we expect it ;) ?

Thanks again.


On 7/21/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:

 Here,



http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/

 All ~ 1,500 unit tests in tapestry use the tapestry-testng module from
 howardlewisship.com. There should be enough in there for more complete
 examples :)

 I've also already broken the basic base unit test classes in tapestry
out
 into a new maven project that I've deployed, just haven't genereated a
 site
 for it yet with documentation. Eventually, people should be able to use
 the
 same testing resources tapestry developers do to test their own
 components/pages.

 On 7/20/06, KE Gan [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I have been coding Tapestry for a few months now. It is really nice to
  work
  with, especially with Hivemind tightly integrated ... hence I get to
  easily
  unit test my POJOs (domain objects, etc).
 
  However, I still have problem unit testing the Tapestry pages of the
  application. I did try to use HtmlUnit, but that that's more like
  integration testing. It requires the tomcat and database server to be
  running. I am wondering what are other Tapestry users are doing to
unit
  testing Tapestry pages without need to use the servlet container ?
This
  would make development much faster!
 
  I read a bit here and there about using TestNG + EasyMock
  [tapestry-testng] (
 
http://howardlewisship.com/tapestry-javaforge/tapestry-testng/index.html
 ).
  It seems to be what I am looking for (am I right?), but I cannot find
 any
  example about how to using it, or much documentation of how to go
about
  that
  either.
 
  I greatly appreciate if fellow Tapestry users can give some pointers.
 
  By the way, what is the development status of tapestry-testng ? Seems
 like
  still a 'snapshot' release? When can we see a full release with
 Tapestry?
 
  Thanks.
 
 


 --
 Jesse Kuhnert
 Tacos/Tapestry, team member/developer

 Open source based consulting work centered around
 dojo/tapestry/tacos/hivemind.







--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.