Author: chris.laprun(a)jboss.com
Date: 2010-10-01 08:31:42 -0400 (Fri, 01 Oct 2010)
New Revision: 4457
Modified:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/InMemoryConsumerRegistry.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java
Log:
- GTNWSRP-83: Minor test improvements.
Modified:
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
===================================================================
---
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-10-01
09:50:50 UTC (rev 4456)
+++
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-10-01
12:31:42 UTC (rev 4457)
@@ -30,15 +30,15 @@
import org.gatein.wsrp.admin.ui.ConsumerBean;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.consumer.registry.InMemoryConsumerRegistry;
+import org.gatein.wsrp.services.SOAPServiceFactory;
import org.gatein.wsrp.test.protocol.v2.BehaviorBackedServiceFactory;
import org.gatein.wsrp.test.support.MockEndpointConfigurationInfo;
+import javax.faces.model.DataModel;
import java.util.Locale;
import java.util.Map;
/**
- * TODO: re-activate tests once test-support module is updated.
- *
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision: 12612 $
* @since 2.6
@@ -66,7 +66,10 @@
public void testInitialState()
{
assertEquals(CONSUMER_ID, bean.getId());
+ assertEquals(bean.getProducerInfo().getId(), bean.getId());
+
assertEquals(WSDL, bean.getWsdl());
+ assertEquals(SOAPServiceFactory.DEFAULT_TIMEOUT_MS, bean.getTimeout().intValue());
assertFalse(bean.isModified());
assertTrue(bean.isRefreshNeeded());
@@ -79,6 +82,12 @@
assertFalse(bean.isRegistrationLocallyModified());
assertFalse(bean.isRegistrationPropertiesExisting());
+ assertNull(bean.getCurrentExport());
+
+ DataModel existingExports = bean.getExistingExports();
+ assertNotNull(existingExports);
+ assertEquals(0, existingExports.getRowCount());
+
try
{
assertFalse(bean.isRegistrationRequired());
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/InMemoryConsumerRegistry.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/InMemoryConsumerRegistry.java 2010-10-01
09:50:50 UTC (rev 4456)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/registry/InMemoryConsumerRegistry.java 2010-10-01
12:31:42 UTC (rev 4457)
@@ -1,28 +1,30 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.gatein.wsrp.consumer.registry;
import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.migration.InMemoryMigrationService;
import java.util.Iterator;
import java.util.UUID;
@@ -33,6 +35,11 @@
*/
public class InMemoryConsumerRegistry extends AbstractConsumerRegistry
{
+ public InMemoryConsumerRegistry()
+ {
+ setMigrationService(new InMemoryMigrationService());
+ }
+
@Override
protected void save(ProducerInfo info, String messageOnError)
{
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java 2010-10-01
09:50:50 UTC (rev 4456)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v2/BehaviorBackedServiceFactory.java 2010-10-01
12:31:42 UTC (rev 4457)
@@ -67,7 +67,7 @@
private boolean initialized = false;
private String wsdl = DEFAULT_WSDL_URL;
public static final String DEFAULT_WSDL_URL =
"http://example.com/producer?wsdl";
- private int timeout;
+ private int timeout = DEFAULT_TIMEOUT_MS;
public BehaviorBackedServiceFactory()