package com.exedio.copernica;

import net.sourceforge.jwebunit.WebTestCase;

public class WebTest extends WebTestCase
{

	public WebTest(String name)
	{
		super(name);
	}

	public void setUp() throws Exception
	{
		super.setUp();
		getTestContext().setBaseUrl("http://localhost:8080/copernicatest/");
	}

	public void testSearch()
	{
		beginAt("copernica.jsp");
		assertTitleEquals("Copernica");
		assertLinkPresentWithText("de");

		clickLinkWithText("Attribute Item");
		assertTitleEquals("Attribute Item");
		assertTextPresent("Attribute Item");
		
		assertLinkPresentWithText("50");
		clickLinkWithText("50");
		assertTitleEquals("Attribute Item");
		assertLinkNotPresentWithText("50");

		clickLinkWithText("[X]");
		assertTitleEquals("AttributeItem.103");
		assertFormElementEquals("someNotNullString", "running100");

		setFormElement("someNotNullString", "running100changed");
		submit("SAVE");
		assertTitleEquals("AttributeItem.103");
		assertFormElementEquals("someNotNullString", "running100changed");

		setFormElement("someNotNullString", "running100");
		submit("SAVE");
		assertTitleEquals("AttributeItem.103");
		assertFormElementEquals("someNotNullString", "running100");
	}
}

@@ -812,24 +812,80 @@
 unning100%22);
+%0A%09%09assertFormElementEquals(%22someNotNullInteger%22, %22107%22);
 %0A%0A%09%09setFormE
@@ -1062,16 +1062,307 @@
 anged%22);
+%0A%09%09assertFormElementEquals(%22someNotNullInteger%22, %22107%22);%0A%0A%09%09setFormElement(%22someNotNullInteger%22, %221077%22);%0A%09%09submit(%22SAVE%22);%0A%09%09assertTitleEquals(%22AttributeItem.103%22);%0A%09%09assertFormElementEquals(%22someNotNullString%22, %22running100changed%22);%0A%09%09assertFormElementEquals(%22someNotNullInteger%22, %221077%22);
 %0A%0A%09%09setF
@@ -1404,24 +1404,71 @@
 nning100%22);%0A
+%09%09setFormElement(%22someNotNullInteger%22, %22107%22);%0A
 %09%09submit(%22SA
@@ -1507,32 +1507,32 @@
 buteItem.103%22);%0A
-
 %09%09assertFormElem
@@ -1577,13 +1577,69 @@
 g100%22);%0A
+%09%09assertFormElementEquals(%22someNotNullInteger%22, %22107%22);%0A
 %09%7D%0A%7D%0A

test setting integer