Sreenivas Mangasandra

Greenhorn
+ Follow
since Dec 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sreenivas Mangasandra

Hallo Everybody,

I am new to JUnit and i have tried testing the sample testcases given with JUnit from Ant.

How can one apply Test cases for a complete project, i.e. a set of java source files, is it like i have to include a source directory in JUnit or how ?

what i understood till now is:

1. A build.xml file is used to execute test using Ant.
2. *Test.java with classes of them.
3. JUnit jar files.

So would that mean for me to test a project (set of java files) i need to write seperate *Test.java files to test them or can we just have one common component for any project.

It would be nice if any one can clear my question
with an example. Thanks.



Sreenivas Mangasandra.
19 years ago
Hi Siegfried,

I would suggest the following ::

Mastering OpenSource Tools Including Ant, XDoclet, JUnit, Cactus, & Maven -
http://www.bookpool.com/sm/0764556177

Maven SQL Plug-in -
http://www.codeczar.com/products/maven-sql-plugin/index.html
http://jakarta.apache.org/commons/sandbox/sql/

I shall post reply if i find some more information.
N i hope u find something useful in the above links,

Sreenivas Mangasandra.
19 years ago
Hallo Everybody,

I would like to know if anyone has tried to generate xml reports using PMD's Ant Task.
URL : pmd

And what parameters i need to include to get the cyclomatic complexity of a project / package. i checked the maven's reports -- it gives me the cyclomatic complexity of a class / method.

Or is there any way to calculate the cyclomatic complexity of a complete project.

Thanks

Sreenivas Mangasandra
19 years ago
Hallo,

Does anyone have any links for JSTL Libary onlinehelp
or some kind of reference. I do use a book "JSTL in Action",
but i would like to see some examples online.

Thanks.

Sreenivas Mangasandra
19 years ago
JSP
Hi again,

few answers to my previous post:


We could disable internet usage by Maven (maven.bat), but we need to show /point maven the location of all the necessary plugins (- for reports) stored.
In the project.properties file we need to declare so ::

#The repository on the local machine for maven to search artifacts.
maven.home.local=C:/Dokumente und Einstellungen/Sreenivas/.maven

# To set internet offline
maven.mode.online = false


But i could not find some info about the integration of maven into java. i.e. i would like to call maven (with particular goals / plugin calls) from a java class. Is it possible??




Thanks in advance,


Sreenivas Mangasandra
19 years ago
Hallo Jeanne,


Thanks for the info. but indian names are normally very long and Sreenivas is a very common first name, so i had to use a short form of my other names to add it.I hope its ok now.

Sreenivas.





"mksreenivas ",
We're pleased to have you here with us in the Ant/Maven forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Note that questions from users with invalid display names are less likely to get answered.

Thanks,
Jeanne
Forum Bartender
19 years ago
Hallo Everybody,


I would like to know a few more things about Maven 1.0.2' integration in java.

How can maven be started from Java? Are there examples how to integrate maven into java applications? i.e, do we have any APIs so that we call Maven from a java program to generate reports using any APIs.


Can we stop maven from not downloading the plugins during a goal completion. Since we need to integrate into a product, where it can be a local Installation without an internet connection.

Shall be thankful for any ideas / suggestions.Thanks.


mksreenivas


[mksreenivas]
19 years ago
Hi All,

Well for further references. i could solve the problem. The basic ideas can be Two methods. one is to static variables in the mdb to create a loop counter for a specified loop. The next one is to include a kind of header in the message itself, to generate in this format and extract the counter values, size of the message and time stamp if necessary.

Srinu.
Hi CLement,

The code is quite ok. i feel u r setting in the Web App Server are not correctly configured. I mean the Queue Listeners, Queue Connection Factories and Queue for the JNDI. and right values in it. It can be a type mistake in the name or an extra space.

U could just write a normal code to test a MDB for onMessage by manually putting a message in the queue.

Srinu.
Hallo,

i am trying to put and get messages within a mdb(WAS Scenario). Well ofcourse the mdb gets messages when the onMessage is called. and hence it would not be a problem to get a loop of msgs. but i would like to know how can i implement a put. is it within an ejbCreate() call.

i have tried it like this....

iCtx = new InitialContext();
outMessage = null;

factory = JMSPut.getConnectionFactoryFromJNDI(iCtx,"jms/QCF100" );
ioQueue= JMSPut.getQueueFromJNDI(iCtx,"jms/Q100");

connection = factory.createQueueConnection();
connection.start();

session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);

queueProducer = session.createSender(ioQueue);

outMessage.setText("This is a test String");

queueProducer.send(outMessage);
}
catch( JMSException jmsException )
{
System.out.println("\n[MDB] JMS Exception Occured.");
}
catch( NamingException nameException )
{
System.out.println("\n[MDB] Unable to retrieve the QCF object from JNDI.");
}


but there a lot of errors like:

12/16/04 11:04:43:234 CET] 7970e914 SystemOut O MDB100 ejbCreate() called
[12/16/04 11:04:43:266 CET] 7970e914 ServerSession W WMSG0031E: Exception processing JMS Message for MDB someBean, JMSDestination jms/Q100 : java.lang.NullPointerException
at com.ibm.mq.jms.MQSession.run(MQSession.java:1011)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:924)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:740)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:525)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:492)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:373)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)

[12/16/04 11:04:43:281 CET] 7970e914 ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "onMessage" on bean "BeanId(someMDB#someMDBEJB.jar#someBean, null)". Exception data: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:373)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: java.lang.NullPointerException
at com.ibm.mq.jms.MQSession.run(MQSession.java:1011)
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:924)
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:740)
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:525)
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:492)
... 8 more

[12/16/04 11:04:43:297 CET] 7970e914 LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.





i would be thankful, if anyone can suggesst or give links related to it.

srinu