Package org.apache.abdera

Examples of org.apache.abdera.Abdera


    /**
     * Constructor the user will be using inside javaScript
     */
    public void jsConstructor() {
        abdera = new Abdera();
        Factory factory = abdera.getFactory();
        entry = factory.newEntry();
    }
View Full Code Here


    private AbderaClient client;

    public APPClientHostObject() {
        super();
        abdera = new Abdera();
        client = new AbderaClient(abdera);
        options = client.getDefaultRequestOptions();
    }
View Full Code Here

  private final Abdera abdera;
  private final Encryption encryption;
  private final Signature signature;
 
  public AbderaSecurity() {
    this(new Abdera());
  }
View Full Code Here

    this.encryption = newEncryption();
    this.signature = newSignature();
  }
 
  public AbderaSecurity(Configuration config) {
    this(new Abdera(config));
  }
View Full Code Here

      OMAbstractFactory.META_FACTORY_NAME_PROPERTY,
      FOMMetaFactory.class.getName());
  }
 
  public FOMFactory() {
    this(new Abdera());
  }
View Full Code Here

 
  @Test
  public void testContentClone() throws Exception {
    String s = "<entry xmlns='http://www.w3.org/2005/Atom'><content type='html'>test</content></entry>";
    ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes());
    Abdera abdera = new Abdera();
    Parser parser = abdera.getParser();
    Document<Entry> doc = parser.parse(in);
    Entry entry = (Entry)(doc.getRoot().clone());
    assertEquals(entry.getContentType(), Content.Type.HTML);
  }
View Full Code Here

    assertEquals(entry.getContentType(), Content.Type.HTML);
  }
 
  @Test
  public void testSimpleExtension() throws Exception {
    Abdera abdera = new Abdera();
    Entry entry = abdera.newEntry();   
    entry.setDraft(true)// this will create an app:control element
    assertNull(entry.getControl().getSimpleExtension(new QName("urn:foo", "foo")));
  }
View Full Code Here

    assertNull(entry.getControl().getSimpleExtension(new QName("urn:foo", "foo")));
  }
 
  @Test
  public void testLang() throws Exception {
    Abdera abdera = new Abdera();
    Entry entry = abdera.newEntry();
    entry.setLanguage("en-US");
    assertEquals(entry.getLanguage(),"en-US");
    Lang lang = entry.getLanguageTag();
    assertNotNull(lang);
    assertEquals(lang.getLanguage().getName(),"en");
View Full Code Here

  }
 
  @Test
  public void testSetContent() throws Exception {
   
    Abdera abdera = new Abdera();
   
    Entry entry = abdera.newEntry();
    Document<Element> foodoc = abdera.getParser().parse(
      new ByteArrayInputStream("<a><b><c/></b></a>".getBytes()));
    Element foo = foodoc.getRoot();
    entry.setContent(foo, "application/foo+xml");
    assertEquals(entry.getContentElement().getValueElement(),foo);
   
View Full Code Here

  }
 
  @Test
  public void testSetContent2() throws Exception {
   
    Abdera abdera = new Abdera();
    Entry entry = abdera.newEntry();
    InputStream in =
      new ByteArrayInputStream(
        "tóst".getBytes("utf-16"));
   
    Document<Entry> edoc = entry.getDocument();
    entry.setContent(in,"text/plain;charset=\"utf-16\"");
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    OutputStreamWriter w = new OutputStreamWriter(out, "utf-16");
    edoc.writeTo(w);
   
    in = new ByteArrayInputStream(out.toByteArray());
   
    entry = (Entry) abdera.getParser().parse(in).getRoot();

    assertEquals("tóst", entry.getContent());
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.Abdera

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.