Package com.redhat.topicindex.rest.sharedinterface

Examples of com.redhat.topicindex.rest.sharedinterface.RESTInterfaceV1


        System.out.println("Done");
    }

    private static void testREST()
    {
        RESTInterfaceV1 client = null;

        try
        {
            client = ProxyFactory.create(
                            RESTInterfaceV1.class,
                            "http://localhost:8080/TopicIndex/seam/resource/rest");

      TopicV1 newTopic = new TopicV1();
      newTopic.setTitleExplicit("New Topic");
      newTopic.setXmlExplicit("");

      // Creating a new topic will work as it initialises all the collections for the REST Entity (via createRESTEntityFromDBEntity()) before committing the transaction.
      TopicV1 returnedTopic = client.createJSONTopic("", newTopic);
      if (returnedTopic == null) throw new Exception("Unable to create a new topic");

      returnedTopic.setTitleExplicit("Updated Topic");

      // Updating the topic will fail as it attempts to create the REST entity from un-initialised collections after the transaction has been committed.
      TopicV1 updatedTopic = client.updateJSONTopic("", returnedTopic);
      if (updatedTopic == null) throw new Exception("Unable to update an existing topic");
        }
        catch (final Exception ex)
        {
            System.out.println(ex.toString());
View Full Code Here

TOP

Related Classes of com.redhat.topicindex.rest.sharedinterface.RESTInterfaceV1

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.