Search in sources :

Example 76 with WText

use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.

the class WTextRenderer_Test method testDoPaintWhenEmpty.

@Test
public void testDoPaintWhenEmpty() throws IOException, SAXException, XpathException {
    WText text = new WText();
    String xml = toXHtml(text);
    Assert.assertEquals("Text output should be empty by default", "", xml);
}
Also used : WText(com.github.bordertech.wcomponents.WText) Test(org.junit.Test)

Example 77 with WText

use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.

the class WTextRenderer_Test method testXssEscaping.

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
    WText text = new WText();
    text.setText(getInvalidCharSequence());
    assertSafeContent(text);
    text.setText(getMaliciousContent());
    assertSafeContent(text);
}
Also used : WText(com.github.bordertech.wcomponents.WText) Test(org.junit.Test)

Example 78 with WText

use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.

the class WTextRenderer_Test method testRendererCorrectlyConfigured.

@Test
public void testRendererCorrectlyConfigured() {
    WText text = new WText();
    Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(text) instanceof WTextRenderer);
}
Also used : WText(com.github.bordertech.wcomponents.WText) Test(org.junit.Test)

Example 79 with WText

use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.

the class WCollapsibleRenderer_Test method testXssEscaping.

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
    WCollapsible collapsible = new WCollapsible(new WText("dummy"), getMaliciousContent(), WCollapsible.CollapsibleMode.CLIENT);
    assertSafeContent(collapsible);
}
Also used : WCollapsible(com.github.bordertech.wcomponents.WCollapsible) WText(com.github.bordertech.wcomponents.WText) Test(org.junit.Test)

Example 80 with WText

use of com.github.bordertech.wcomponents.WText in project wcomponents by BorderTech.

the class WCollapsibleRenderer_Test method testRendererCorrectlyConfigured.

@Test
public void testRendererCorrectlyConfigured() {
    WCollapsible collapsible = new WCollapsible(new WText(), "");
    Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(collapsible) instanceof WCollapsibleRenderer);
}
Also used : WCollapsible(com.github.bordertech.wcomponents.WCollapsible) WText(com.github.bordertech.wcomponents.WText) Test(org.junit.Test)

Aggregations

WText (com.github.bordertech.wcomponents.WText)97 Test (org.junit.Test)63 WPanel (com.github.bordertech.wcomponents.WPanel)17 WCollapsible (com.github.bordertech.wcomponents.WCollapsible)10 WDecoratedLabel (com.github.bordertech.wcomponents.WDecoratedLabel)10 UIContext (com.github.bordertech.wcomponents.UIContext)9 WHeading (com.github.bordertech.wcomponents.WHeading)9 WTabSet (com.github.bordertech.wcomponents.WTabSet)7 DefaultWComponent (com.github.bordertech.wcomponents.DefaultWComponent)6 WList (com.github.bordertech.wcomponents.WList)6 WebXmlRenderContext (com.github.bordertech.wcomponents.servlet.WebXmlRenderContext)6 MockResponse (com.github.bordertech.wcomponents.util.mock.MockResponse)6 MockServletConfig (com.github.bordertech.wcomponents.util.mock.servlet.MockServletConfig)6 ActionEvent (com.github.bordertech.wcomponents.ActionEvent)5 WComponent (com.github.bordertech.wcomponents.WComponent)5 WFieldLayout (com.github.bordertech.wcomponents.WFieldLayout)5 WHorizontalRule (com.github.bordertech.wcomponents.WHorizontalRule)5 WImage (com.github.bordertech.wcomponents.WImage)5 ExplanatoryText (com.github.bordertech.wcomponents.examples.common.ExplanatoryText)5 MockHttpServletRequest (com.github.bordertech.wcomponents.util.mock.servlet.MockHttpServletRequest)5