📄 treemarshallertest.java
字号:
package com.thoughtworks.xstream.core;import com.thoughtworks.acceptance.AbstractAcceptanceTest;import com.thoughtworks.xstream.XStream;public class TreeMarshallerTest extends AbstractAcceptanceTest { class Thing { Thing thing; } protected void setUp() throws Exception { super.setUp(); xstream.setMode(XStream.NO_REFERENCES); } public void testThrowsExceptionWhenDetectingCircularReferences() { Thing a = new Thing(); Thing b = new Thing(); a.thing = b; b.thing = a; try { xstream.toXML(a); fail("expected exception"); } catch (TreeMarshaller.CircularReferenceException expected) { // good } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -