[JBoss Seam] - Re: Question about SeamTest
by pete.muir@jboss.org
"dmitriy.lapko" wrote : 1) If Seam is not bounded to JSF, why SeamTest should be bounded to JSF Phases? I just not really like for testing purposes use all these FacesRequest multiple implemnetations just to call a method of the component... And this doesn't add flexibility to my tests - e.g. if I want to pass any value from one call of FacesRequest to other I have to create a global field in class.
Have you tried using ComponentTest instead? This doesn't emulate the JSF lifecycle.
anonymous wrote : 2) If I use facinating Seam-features like EL in QL, I cannot unit test my application - I need all framework to be started to enable all these Interceptors for my code. What a pity...
Do you have this working now (I got a bit lost in your posts ;)?
anonymous wrote : 3) If you would like to prepare some test data before executing FacesRequest or to check what was really done in database - you cannot use current configuration of database and have to add your own to make queries. Annoying...
The DBUnit SeamTest is perfect for this (see the Seamdiscs example).
anonymous wrote : Because of complexity of configuration of tests and of using them (to write integrational test you have to know Seam like half as Gavin knows it...) they are just unusable for normal team member. I'm sure that SeamTest using should be simplified, now it is too complex.
I know what you mean. However I don't see how we can make it simpler (yes, we can improve the library setup, but not the structure of the Test harness afaics). Have you got specific ideas to share? :)
anonymous wrote : 1) I have two consecutive FacesRequest calls to methods, first of which should start long running conversation and second should end it. First marked by @Begin and second - by @End annotations.
You have to manually pass the conversation id around. Please file a JIRA issue to improve the docs for this - its not currently good!
anonymous wrote : 2) I run my unit tests inside the deployed and started application. I want to do it also with SeamTests. But disabling of starting embedd ejb container didn't help - anyway a new SeamPhaseListener is started and all other stuff which breaks the application inside which everything was started.
Don't understand this...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103719#4103719
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103719
18 years, 8 months
[JBossWS] - Returning lists on jbossws-1.2.1.GA
by burakbayramli
Hi all,
How can we return lists using @WebMethod, @WebService annotations
I have used the following code but I received the error below:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://service.gg.com/}arrayList
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildOutputParameter(JAXRPCMetaDataBuilder.java:346)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataRpc(JAXRPCMetaDataBuilder.java:592)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:210)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:216)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:133)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:85)
| at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| at com.gg.service.Client.main(Client.java:21)
|
Code:
| @WebService
| @SOAPBinding(style=Style.RPC)
| public interface ProductDb extends Remote {
|
| @WebMethod ArrayList<Product> getProducts();
|
| }
|
| @Stateless
| @WebService(endpointInterface="com.gg.service.ProductDb")
| @WebContext(contextRoot="/ggServices")
| public class ProductDbBean {
|
| @PersistenceContext(unitName="GGLocal")
| EntityManager em;
|
| public ArrayList<Product> getProducts() {
| List<Product> l = em.createQuery("from Product").getResultList();
| ArrayList<Product> list = new ArrayList<Product>();
| for (Product p : l) {
| list.add(p);
| }
| return list;
| }
|
|
| }
|
|
public class Client
| {
| public static void main(String[] args) throws Exception
| {
| URL url = new URL("http://localhost:8080/ggServices/ProductDbBean?wsdl");
| QName qname = new QName("http://service.gg.com/",
| "ProductDbBeanService");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
| ProductDb s = (ProductDb) service.getPort(ProductDb.class);
|
| ArrayList<Product> list = s.getProducts();
|
| }
|
Thanks in advance,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103714#4103714
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103714
18 years, 8 months