Task #329

Fix all OnlineApps Secured Mailbox Unit Test bugs

Added by Tan Lee Yong about 14 years ago. Updated over 12 years ago.

Status:Work Completed-End life cycleStart date:August 04, 2010
Priority:NormalDue date:September 30, 2010
Assignee:Hafizudin MD% Done:

0%

Category:-Spent time:-
Target version:-

Description

Fix all the unix test error

History

#1 Updated by Nandong Frank about 14 years ago

  • % Done changed from 0 to 10

Below is the error find on these method:
protected static MailBoxTableObjectInterface getTableObject (MAILBOX location) {
testData = new TestDataUtil("net.penril.onlineapps.securedmailbox.testdata.t35");
MailBoxTableObjectInterface obj = null;
try {
obj = testData.getDBData(location);
}
catch (DateTimeException e) {
e.printStackTrace();
}
return obj;
}

#2 Updated by Nandong Frank about 14 years ago

Find the failure trace for 3 method in test class:

testDeleteMessageFromInbox
testDeleteMessageFromSentBox
testDeleteMessageFromTrashCan

Those thing i need to fix.

#3 Updated by Nandong Frank about 14 years ago

Today I want to fix :

testDeleteMessageFromInbox

#4 Updated by Nandong Frank about 14 years ago

In SecuredMailbox.java, until below code, it stop and throw Exception:
tableObject = fromMailBox.selectObjectFromMailBox (dao, messageId);

---
Try to testing the code for get the data from properties:
1. ResourceUtils ResourceUtilsT = new ResourceUtils("net.penril.onlineapps.securedmailbox.testdata.t9", TestDataUtil.class);

Result : It can retrieve the data.

2. testData = new TestDataUtil("net.penril.onlineapps.securedmailbox.testdata.t35");
MailBoxTableObjectInterface obj = null;
obj = testData.getDBData(MAILBOX.MAILINBOX);

Result : It can retrieve the data.

#5 Updated by Nandong Frank about 14 years ago

got Exception:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key CreationDate_1

#6 Updated by Nandong Frank about 14 years ago

I check here No problem with sResourcePropertiesFileURL :
protected ResourceUtils c_objResourceUtils = null;
private BaseHibernateDao dao = null;

protected static String c_sResourcePropertiesFileURL = "net/penril/onlineapps/securedmailbox/resource/message";

when i testing today:
can get the value from message.properties...

But still failure traces:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key CreationDate_1
at java.util.ResourceBundle.getObject(ResourceBundle.java:325)

#7 Updated by Nandong Frank about 14 years ago

update new commonUtil from mercurial server and put into onlineAppsMailbox as Jar files, testing for ResourceUtils.class bcz still failure.

Can't find resource for bundle java.util.PropertyResourceBundle, key CreationDate_1

#8 Updated by Nandong Frank about 14 years ago

Either the file is missing or the key

check the message on message.properties
data.notnull
data.recipient
invalid.input.data
invalid.input.data.method
message.id.notfound
mailbox.notset
data.cantfind
message.id.notfound
data.notnull
data.mustgiven
data.compulsory
db.duplicate

Testing it today if this message tht doesn't inside java class mailbox make it failure.

#9 Updated by Nandong Frank about 14 years ago

  • % Done changed from 10 to 20

This failure has been fixed:
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key CreationDate_1
at java.util.ResourceBundle.getObject(ResourceBundle.java:325)

by update ResourceUtil
just commented the null (c_objResourceHandle==null) checking.

#10 Updated by Nandong Frank about 14 years ago

got failure: java.lang.AssertionError:null in test case DeleteMessageTest.
affected method:
1. testDeleteMessageFromInbox
2. testDeleteMessageFromSentBox
3. testDeleteMessageFromArchive

find the error using junit test, the error found in here :
else if(!result.getLastActionUserId().equals(expectedResult.getLastActionUserId())){
a = false;
}
- LastActionUserId in result not same with expected result

Fixed already:
Solution -
just change the t8.properties/t9.properties/t10.properties

#11 Updated by Nandong Frank about 14 years ago

  • % Done changed from 20 to 30

ReplyMessageTest class have failure method:
failure: net.penril.onlineapps.securedmailbox.exception.InvalidMessageBeanException: The message must be provided!

method that affected:
1. testReplyMessageForOneRecipientFromInbox
2. testReplyMessageForOneRecipientFromSentBox
3. testReplyMessageForOneRecipientFromArchive
4. testReplyMessageForOneRecipientFromTrashCan

- solution:
fix at class , TestDataUtil.java
c_objResourceUtilsT = new ResourceUtils(testURL, TestDataUtil.class);

put on method public List<MessageBean> getInputData(final int numberOfInputDataSet, final int numberOfRecipient) throws DateTimeException {
c_objResourceUtilsT = new ResourceUtils(testURL, TestDataUtil.class);

}

#12 Updated by Nandong Frank about 14 years ago

ArchiveMessageTest.java
got failure: java.lang.AssertionError:null

find the error using junit test, the error found in here :
else if(!result.getLastActionUserId().equals(expectedResult.getLastActionUserId())){
a = false;
}
- LastActionUserId in result not same with expected result
1
Effected method
1. testArchiveMessageFromInbox
2. testArchiveMessageFromSentBox
3. testArchiveMessageFromTrashCan
solution:
change the LastActionID in properties:
LastActionUserId_1=2 change to 1
t5.properties
t6.properties
t7.properties

#13 Updated by Nandong Frank about 14 years ago

  • % Done changed from 30 to 50

2 action java class test case got failure:
1. RestoreArchiveMessageTest.java
method : testRestoreArchiveMessageToInbox.

failure trace:
savedResult = null;

2. RestoreDeletedMessageTest.java
method : testRestoreDeletedMessageToInbox.
failure trace:
savedResult = null;

Today fix it.

#14 Updated by Nandong Frank about 14 years ago

lastActionDate1.equals(lastActionDate2)&& - here got problem

#15 Updated by Nandong Frank about 14 years ago

1. RestoreArchiveMessageTest.java
method that has failure: testRestoreArchiveMessageToInbox
failure: java.lang.AssertionError:null

description about the failure:
lastActionDate1.equals(lastActionDate2)

The lastActionDate1 are not same with lastActionDate2.
lastActionDate1 is from savedResult form t35.properties
lastActionDate2 is form expectedResult where it set to new date.

in method testRestoreArchiveMessageToInbox it use
assertTrue(testUtil.compareMailBoxTableObjectInterfaceList(savedResult, expectedSavedResult));

becouse it list.

solution:
change to list : testUtil.compareMailBoxTableObjectInterfaceList(savedResult, expectedSavedResult)

then the i commented:
lastActionDate1.equals(lastActionDate2)

#16 Updated by Nandong Frank about 14 years ago

  • % Done changed from 50 to 80

2. RestoreDeletedMessageTest.java
RestoreDeletedMessageTest method have failure:
failure: java.lang.AssertionError:null

problem is here: lastActionUserId1.equals(lastActionUserId2)

#17 Updated by Nandong Frank about 14 years ago

  • % Done changed from 80 to 90

fixed the problem for problem is here: lastActionUserId1.equals(lastActionUserId2).

solution:
just make the lastAction_1 to RESTORE in t36.properties and commented the expectedResult.setLastAction(ACTION.UNDELETE.toString()); becouse properties already set the
expectedResult in properties file t36.properties.

#18 Updated by Nandong Frank about 14 years ago

Got more failure, because i update new sources class and test case from cheeping and hafiz.

#19 Updated by Nandong Frank about 14 years ago

need to put MailBoxTableObjectRecipient in TestDataUtil.java

#20 Updated by Nandong Frank about 14 years ago

RestoreArchiveMessageTest have failure:
in method, testArchiveMessageFromTrashCan:
java.lang.AssertionError.java.text.ParseException

#21 Updated by Nandong Frank about 14 years ago

class files:
RestoreDeletedMessageTest
RestoreArchiveMessageTest

method that effected:
testRestoreArchiveMessageToInbox
testRestoreDeletedMessageToInbox
fixed it:
just put the recipient on it:
MailInboxRecipient savedRecipientResult = (MailInboxRecipient) dao.getSavedInboxRecipientObject();
MailBoxTableObjectRecipient expectedSavedRecipientResult = dao.selectRecipientObject(MailInbox.class, id);
expectedSavedRecipientResult.setLastAction(ACTION.RESTORE.toString());
expectedSavedRecipientResult.setLastActionUserId(String.valueOf(id));
assertTrue(SendMessageTest.tableEqualRecipient(savedRecipientResult, expectedSavedRecipientResult));

#22 Updated by Nandong Frank about 14 years ago

Fix Failure for GetMessageTest.java

#23 Updated by Nandong Frank about 14 years ago

Failed in those class test:
class files:
RestoreDeletedMessageTest
RestoreArchiveMessageTest

method that effected:
testRestoreArchiveMessageToInbox
testRestoreDeletedMessageToInbox
fixed it:
just put the recipient on it:
MailInboxRecipient savedRecipientResult = (MailInboxRecipient) dao.getSavedInboxRecipientObject();
MailBoxTableObjectRecipient expectedSavedRecipientResult = dao.selectRecipientObject(MailInbox.class, id);
expectedSavedRecipientResult.setLastAction(ACTION.RESTORE.toString());
expectedSavedRecipientResult.setLastActionUserId(String.valueOf(id));
assertTrue(SendMessageTest.tableEqualRecipient(savedRecipientResult, expectedSavedRecipientResult));

--------
fix ReplyMessageTest.java
// added recipient
//MailBoxTableObjectInterface expectedSentBoxResult = (MailSentBox)tester.convertMessageBeanObjectToSentBoxObject(inputResultBean);
MailBoxTableObjectRecipient expectedSentBoxRecipientResult = (MailBoxTableObjectRecipient) tester.convertMessageBeanObjectToSentBoxRecipientObject(inputResultBean);
//A success replyMessage() method will set the last action to REPLY
expectedSentBoxRecipientResult.setLastAction(ACTION.REPLY.toString());

change the method in ReplyMessageTest.java
method:
testSearchByLastActionDateFromInbox
testSearchByLastActionDateFromSentBox
testSearchByLastActionDateFromArchive
testSearchByLastActionFromTrashCan

--
testSearchByRecipientIdFromInbox
testSearchByRecipientIdFromSentBox
testSearchByRecipientIdFromTrashCan
testSearchByRecipientNameFromArchive

#24 Updated by Nandong Frank about 14 years ago

Fixed Failure on ReplyMessageTest class test:
- testReplyMessageForOneRecipientFromInbox()
- testReplyMessageForOneRecipientFromSentBox()
- testReplyMessageForOneRecipientFromArchive()
- testReplyMessageForOneRecipientFromTrashCan()

#25 Updated by Nandong Frank about 14 years ago

class file:
SearchMessageTest.java

Fix testSearchByLastActionDateFromInbox method which have failure:
failure, no key sendStatus

Solution:
fix buy find using JUNIT and put in sendStatus_1 = 1 , in t15.properties

#26 Updated by Nandong Frank about 14 years ago

Class file: SearchMessageTest.java

method : testSearchByCreationDateFromTrashCan
failure:
can't find resource for bundle java.util.PropertyResourceBundle, key SendStatus_1

method : testSearchByCreationDateFromArchive:
failure:
can't find resource for bundle java.util.PropertyResourceBundle, key SendStatus_1

method : testSearchByCreationDateFromSentBox
failure:
can't find resource for bundle java.util.PropertyResourceBundle, key SendStatus_1

method : testSearchByCreationDateFromInbox
failure:
can't find resource for bundle java.util.PropertyResourceBundle, key SendStatus_1

Solution in SearchMessageTest unit test:
SearchMessageTest
sendStatus_1 = 1 , put in properties files

#27 Updated by Tan Lee Yong almost 14 years ago

  • Due date changed from August 13, 2010 to September 30, 2010
  • Status changed from New - Begin Life Cycle to Development / Work In Progress
  • Assignee changed from Nandong Frank to Hafizudin MD

#28 Updated by Hafizudin MD almost 14 years ago

  • % Done changed from 90 to 0

#29 Updated by Hafizudin MD over 12 years ago

  • Status changed from Development / Work In Progress to Work Completed-End life cycle

end this task

Also available in: Atom PDF