1. Fix : Storage thread in some conditions is not started and contactlist is not saved

2. Fix metacontactlis tests - reloading of contactlist too quickly prevents saving the last operation with the list
3. Some spell checks
cusax-fix
Damian Minkov 18 years ago
parent 3df04bb51c
commit 9123fe0bfe

@ -676,7 +676,7 @@
<!-- The following two configure felix telling it that it's running
as a test environment-->
<sysproperty key="felix.config.properties"
value="file:./lib/felix.unit.test.properties"/>
value="file:${lib}/felix.unit.test.properties"/>
<!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
@ -688,7 +688,7 @@
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="lib/logging.properties"/>
value="${lib}/logging.properties"/>
<!-- Tell all protocol testers their account details. -->
<syspropertyset id="accounts">

@ -65,7 +65,7 @@ public class MclStorageManager
private BundleContext bundleContext = null;
/**
* The file acces service that we'll be using in order to obtain a reference
* The file access service that we'll be using in order to obtain a reference
* to the contact list file.
*/
private FileAccessService faService = null;
@ -98,7 +98,7 @@ public class MclStorageManager
private FailSafeTransaction contactlistTrans = null;
/**
* A regerence to the MetaContactListServiceImpl that created and started us.
* A reference to the MetaContactListServiceImpl that created and started us.
*/
private MetaContactListServiceImpl mclServiceImpl = null;
@ -209,7 +209,7 @@ public class MclStorageManager
* other words that it has successfully found and read the xml contact list
* file.
*
* @return true if the storage manager has been successfully initialialized
* @return true if the storage manager has been successfully initialized
* and false otherwise.
*/
boolean isStarted()
@ -239,7 +239,7 @@ public void stop ()
* @param mclServiceImpl a reference to the currently valid instance of the
* <tt>MetaContactListServiceImpl</tt> that we could use to pass parsed
* contacts and contact groups.
* @throws IOException if the contact lsit file specified file does not
* @throws IOException if the contact list file specified file does not
* exist and could not be created.
* @throws XMLException if there is a problem with the file syntax.
*/
@ -344,10 +344,10 @@ void start(BundleContext bc,
logger.error("Error finding configuration for default parsers", ex);
}
this.launchStorageThread();
mclServiceImpl.addMetaContactListListener(this);
this.mclServiceImpl = mclServiceImpl;
started = true;
this.launchStorageThread();
}
/**
@ -545,11 +545,11 @@ private void initVirginDocument(MetaContactListServiceImpl mclServiceImpl,
* file and calls corresponding "add" methods
* belonging to <tt>mclServiceImpl</tt> for every meta contact and meta
* contact group stored in the (conteactlist.xml) file that correspond to a
* provider carying the specified <tt>accountID</tt>.
* provider caring the specified <tt>accountID</tt>.
*
* @param accountID the identifier of the account whose contacts we're
* interested in.
* @throws XMLException if a problem occurs while parsing contact lsit
* @throws XMLException if a problem occurs while parsing contact list
* contents.
*/
void extractContactsForAccount(String accountID)
@ -590,7 +590,7 @@ void extractContactsForAccount(String accountID)
}
/**
* Parses <tt>groupNode</tt> and all of its subnodes, createing
* Parses <tt>groupNode</tt> and all of its subnodes, creating
* corresponding instances through <tt>mclServiceImpl</tt> as children of
* <tt>parentGroup</tt>
*
@ -598,7 +598,7 @@ void extractContactsForAccount(String accountID)
* creating new contacts and groups.
* @param accountID a String identifier of the account whose contacts we're
* interested in.
* @param groupNode teh XML <tt>Element</tt> that points to the group we're
* @param groupNode the XML <tt>Element</tt> that points to the group we're
* currently parsing.
* @param parentGroup the <tt>MetaContactGroupImpl</tt> where we should be
* creating children.
@ -839,11 +839,11 @@ private void processGroupXmlNode(
* Returns all proto contacts that are encapsulated inside the meta contact
* represented by <tt>metaContactNode</tt> and that originate from the
* account with id - <tt>accountID</tt>. The returned list contains contact
* contact descriptors as elements. In case the meta cotnact does
* contact descriptors as elements. In case the meta contact does
* not contain proto contacts originating from the specified account, an
* empty list is returned.
* <p>
* @param metaContactNode the Element whose proto contacts we'd likde to
* @param metaContactNode the Element whose proto contacts we'd like to
* extract.
* @param accountID the id of the account whose contacts we're interested in.
* @param protoGroups a map binding proto group UIDs to protogroups, that
@ -1118,7 +1118,7 @@ public void metaContactAdded(MetaContactEvent evt)
}
catch (IOException ex){
/**given we're being invoked from an event dispatch thread that was
proberly triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after adding contact "
+ evt.getSourceMetaContact(), ex);
@ -1168,7 +1168,7 @@ public void metaContactGroupAdded(MetaContactGroupEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread that was
proberly triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after adding contact "
+ evt.getSourceMetaContactGroup(), ex);
@ -1201,7 +1201,7 @@ public void metaContactGroupRemoved(MetaContactGroupEvent evt)
}
catch (IOException ex){
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after removing group "
+ evt.getSourceMetaContactGroup(), ex);
@ -1251,7 +1251,7 @@ public void metaContactMoved(MetaContactMovedEvent evt)
}
catch (IOException ex){
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after moving "
+ evt.getSourceMetaContact(), ex);
@ -1333,7 +1333,7 @@ public void metaContactRemoved(MetaContactEvent evt)
}
catch (IOException ex){
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after removing "
+ evt.getSourceMetaContact(), ex);
@ -1371,7 +1371,7 @@ public void metaContactRenamed(MetaContactRenamedEvent evt)
}
catch (IOException ex){
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after rename of "
+ evt.getSourceMetaContact(), ex);
@ -1412,7 +1412,7 @@ public void protoContactRemoved(ProtoContactEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after removing proto contact "
+ evt.getProtoContact(), ex);
@ -1422,7 +1422,7 @@ public void protoContactRemoved(ProtoContactEvent evt)
/**
* We simply ignore - we're not interested in this kind of events.
* @param evt the <tt>MetaContactGroupEvent</tt> containind details of this
* @param evt the <tt>MetaContactGroupEvent</tt> containing details of this
* event.
*/
public void childContactsReordered(MetaContactGroupEvent evt)
@ -1475,7 +1475,7 @@ public void metaContactGroupModified(MetaContactGroupEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread
* that was proberly triggerred by a net operation - we
* that was probably triggered by a net operation - we
* could not do much. so ... log and @todo one day we'll
* have a global error dispatcher */
logger.error("Writing CL failed after adding contact "
@ -1499,7 +1499,7 @@ public void metaContactGroupModified(MetaContactGroupEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after removing proto group "
+ evt.getSourceProtoGroup().getGroupName(), ex);
@ -1538,7 +1538,7 @@ public void protoContactAdded(ProtoContactEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after adding proto contact "
+ evt.getProtoContact(), ex);
@ -1593,7 +1593,7 @@ public void protoContactMoved(ProtoContactEvent evt)
catch (IOException ex)
{
/**given we're being invoked from an event dispatch thread that was
probably triggerred by a net operation - we could not do much.
probably triggered by a net operation - we could not do much.
so ... log and @todo one day we'll have a global error dispatcher */
logger.error("Writing CL failed after moving proto contact "
+ evt.getProtoContact(), ex);

@ -71,7 +71,7 @@ public static Test suite()
/**
* In this test we only create a meta contact and move it somewhere else.
* This is a delicate operation since any underlying storage method would
* have to not only move the meta contact itslef but also make sure that all
* have to not only move the meta contact itself but also make sure that all
* proto contacts have been moved to protogroups accordingly. We don't do
* any real testing inside this method. The testing would be happening
* during reload and it would fail if the contacts moved in this method
@ -112,6 +112,12 @@ public void testCreateAndMoveMetaContact()
public void testReloadMetaContactListBundle()
throws Exception
{
Object o = new Object();
synchronized(o){
// wait other operations to finish before reloading
o.wait(1000);
}
Bundle metaClBundle = findMetaClBundle();
//uninstall the meta contact list service
@ -217,7 +223,7 @@ public void testPartialContactListRestauration()
}
/**
* Register the remaing protocol providers and make sure that they too are
* Register the remaining protocol providers and make sure that they too are
* properly loaded inside the contact list. We also need to verify that
* proto contacts that have been merged in a single meta contact are still
* merged.

Loading…
Cancel
Save