Author: chris.laprun(a)jboss.com
Date: 2010-06-16 07:22:01 -0400 (Wed, 16 Jun 2010)
New Revision: 3346
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/ServiceDescriptionTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/V2ProducerBaseTest.java
Log:
- Started adding v2 tests.
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/ServiceDescriptionTestCase.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/ServiceDescriptionTestCase.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/ServiceDescriptionTestCase.java 2010-06-16
11:22:01 UTC (rev 3346)
@@ -0,0 +1,57 @@
+/*
+ * 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.protocol.v2;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.spec.v2.WSRP2Constants;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.ServiceDescription;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class ServiceDescriptionTestCase extends V2ProducerBaseTest
+{
+ protected ServiceDescriptionTestCase() throws Exception
+ {
+ super(ServiceDescriptionTestCase.class.getSimpleName());
+ }
+
+ public void testSupportedOptions() throws OperationFailed, InvalidRegistration
+ {
+ ServiceDescription description =
producer.getServiceDescription(getNoRegistrationServiceDescriptionRequest());
+
+ ExtendedAssert.assertNotNull(description);
+ List<String> options = description.getSupportedOptions();
+ ExtendedAssert.assertTrue(ParameterValidation.existsAndIsNotEmpty(options));
+ ExtendedAssert.assertTrue(options.contains(WSRP2Constants.OPTIONS_EVENTS));
+ ExtendedAssert.assertTrue(options.contains(WSRP2Constants.OPTIONS_IMPORT));
+ ExtendedAssert.assertTrue(options.contains(WSRP2Constants.OPTIONS_EXPORT));
+ }
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/V2ProducerBaseTest.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/V2ProducerBaseTest.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/V2ProducerBaseTest.java 2010-06-16
11:22:01 UTC (rev 3346)
@@ -0,0 +1,52 @@
+/*
+ * 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.protocol.v2;
+
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.producer.ProducerHolder;
+import org.gatein.wsrp.producer.WSRPProducerBaseTest;
+import org.gatein.wsrp.producer.v2.WSRP2Producer;
+import org.oasis.wsrp.v2.GetServiceDescription;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class V2ProducerBaseTest extends WSRPProducerBaseTest
+{
+ protected WSRP2Producer producer = ProducerHolder.getV2Producer();
+
+ protected V2ProducerBaseTest(String name) throws Exception
+ {
+ super(name);
+ }
+
+ protected GetServiceDescription getNoRegistrationServiceDescriptionRequest()
+ {
+ GetServiceDescription gs = WSRPTypeFactory.createGetServiceDescription();
+ gs.getDesiredLocales().add("en-US");
+ gs.getDesiredLocales().add("en");
+ return gs;
+ }
+}