FreeStyleProject project = createFreeStyleProject();
P4Web browser = new P4Web(new URL("http://localhost/"));
PerforceToolInstallation tool = new PerforceToolInstallation("test_installation", "p4.exe", Collections.<ToolProperty<?>>emptyList());
DescriptorImpl descriptor = (DescriptorImpl) Hudson.getInstance().getDescriptor(PerforceToolInstallation.class);
descriptor.setInstallations(new PerforceToolInstallation[] { tool });
descriptor.save();
String password = "pass";
PerforceSCM scm = new PerforceSCM(
"user", password, "client", "port", "", "test_installation", "sysRoot",
"sysDrive", "label", "counter", "upstreamProject", "shared", "charset", "charset2", "user", false, true, true, true, true, true, false,
false, false, true, false, false, "${basename}", 0, -1, browser, "exclude_user", "exclude_file", true, EMPTY_DEPOT, EMPTY_WORKSPACE_CLEANUP, EMPTY_MASKVIEW);