Deployment stuff.

Filesystem deployment can now run a given java class, or external
program on commit.
Changed signatures of DeploymentService methods
to take a NameMatcher to act as an exclusion
filter for deployment. This works for filesystem deployment
but isn't in place for alfresco->alfresco deployment.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6214 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2007-07-11 21:03:48 +00:00
parent ac022ce7ca
commit edd333a029
5 changed files with 91 additions and 35 deletions

View File

@@ -32,6 +32,7 @@ import org.alfresco.service.cmr.avm.deploy.DeploymentEvent;
import org.alfresco.service.cmr.avm.deploy.DeploymentReport;
import org.alfresco.service.cmr.avm.deploy.DeploymentService;
import org.alfresco.util.Deleter;
import org.alfresco.util.NameMatcher;
import org.springframework.context.support.FileSystemXmlApplicationContext;
/**
@@ -56,8 +57,10 @@ public class FSDeploymentTest extends AVMServiceTestBase
FileSystemXmlApplicationContext receiverContext =
new FileSystemXmlApplicationContext("../deployment/config/application-context.xml");
DeploymentService service = (DeploymentService)fContext.getBean("DeploymentService");
NameMatcher matcher = (NameMatcher)fContext.getBean("globalPathExcluder");
setupBasicTree();
DeploymentReport report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", false, false, false, null);
fService.createFile("main:/a/b", "fudge.bak").close();
DeploymentReport report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", matcher, false, false, false, null);
int count = 0;
for (DeploymentEvent event : report)
{
@@ -65,7 +68,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
count++;
}
assertEquals(10, count);
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", false, false, false, null);
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", matcher, false, false, false, null);
count = 0;
for (DeploymentEvent event : report)
{
@@ -75,7 +78,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
assertEquals(2, count);
fService.createFile("main:/d", "jonathan").close();
fService.removeNode("main:/a/b");
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", false, false, false, null);
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", matcher, false, false, false, null);
count = 0;
for (DeploymentEvent event : report)
{
@@ -85,7 +88,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
assertEquals(4, count);
fService.removeNode("main:/d/e");
fService.createFile("main:/d", "e").close();
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", false, false, false, null);
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", matcher, false, false, false, null);
count = 0;
for (DeploymentEvent event : report)
{
@@ -96,7 +99,7 @@ public class FSDeploymentTest extends AVMServiceTestBase
fService.removeNode("main:/d/e");
fService.createDirectory("main:/d", "e");
fService.createFile("main:/d/e", "Warren.txt").close();
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", false, false, false, null);
report = service.deployDifferenceFS(-1, "main:/", "localhost", 44100, "Giles", "Watcher", "sampleTarget", matcher, false, false, false, null);
count = 0;
for (DeploymentEvent event : report)
{
@@ -116,6 +119,16 @@ public class FSDeploymentTest extends AVMServiceTestBase
Deleter.Delete(data);
Deleter.Delete(metadata);
Deleter.Delete(target);
File dot = new File(".");
String[] listing = dot.list();
for (String name : listing)
{
if (name.startsWith("dep-record-"))
{
File file = new File(name);
file.delete();
}
}
}
}
}