gayathri murugesan

Ranch Hand
+ Follow
since Dec 21, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by gayathri murugesan

Hi,

I am new to JUnit Testing.I have a void DB call which i need to mock.

In the method i need to test,

I have


DBTester db = new DBTester();
db.method();



DBTester mockobj = Mockito.mock(DBTester.class);
Mockito.doNothing().when(mockObj).method((BigInteger)Mockito.anyObject(), (BigInteger)Mockito.anyObject(), (obj)Mockito.anyObject());

In have added in the annotation

@PrepareForTest({DBTester.class})

But it hits the original DB Call.Can someone please throw light on where i am going wrong

Thanks in advance

10 years ago



this is the servlet that i am trying to call from another servlet using

out.println("<img src='/worst?id=5'>");

but i am not getting the image . please help me out.
13 years ago
i have an application where unread messages must be retrieved from the gmail server inbox whenever it arrives.



the loop is executing for 15 times and the unread messages are retrieved but after 15 times i am getting exception


javax.mail.MessagingException: connection failure
at com.sun.mail.imap.IMAPStore.getProtocol(IMAPStore.java:775)
at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:910)
at EmailClient$Checker.run(EmailClient.java:721)
at java.lang.Thread.run(Unknown Source)


why is it so.is there any other way to do the same.

13 years ago

hi, i need to retrieve only the unread messages from the inbox whenever it arrives to inbox
i used the following code given below to do so. but it is retriving all the mesaages in the inbox.
please help to retrieve only the unread messages



please help

13 years ago
is it possible to lock a folder from java code.
please help.
13 years ago
with length method also i m getting the same type of problem.

13 years ago
i would like to retrieve the contents from folderwithmsg.txt file and then compare with the fileName given by user.if the filename is not present in the text file,i should write in the text file.otherwise i should not.as the first character is being omitted,whenever the filename equals the first name in the text file ,it is writing in the file.
13 years ago


tha actual contents of the file is

business
personal

but my output is

THE CONTENTS FROM FILE IS:usiness
THE CONTENTS FROM FILE IS:personal

so that when i enter business it doesn't go in to the loop which checks for equality.

please help.


13 years ago
before making the jar file i compiled an d ran the program .it worked properly. but when i make the jar file i am getting this CLASSNOTFOUNDEXCEPTION.


please help..

14 years ago
D:\pro>java -jar test2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: EmailClient
Caused by: java.lang.ClassNotFoundException: EmailClient
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: EmailClient . Program will exit.

14 years ago

D:\pro>jar tvf test2.jar
0 Sat Mar 13 16:39:48 IST 2010 META-INF/
97 Sat Mar 13 16:39:48 IST 2010 META-INF/MANIFEST.MF
7044 Sat Mar 13 08:58:44 IST 2010 BasicJDBCDemo.class
8470 Sat Mar 13 08:58:44 IST 2010 Classifier.class
516 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$1.class
543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$2.class
543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$3.class
4350 Sat Mar 13 08:58:44 IST 2010 ConnectDialog.class
3481 Sat Mar 13 08:58:44 IST 2010 Count.class
1377 Sat Mar 13 08:58:44 IST 2010 DataFileTable$1.class
954 Sat Mar 13 08:58:44 IST 2010 DataFileTable$2.class
954 Sat Mar 13 08:58:44 IST 2010 DataFileTable$3.class
591 Sat Mar 13 08:58:44 IST 2010 DataFileTable$4.class
8815 Sat Mar 13 08:58:44 IST 2010 DataFileTable.class
4141 Sat Mar 13 08:58:44 IST 2010 DataFileTableModel.class
900 Sat Mar 13 08:58:44 IST 2010 DownloadingDialog.class
479 Sat Mar 13 08:58:44 IST 2010 EmailClient$1.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$10.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$11.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$12.class
506 Sat Mar 13 08:58:44 IST 2010 EmailClient$2.class
1296 Sun Feb 07 19:00:38 IST 2010 EmailClient$3$1.class
872 Sat Mar 13 08:58:44 IST 2010 EmailClient$3.class
1355 Sat Mar 13 08:58:44 IST 2010 EmailClient$4.class
984 Sat Mar 13 08:58:44 IST 2010 EmailClient$5.class
505 Sat Mar 13 08:58:44 IST 2010 EmailClient$6.class
1914 Sat Mar 13 08:58:44 IST 2010 EmailClient$7.class
553 Sat Mar 13 08:58:44 IST 2010 EmailClient$8.class
1259 Sat Mar 13 08:58:44 IST 2010 EmailClient$9.class
3355 Sat Mar 13 08:58:44 IST 2010 EmailClient$Checker.class
14459 Sat Mar 13 08:58:44 IST 2010 EmailClient.class
1993 Sat Mar 13 08:58:44 IST 2010 Learner.class
537 Sat Mar 13 08:58:44 IST 2010 MessageDialog$1.class
564 Sat Mar 13 08:58:44 IST 2010 MessageDialog$2.class
564 Sat Mar 13 08:58:44 IST 2010 MessageDialog$3.class
4696 Sat Mar 13 08:58:44 IST 2010 MessageDialog.class
2663 Sat Mar 13 08:58:44 IST 2010 MessagesTableModel.class
354 Thu Feb 25 07:25:44 IST 2010 WindowCloser.class
14 years ago
i created a jar file in eclipse.

my manifest file is:

Manifest-Version: 1.0
Main-Class: EmailClient
Class-Path: mail.jar

when i click the jar file i am getting

cannot find main class.program will exit.

please help..


14 years ago
thanks .i corrected that one. but now when i run i m getting

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find
file '(unknown)'.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Test.main(Test.java:11)

the code




i m getting ';' expected

please help
we are developing a standalone application where we have to access the database to retrieve information. how can we automatically connect to the database from our application .
14 years ago