/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2010, Red Hat Middleware LLC, and individual contributors
 * as indicated by the @author tags. See the copyright.txt file 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.jboss.test.ws.jaxws.benchmark.test.datatypes.unwrapped;

import org.jboss.test.ws.jaxws.benchmark.BenchmarkTest;
import org.jboss.test.ws.jaxws.benchmark.test.datatypes.DataTypesRPCTest;
import org.jboss.test.ws.jaxws.benchmark.test.datatypes.EndpointRPC;

/**
 * @author pmacik@redhat.com
 * @since 09-Mar-2010
 */
public class StringRPCTest extends DataTypesRPCTest implements BenchmarkTest
{

   private static final String MESSAGE = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Order orderId=\"1\" orderDate=\"Wed Nov 15 13:45:28 EST 2006\"\n statusCode=\"9\" netAmount=\"59.97\" totalAmount=\"64.92\" tax=\"4.95\">\n  <Customer userName=\"user1\" firstName=\"Harry\" lastName=\"Fletcher\"\n        state=\"SD\" />\n   <OrderLines>\n      <OrderLine position=\"1\" quantity=\"1\">\n         <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"2\" quantity=\"1\">\n         <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"3\" quantity=\"1\">\n         <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"4\" quantity=\"1\">\n         <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"5\" quantity=\"1\">\n         <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"6\" quantity=\"1\">\n         <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"7\" quantity=\"1\">\n         <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"8\" quantity=\"1\">\n         <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"9\" quantity=\"1\">\n         <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"10\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"11\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"12\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"13\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"14\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"15\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"16\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"17\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"18\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"19\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"20\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"21\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"22\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"23\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"24\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"25\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"26\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"27\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"28\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"29\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"30\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"31\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"32\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"33\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <OrderLine position=\"34\" quantity=\"1\">\n            <Product productId=\"299\" title=\"Pulp Fiction\" price=\"29.99\" />\n      </OrderLine>\n      <OrderLine position=\"35\" quantity=\"1\">\n            <Product productId=\"364\" title=\"The 40-Year-Old Virgin \"\n              price=\"29.98\" />\n        </OrderLine>\n      <Memo>\n            abcdefghijklmnopqrstuvwxyz0123456789!@#$%^°*()_+-=[]{}:\",.?/`~Pada,pada_jahoda,kterou_sěščřžýáíégggaabcdefghijklmnopqrstuvwxyz0123456789!@#$%^°*()_+-=[]{}:\",.?/`~Pahoda,kterou_sni_pan_Lahodaabcdefghijklmnopqrstuvwxyz0123456789!@#$%^°*()_+-=[]{}:\",.?/`~Pada,pada_jahoda,kterou_sni_pan_Lahoda\n     </Memo>\n   </OrderLines>\n</Order>\n";

   public void performIteration(Object port) throws Exception
   {
      String ret = ((EndpointRPC) port).sayHello(MESSAGE);
      String exp = "Hello World Greeting for '" + MESSAGE + "' today";
      if (!exp.equals(ret))
      {
         throw new Exception("Unexpected result: " + ret);
      }
   }
}
