Author: mwringe
Date: 2010-06-16 11:36:15 -0400 (Wed, 16 Jun 2010)
New Revision: 3349
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
Log:
GTNWSRP-46: fix issues with the PortletManagementTestCase, should now pass.
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java 2010-06-16
15:11:02 UTC (rev 3348)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java 2010-06-16
15:36:15 UTC (rev 3349)
@@ -175,7 +175,8 @@
response = producer.destroyPortlets(destroyPortlets);
ExtendedAssert.assertNotNull(response);
failures = response.getDestroyFailed();
- ExtendedAssert.assertNull(failures);
+
+ ExtendedAssert.assertTrue("Got back failures when none expected :" +
failures, (failures == null || failures.isEmpty()));
}
@Test
@@ -252,9 +253,12 @@
WSRP1TypeFactory.createProperty("prefName2", "en",
"prefValue2"));
checkGetPropertiesResponse(response, expected);
+ //This part of the tests doesn't make sense as names is a reference to the
list, not a clone
+ //Changed test to check for a empty list since calling names.clear
names.clear();
response = producer.getPortletProperties(getPortletProperties);
- checkGetPropertiesResponse(response, expected);
+ //checkGetPropertiesResponse(response, expected);
+ checkGetPropertiesResponse(response, new ArrayList<V1Property>());
names.add("prefName2");
response = producer.getPortletProperties(getPortletProperties);
@@ -323,6 +327,8 @@
V1PortletContext response = producer.setPortletProperties(setPortletProperties);
V1GetPortletProperties getPortletProperties =
WSRP1TypeFactory.createGetPortletProperties(null, response);
+ Collections.addAll(getPortletProperties.getNames(), "prefName1",
"prefName2");
+
checkGetPropertiesResponse(producer.getPortletProperties(getPortletProperties),
properties);
portletContext = WSRP1TypeFactory.createPortletContext(handle);
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-06-16
15:11:02 UTC (rev 3348)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v1/V1ProducerBaseTest.java 2010-06-16
15:36:15 UTC (rev 3349)
@@ -232,10 +232,12 @@
ExtendedAssert.fail(message + "Different classes or not both
null.");
}
-
assertEquals(message + "Extensions", expected.getExtensions(),
tested.getExtensions());
assertEquals(message + "Locales", expected.getLocales(),
tested.getLocales());
assertEquals(message + "Modes", expected.getModes(),
tested.getModes());
+
+ Collections.sort(expected.getWindowStates());
+ Collections.sort(tested.getWindowStates());
assertEquals(message + "Window states", expected.getWindowStates(),
tested.getWindowStates());
}
}