Examples of newEntry()


Examples of net.yacy.kelondro.index.Row.newEntry()

    private static Table testTable(final File f, final String testentities, final boolean useTailCache, final boolean exceed134217727) throws IOException, RowSpaceExceededException {
        if (f.exists()) FileUtils.deletedelete(f);
        final Row rowdef = new Row("byte[] a-4, byte[] b-4", NaturalOrder.naturalOrder);
        final Table tt = new Table(f, rowdef, 100, 0, useTailCache, exceed134217727);
        byte[] b;
        final Row.Entry row = rowdef.newEntry();
        for (int i = 0; i < testentities.length(); i++) {
            b = testWord(testentities.charAt(i));
            row.setCol(0, b);
            row.setCol(1, b);
            tt.put(row);
View Full Code Here

Examples of net.yacy.kelondro.index.Row.newEntry()

                final long randomstart = Long.parseLong(args[5]);
                final Random random = new Random(randomstart);
                byte[] key;
                for (int i = 0; i < count; i++) {
                    key = randomHash(random);
                    table_test.put(testRow.newEntry(new byte[][]{key, key, dummyvalue2}));
                    if (table_reference != null) table_reference.put(testRow.newEntry(new byte[][]{key, key, dummyvalue2}));
                    if (i % 1000 == 0) {
                        System.out.println(i + " entries. ");
                    }
                }
View Full Code Here

Examples of net.yacy.kelondro.index.Row.newEntry()

                final Random random = new Random(randomstart);
                byte[] key;
                for (int i = 0; i < count; i++) {
                    key = randomHash(random);
                    table_test.put(testRow.newEntry(new byte[][]{key, key, dummyvalue2}));
                    if (table_reference != null) table_reference.put(testRow.newEntry(new byte[][]{key, key, dummyvalue2}));
                    if (i % 1000 == 0) {
                        System.out.println(i + " entries. ");
                    }
                }
            }
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

    assertEquals(entry.getContentType(), Content.Type.HTML);
  }
 
  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")));
  }
 
  public void testLang() throws Exception {
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

    assertNull(entry.getControl().getSimpleExtension(new QName("urn:foo", "foo")));
  }
 
  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.getPrimary(),"en");
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

    }

    public static Entry newEntry(String value) {
        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setTitle("customer " + value);

        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(value);
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

    @Test
    public void testCreateAndUpdateAndDeletePackageFromAtom() throws Exception {
      //Test create
      Abdera abdera = new Abdera();
      AbderaClient client = new AbderaClient(abdera);
      Entry entry = abdera.newEntry();   
      entry.setTitle("testCreatePackageFromAtom");
      entry.setSummary("desc for testCreatePackageFromAtom");
     
      ClientResponse resp = client.post(generateBaseUrl() + "/packages", entry);
        //System.out.println(GetContent(resp.getInputStream()));
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

    assertEquals("/packages/testCreatePackageFromAtom", returnedEntry.getBaseUri().getPath());
    assertEquals("testCreatePackageFromAtom", returnedEntry.getTitle());
    assertEquals("desc for testCreatePackageFromAtom", returnedEntry.getSummary());
   
    //Test update package
        Entry e = abdera.newEntry();
        e.setTitle("testUpdatePackageFromAtom");
        org.apache.abdera.model.Link l = abdera.getNewFactory().newLink();
        l.setHref(generateBaseUrl() + "/packages/" + "testCreatePackageFromAtom");
        l.setRel("self");
        e.addLink(l);
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

        assertEquals (500, conn2.getResponseCode());
    }

    private Entry toPackageEntry (Package p) throws Exception {
        Abdera a = new Abdera();
        Entry e = a.newEntry();
        e.setTitle(p.getTitle());
        e.setUpdated(p.getMetadata().getLastModified());
        e.setPublished(p.getMetadata().getCreated());
        e.addLink("self", generateBaseUrl() + "/packages/" + p.getTitle());
        e.setSummary(p.getDescription());
View Full Code Here

Examples of org.apache.abdera.Abdera.newEntry()

     * Passes if the test does not throw a parse exception
     */
  @Test
    public void testCompressionCodec() throws Exception {
      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      OutputStream cout = CompressionUtil.getEncodedOutputStream(out, CompressionCodec.GZIP);
      entry.writeTo(cout);
      cout.close();
      byte[] bytes = out.toByteArray();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.