1 17 package org.alfresco.filesys.smb.server.repo; 18 19 import org.alfresco.filesys.CIFSServer; 20 import org.alfresco.filesys.server.filesys.DiskSharedDevice; 21 import org.alfresco.service.ServiceRegistry; 22 import org.alfresco.service.cmr.repository.NodeRef; 23 import org.alfresco.service.cmr.repository.NodeService; 24 import org.alfresco.util.BaseAlfrescoTestCase; 25 26 31 public class CifsIntegrationTest extends BaseAlfrescoTestCase 32 { 33 34 public void testGetServerName() 35 { 36 CIFSServer cifsServer = (CIFSServer) ctx.getBean("cifsServer"); 37 assertNotNull("No CIFS server available", cifsServer); 38 if (!cifsServer.isStarted()) 40 { 41 return; 42 } 43 44 String serverName = cifsServer.getConfiguration().getServerName(); 46 assertNotNull("No server name available", serverName); 47 assertTrue("No server name available (zero length)", serverName.length() > 0); 48 49 51 DiskSharedDevice mainFilesys = cifsServer.getConfiguration().getPrimaryFilesystem(); 52 53 if ( mainFilesys != null) 54 { 55 57 String shareName = mainFilesys.getName(); 58 assertNotNull("No share name available", shareName); 59 assertTrue("No share name available (zero length)", shareName.length() > 0); 60 61 63 ContentContext filesysCtx = (ContentContext) mainFilesys.getContext(); 64 assertNotNull("Content context is null", filesysCtx); 65 assertNotNull("Store id is null", filesysCtx.getStoreName()); 66 assertNotNull("Root path is null", filesysCtx.getRootPath()); 67 assertNotNull("Root node is null", filesysCtx.getRootNode()); 68 69 71 NodeService nodeService = (NodeService) ctx.getBean(ServiceRegistry.NODE_SERVICE.getLocalName()); 72 NodeRef shareNodeRef = filesysCtx.getRootNode(); 74 assertNotNull("No share root node available", shareNodeRef); 75 assertTrue("Share root node doesn't exist", nodeService.exists(shareNodeRef)); 76 } 77 } 78 } 79 | Popular Tags |