Package org.apache.abdera.protocol.client

Examples of org.apache.abdera.protocol.client.AbderaClient


    public void testCustomerProvider(String basePath) throws Exception
    {
        Abdera abdera = new Abdera();
        Factory factory = abdera.getFactory();

        AbderaClient client = new AbderaClient(abdera);
        String base = "http://localhost:9002" + basePath + "/";

        // Testing of entry creation
        IRI colUri = new IRI(base).resolve("customers");
        Entry entry = factory.newEntry();
        entry.setTitle("Hmmm this is ignored right now");
        entry.setUpdated(new Date());
        entry.addAuthor("Acme Industries");
        entry.setId(factory.newUuidUri());
        entry.setSummary("Customer document");

        Element customerEl = factory.newElement(new QName("customer"));
        customerEl.setAttributeValue(new QName("name"), "Dan Diephouse");
        entry.setContent(customerEl);

        RequestOptions opts = new RequestOptions();
        opts.setContentType("application/atom+xml;type=entry");
        ClientResponse res = client.post(colUri.toString(), entry, opts);
        assertEquals(201, res.getStatus());

        IRI location = res.getLocation();
        assertEquals(basePath + "/customers/1001-Dan_Diephouse", location.toString());

        // GET the entry
        res = client.get(colUri.resolve(location.toString()).toString());
        assertEquals(200, res.getStatus());

        org.apache.abdera.model.Document<Entry> entry_doc = res.getDocument();
        entry = entry_doc.getRoot();
    }
View Full Code Here


    {
        repository = (Repository) muleContext.getRegistry().lookupObject("jcrRepository");

        Thread.sleep(5000);

        AbderaClient client = new AbderaClient();
        ClientResponse res = client.get("http://localhost:" + getPorts().get(0) + "/events");

        Document<Feed> doc = res.getDocument();
        // see if this helps with intermittent failures
        doc.complete();
        Feed feed = doc.getRoot();
View Full Code Here

        MuleClient client = new MuleClient(muleContext);
        client.send("vm://in", createOutboundMessage());

        Thread.sleep(1000);

        AbderaClient aClient = new AbderaClient();
        ClientResponse res = aClient.get("http://localhost:9003/events");

        Document<Feed> doc = res.getDocument();
        Feed feed = doc.getRoot();

        assertEquals(1, feed.getEntries().size());
View Full Code Here

  public static void init() throws Exception {
    scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
        scaConsumerDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Consumer.composite");
        testService = scaConsumerDomain.getService(CustomerClient.class, "CustomerClient");
    abdera = new Abdera();
    client = new AbderaClient(abdera);
    abderaParser = Abdera.getNewParser();
  }
View Full Code Here

  @BeforeClass
  public static void init() throws Exception {
    System.out.println(">>>ContentNegotiationTest.init");
    scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
    abdera = new Abdera();
    client = new AbderaClient(abdera);
    abderaParser = Abdera.getNewParser();
  }
View Full Code Here

  @BeforeClass
  public static void init() throws Exception {
    System.out.println(">>>ProviderFeedEntityTagsTestCase.init");
    scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
    abdera = new Abdera();
    client = new AbderaClient(abdera);
    abderaParser = Abdera.getNewParser();
  }
View Full Code Here

  @BeforeClass
  public static void init() throws Exception {
    System.out.println(">>>ProviderEntryEntityTagsTestCase.init");
    scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/Provider.composite");
    abdera = new Abdera();
    client = new AbderaClient(abdera);
    abderaParser = Abdera.getNewParser();
  }
View Full Code Here

  @BeforeClass
  public static void init() throws Exception {
    System.out.println(">>>MediaCollectionTestCase.init");
    scaProviderDomain = SCADomain.newInstance("org/apache/tuscany/sca/binding/atom/ReceiptProvider.composite");
    abdera = new Abdera();
    client = new AbderaClient(abdera);
    abderaParser = Abdera.getNewParser();
  }
View Full Code Here

        initTestEnvironment(AtomPostTestCase.class);

        testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");

        abdera = new Abdera();
        client = new AbderaClient(abdera);
        abderaParser = Abdera.getNewParser();
    }
View Full Code Here

        scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Provider.composite", new Contribution("provider", contribution));
        scaProviderNode.start();

        abdera = new Abdera();
        client = new AbderaClient(abdera);
        abderaParser = Abdera.getNewParser();
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.client.AbderaClient

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.