Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1002774 - minor refactor and fix HTextFlowHistoryJPATest
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Sep 1, 2013
1 parent b4fcda0 commit 35b8765
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -1317,9 +1317,9 @@ public String decodeDocId(String id)
* @param apiVersion
* @todo merge with {@link #transferToTextFlowTargetExtensions}
*/
public void transferToTextFlowTarget(HTextFlowTarget from, TextFlowTarget to, boolean isPlural, Optional<String> apiVersion)
public void transferToTextFlowTarget(HTextFlowTarget from, TextFlowTarget to, Optional<String> apiVersion)
{
if (isPlural)
if (from.getTextFlow().isPlural())
{
to.setContents(from.getContents());
}
Expand Down Expand Up @@ -1399,7 +1399,7 @@ public boolean transferToTranslationsResource(TranslationsResource transRes, HDo
found = true;
TextFlowTarget target = new TextFlowTarget();
target.setResId(hTarget.getTextFlow().getResId());
this.transferToTextFlowTarget(hTarget, target, hTarget.getTextFlow().isPlural(), apiVersion);
this.transferToTextFlowTarget(hTarget, target, apiVersion);
this.transferToTextFlowTargetExtensions(hTarget, target.getExtensions(true), enabledExtensions);
transRes.getTextFlowTargets().add(target);
}
Expand Down
Expand Up @@ -84,6 +84,7 @@ public void ensureHistoryIsRecordedPlural()
session.flush();

HTextFlow tf = new HTextFlow(d, "mytf", "hello world");
tf.setPlural(false);
d.getTextFlows().add(tf);

session.flush();
Expand All @@ -93,6 +94,7 @@ public void ensureHistoryIsRecordedPlural()
assertThat("Incorrect History size on persist", historyElems.size(), is(0));

d.incrementRevision();
tf.setPlural(true);
tf.setContents("hello world 1", "hello world 2");
tf.setRevision(d.getRevision());
session.flush();
Expand Down

0 comments on commit 35b8765

Please sign in to comment.