You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/08/05 14:59:38 UTC

svn commit: r1154197 - in /incubator/lcf/branches/CONNECTORS-236: connectors/cmis/ connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ connectors/cmis/connector/src/test/ connectors/cmis/connector/src/test/java/ conne...

Author: kwright
Date: Fri Aug  5 12:59:38 2011
New Revision: 1154197

URL: http://svn.apache.org/viewvc?rev=1154197&view=rev
Log:
Apply patch4

Added:
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/Base.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseHSQLDB.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BasePostgresql.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityHSQLDBTest.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityPostgresqlTest.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityTest.java
Modified:
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    incubator/lcf/branches/CONNECTORS-236/connectors/cmis/pom.xml
    incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityTest.java
    incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java

Modified: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1154197&r1=1154196&r2=1154197&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java Fri Aug  5 12:59:38 2011
@@ -80,7 +80,8 @@ public class CmisRepositoryConnector ext
   protected final static String ACTIVITY_READ = "read document";
   protected static final String RELATIONSHIP_CHILD = "child";
 
-  private static final String CMIS_FOLDER_BASE_TYPE = "Folder";
+  private static final String CMIS_FOLDER_BASE_TYPE = "cmis:folder";
+  private static final String CMIS_DOCUMENT_BASE_TYPE = "cmis:document";
   private static final SimpleDateFormat ISO8601_DATE_FORMATTER = new SimpleDateFormat(
       "yyyy-MM-dd'T'HH:mm:ssZ");
 
@@ -893,9 +894,9 @@ public class CmisRepositoryConnector ext
       
       String errorCode = "OK";
       String errorDesc = StringUtils.EMPTY;
+      String baseTypeId = cmisObject.getBaseType().getId();
 
-      if (cmisObject.getBaseType().getDisplayName()
-          .equals(CMIS_FOLDER_BASE_TYPE)) {
+      if (baseTypeId.equals(CMIS_FOLDER_BASE_TYPE)) {
 
         // adding all the children for a folder
 
@@ -906,7 +907,7 @@ public class CmisRepositoryConnector ext
               RELATIONSHIP_CHILD);
         }
 
-      } else {
+      } else if(baseTypeId.equals(CMIS_DOCUMENT_BASE_TYPE)){
 
         // content ingestion
 
@@ -1022,9 +1023,17 @@ public class CmisRepositoryConnector ext
     int i = 0;
     while (i < rval.length){
       CmisObject cmisObject = session.getObject(documentIdentifiers[i]);
-      if (!cmisObject.getBaseType().getDisplayName().equals(CMIS_FOLDER_BASE_TYPE)) {
+      if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
         Document document = (Document) cmisObject;
-        rval[i] = document.getVersionLabel();
+        
+        //we have to check if this CMIS repository support versioning
+        // or if the versioning is disabled for this content
+        if(StringUtils.isNotEmpty(document.getVersionLabel())){
+          rval[i] = document.getVersionLabel();
+        } else {
+        //a CMIS document that doesn't contain versioning information will always be processed
+          rval[i] = StringUtils.EMPTY;
+        }
       } else {
         //a CMIS folder will always be processed
         rval[i] = StringUtils.EMPTY;

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/Base.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/Base.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/Base.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/Base.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,36 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class Base extends org.apache.manifoldcf.crawler.tests.ConnectorBase
+{
+  
+  protected String[] getConnectorNames()
+  {
+    return new String[]{"CMIS"};
+  }
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector"};
+  }
+
+}

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseHSQLDB.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseHSQLDB.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseHSQLDB.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,36 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class BaseHSQLDB extends org.apache.manifoldcf.crawler.tests.ConnectorBaseHSQLDB
+{
+  
+  protected String[] getConnectorNames()
+  {
+    return new String[]{"CMIS"};
+  }
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector"};
+  }
+
+}

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BasePostgresql.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BasePostgresql.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BasePostgresql.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BasePostgresql.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,36 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+
+/** This is a testing base class that is responsible for setting up/tearing down the agents framework. */
+public class BasePostgresql extends org.apache.manifoldcf.crawler.tests.ConnectorBasePostgresql
+{
+  
+  protected String[] getConnectorNames()
+  {
+    return new String[]{"CMIS"};
+  }
+  
+  protected String[] getConnectorClasses()
+  {
+    return new String[]{"org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector"};
+  }
+
+}

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityHSQLDBTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityHSQLDBTest.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityHSQLDBTest.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityHSQLDBTest.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+import org.junit.Test;
+
+/** This is a very basic sanity check */
+public class SanityHSQLDBTest extends BaseHSQLDB
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityPostgresqlTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityPostgresqlTest.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityPostgresqlTest.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityPostgresqlTest.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+import org.junit.Test;
+
+/** This is a very basic sanity check */
+public class SanityPostgresqlTest extends BasePostgresql
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Added: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityTest.java?rev=1154197&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityTest.java (added)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/SanityTest.java Fri Aug  5 12:59:38 2011
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+import org.junit.Test;
+
+/** This is a very basic sanity check */
+public class SanityTest extends Base
+{
+  
+  @Test
+  public void sanityCheck()
+    throws Exception
+  {
+    // If we get this far, it must mean that the setup was successful, which is all that I'm shooting for in this test.
+  }
+  
+
+}

Modified: incubator/lcf/branches/CONNECTORS-236/connectors/cmis/pom.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/connectors/cmis/pom.xml?rev=1154197&r1=1154196&r2=1154197&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/connectors/cmis/pom.xml (original)
+++ incubator/lcf/branches/CONNECTORS-236/connectors/cmis/pom.xml Fri Aug  5 12:59:38 2011
@@ -66,12 +66,57 @@
 		<dependency>
     		<groupId>org.apache.chemistry.opencmis</groupId>
     		<artifactId>chemistry-opencmis-client-impl</artifactId>
-    		<version>0.5.0-SNAPSHOT</version>
+    		<version>0.4.0</version>
  		</dependency>
  		<dependency>
     		<groupId>commons-lang</groupId>
     		<artifactId>commons-lang</artifactId>
     		<version>2.6</version>
 		</dependency>
+		<dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mcf-core</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mcf-agents</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>mcf-pull-agent</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>postgresql</groupId>
+      <artifactId>postgresql</artifactId>
+      <version>${postgresql.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>${hsqldb.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <version>${derby.version}</version>
+      <scope>test</scope>
+    </dependency>
 	</dependencies>
 </project>
\ No newline at end of file

Modified: incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityTest.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityTest.java?rev=1154197&r1=1154196&r2=1154197&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityTest.java (original)
+++ incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityTest.java Fri Aug  5 12:59:38 2011
@@ -70,7 +70,7 @@ public class APISanityTest extends Base
 
     // user credentials
     parameters.put(SessionParameter.USER, CMIS_USERNAME);
-    parameters.put(SessionParameter.PASSWORD, CMIS_USERNAME);
+    parameters.put(SessionParameter.PASSWORD, CMIS_PASSWORD);
 
     // connection settings
     parameters.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER);

Modified: incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java?rev=1154197&r1=1154196&r2=1154197&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java (original)
+++ incubator/lcf/branches/CONNECTORS-236/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java Fri Aug  5 12:59:38 2011
@@ -264,7 +264,7 @@ public class Base extends org.apache.man
     server.start();
 
     cmisServer = new Server(9090);
-    server.setStopAtShutdown(true);
+    cmisServer.setStopAtShutdown(true);
 
     String openCmisServerWarPath = "../../lib/chemistry-opencmis-server-inmemory-war-0.5.0-SNAPSHOT.war";
 
@@ -277,15 +277,26 @@ public class Base extends org.apache.man
     cmisServer.addHandler(openCmisServerApi);
     
     cmisServer.start();
+    boolean entered = false;
     
-    // If all worked, then we can start the daemon.
-    // Clear the agents shutdown signal.
-    IThreadContext tc = ThreadContextFactory.make();
-    ILockManager lockManager = LockManagerFactory.make(tc);
-    lockManager.clearGlobalFlag(agentShutdownSignal);
-
-    daemonThread = new DaemonThread();
-    daemonThread.start();
+    while(server.isStarted() 
+        && cmisServer.isStarted() 
+        && openCmisServerApi.isStarted()
+        && lcfApi.isStarted()
+        && lcfAuthorityService.isStarted()
+        && lcfCrawlerUI.isStarted()
+        && !entered){
+      entered = true;
+      ManifoldCF.sleep(5000);
+      // If all worked, then we can start the daemon.
+      // Clear the agents shutdown signal.
+      IThreadContext tc = ThreadContextFactory.make();
+      ILockManager lockManager = LockManagerFactory.make(tc);
+      lockManager.clearGlobalFlag(agentShutdownSignal);
+  
+      daemonThread = new DaemonThread();
+      daemonThread.start();
+    }
   }
   
   @After