@Test public void testClone() { TransformationContext context = new TransformationContext(); context.setId("id"); context.setSyntax(Syntax.XWIKI_2_0); XDOM xdom = new XDOM(Arrays.<Block>asList(new WordBlock("test"))); context.setXDOM(xdom); TransformationContext newContext = context.clone(); assertNotSame(context, newContext); assertEquals("id", newContext.getId()); assertEquals(Syntax.XWIKI_2_0, newContext.getSyntax()); assertEquals(xdom, newContext.getXDOM()); }
@Override public TransformationContext clone() { TransformationContext newContext; try { newContext = (TransformationContext) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone object", e); } return newContext; }
TransformationContext implements Cloneable { @Override public TransformationContext clone() { TransformationContext newContext; try { newContext = (TransformationContext) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone object", e); } return newContext; } }
TransformationContext implements Cloneable { @Override public TransformationContext clone() { TransformationContext newContext; try { newContext = (TransformationContext) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone object", e); } return newContext; } TransformationContext();  TransformationContext(XDOM xdom, Syntax syntax);  TransformationContext(XDOM xdom, Syntax syntax, boolean restricted); }
TransformationContext implements Cloneable { @Override public TransformationContext clone() { TransformationContext newContext; try { newContext = (TransformationContext) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone object", e); } return newContext; } TransformationContext();  TransformationContext(XDOM xdom, Syntax syntax);  TransformationContext(XDOM xdom, Syntax syntax, boolean restricted); String getId(); void setId(String id); void setXDOM(XDOM xdom); XDOM getXDOM(); void setSyntax(Syntax syntax); Syntax getSyntax(); boolean isRestricted(); void setRestricted(boolean restricted); Syntax getTargetSyntax(); void setTargetSyntax(Syntax targetSyntax); @Override TransformationContext clone(); }
TransformationContext implements Cloneable { @Override public TransformationContext clone() { TransformationContext newContext; try { newContext = (TransformationContext) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException("Failed to clone object", e); } return newContext; } TransformationContext();  TransformationContext(XDOM xdom, Syntax syntax);  TransformationContext(XDOM xdom, Syntax syntax, boolean restricted); String getId(); void setId(String id); void setXDOM(XDOM xdom); XDOM getXDOM(); void setSyntax(Syntax syntax); Syntax getSyntax(); boolean isRestricted(); void setRestricted(boolean restricted); Syntax getTargetSyntax(); void setTargetSyntax(Syntax targetSyntax); @Override TransformationContext clone();  }