Skip to content

Commit

Permalink
Merge pull request #19 from clara-kang/dev
Browse files Browse the repository at this point in the history
fixed [JENKINS-28722]
  • Loading branch information
ki82 committed Apr 19, 2016
2 parents a8f95f1 + c83b760 commit 457700b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -18,8 +18,7 @@
function Display(error)
{
reasonText = document.getElementById("errordesc");
var json = '${it.fillReason()}';
obj = JSON.parse(json);
obj = ${it.fillReason()};
if(error == "Default"){
reasonText.textContent = "";
} else{
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/hudson/plugins/claim/ClaimBFATest.java
Expand Up @@ -39,8 +39,10 @@ public class ClaimBFATest {

private static final String CAUSE_NAME_1 = "Cause1";
private static final String CAUSE_NAME_2 = "Cause2";
private static final String CAUSE_NAME_3 = "Cause3";
private static final String CAUSE_DESCRIPTION_1 = "DescriptionForCause1";
private static final String CAUSE_DESCRIPTION_2 = "DescriptionForCause2";
private static final String CAUSE_DESCRIPTION_WITH_SINGLE_QUOTE = "DescriptionWith'ForCause3";
private static final String IDENTIFIED_PROBLEMS = "Identified problems";
private static final String REASON = "Test Reason";

Expand Down Expand Up @@ -88,6 +90,14 @@ public void canReclaimFailureCause() throws Exception{
assertTrue(page.asXml().contains(CAUSE_NAME_1));
}

@Test
public void canClaimFailureWithSingleQuoteInDescription() throws Exception {
FailureCause cause3 = new FailureCause(CAUSE_NAME_3, CAUSE_DESCRIPTION_WITH_SINGLE_QUOTE);
PluginImpl.getInstance().getKnowledgeBase().addCause(cause3);
ClaimBuildAction action = applyClaimWithFailureCauseSelected("claim", CAUSE_NAME_3, REASON, CAUSE_DESCRIPTION_WITH_SINGLE_QUOTE);
assertThat(action.isClaimed(), is(true));
}

@Test
public void canDropFailureCause() throws Exception{
ClaimBuildAction action = applyClaimWithFailureCauseSelected("claim", CAUSE_NAME_2, REASON, CAUSE_DESCRIPTION_2);
Expand Down

1 comment on commit 457700b

@wolfs
Copy link
Member

@wolfs wolfs commented on 457700b Apr 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove the json2.js file from the project. It was only used to parse json and now we do not need to parse json any more.

Please sign in to comment.