Hi all
Thank you for the help on the first run, I have spent some more time
but I did not understand how some core part suppose to work, I have a
failing test that
do what suppose to do but with latest core does not fail
FreeStyleProject job = createSignApkJob();
SignApksBuilder builder = new SignApksBuilder();
builder.setKeyStoreId(KEY_STORE_ID);
builder.setKeyAlias(KEY_ALIAS);
builder.setApksToSign("**/*-unsigned.apk");
builder.setArchiveSignedApks(!builder.getArchiveSignedApks());
builder.setArchiveUnsignedApks(!builder.getArchiveUnsignedApks());
builder.setAndroidHome(androidHome.getRemote());
job.getBuildersList().add(builder);
Build build = testJenkins.buildAndAssertSuccess(job);
FilePath workspace = build.getWorkspace();
for (int i = 0; i < (FilePath.VALIDATE_ANT_FILE_MASK_BOUND + 1); i++) {
workspace.createTempFile(String.format("%06d", i), ".tmp");
}
SignApksBuilder.SignApksDescriptor desc =
(SignApksBuilder.SignApksDescriptor)
testJenkins.jenkins.getDescriptor(SignApksBuilder.class);
String jobUrl = job.getUrl();
String checkUrl = jobUrl + "/" + desc.getDescriptorUrl() +
"/checkApksToSign?value=" + URLEncoder.encode("**/*-unsigned.apk",
"utf-8");
HtmlPage page = testJenkins.createWebClient().goTo(checkUrl);
String pageText = page.getWebResponse().getContentAsString();
assertThat(pageText,
not(containsString(InterruptedException.class.getSimpleName())));
assertThat(pageText,
containsString(Messages.validation_globSearchLimitReached(FilePath.VALIDATE_ANT_FILE_MASK_BOUND)));
As far as I know what is doing is that create > 10000 files in the
folder and expect to rise a crash and assert it.
The exception should come from the formValidation
public FormValidation doCheckApksToSign(@AncestorInPath
AbstractProject project, @QueryParameter String value) throws
IOException {
if (project == null) {
return FormValidation.warning(Messages.validation_noProject());
}
project.checkPermission(Item.WORKSPACE);
FilePath someWorkspace = project.getSomeWorkspace();
if (someWorkspace == null) {
return
FormValidation.warning(Messages.validation_noWorkspace());
}
String[] globs = getSelectionGlobs(value);
String msg;
for (String glob : globs) {
try {
msg = someWorkspace.validateAntFileMask(value,
FilePath.VALIDATE_ANT_FILE_MASK_BOUND);
}
catch (InterruptedException e) {
msg =
Messages.validation_globSearchLimitReached(FilePath.VALIDATE_ANT_FILE_MASK_BOUND);
}
if (msg != null) {
return FormValidation.warning(msg);
}
}
return FormValidation.ok();
}
This never rise any exception
Michael
--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M.
+39 347 913 2170
mic...@amarulasolutions.com
__________________________________
Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T.
+31 (0)85 111 9172
in...@amarulasolutions.com
www.amarulasolutions.com