Package com.directededge

Examples of com.directededge.Item.save()


        options.put("tagOperation", "AND");
        assertFalse(product.getRelated(tags, options).size() > 0);

        Item taggedAsBoth = new Item(database, "product35");
        taggedAsBoth.addTag("customer");
        taggedAsBoth.save();

        assertTrue(product.getRelated(tags, options).size() > 0);
    }

    @Test
View Full Code Here


    @Test
    public void characters()
    {
        Item item = new Item(database, ";@%&!");
        item.setProperty("foo", "bar");
        item.save();

        item = new Item(database, ";@%&!");
        assertEquals("bar", item.getProperty("foo"));

        item = new Item(database, "foo/bar");
View Full Code Here

        item = new Item(database, ";@%&!");
        assertEquals("bar", item.getProperty("foo"));

        item = new Item(database, "foo/bar");
        item.setProperty("foo", "bar");
        item.save();

        item = new Item(database, "foo/bar");
        assertEquals("bar", item.getProperty("foo"));
    }
View Full Code Here

    public void create()
    {
        Item item = new Item(database, "test");
        item.linkTo("customer0");
        item.linkTo("customer1");
        item.save();

        item = new Item(database, "test");
        assertTrue(item.getLinks("").containsKey("customer0"));
        assertTrue(item.getLinks("").containsKey("customer1"));
    }
View Full Code Here

    @Test
    public void unweightedLinks()
    {
        Item customer0 = new Item(database, "customer0");
        customer0.linkTo("customer1");
        customer0.save();

        customer0 = new Item(database, "customer0");
        assertTrue(customer0.getLinks("").containsKey("customer1"));

        customer0.unlinkFrom("customer1");
View Full Code Here

        customer0 = new Item(database, "customer0");
        assertTrue(customer0.getLinks("").containsKey("customer1"));

        customer0.unlinkFrom("customer1");
        customer0.save();
        customer0 = new Item(database, "customer0");
        assertFalse(customer0.getLinks("").containsKey("customer1"));
    }

    @Test
View Full Code Here

    @Test
    public void weightedLinks()
    {
        Item customer0 = new Item(database, "customer0");
        customer0.linkTo("product7", 5);
        customer0.save();

        customer0 = new Item(database, "customer0");
        assertTrue(customer0.getLinks("").containsKey("product7"));
        assertEquals((int) customer0.getLinks("").get("product7"), 5);
        assertEquals(customer0.weightFor("product7"), 5);
View Full Code Here

        assertTrue(customer0.getLinks("").containsKey("product7"));
        assertEquals((int) customer0.getLinks("").get("product7"), 5);
        assertEquals(customer0.weightFor("product7"), 5);

        customer0.unlinkFrom("product7");
        customer0.save();
        customer0 = new Item(database, "customer0");
        assertFalse(customer0.getLinks("").containsKey("product7"));
    }

    @Test(expected = IllegalArgumentException.class)
View Full Code Here

    {
        Item customer = new Item(database, "customer0");
        assertTrue(customer.getTags().contains("customer"));
        customer.addTag("test");
        assertTrue(customer.getTags().contains("test"));
        customer.save();
        customer = new Item(database, "customer0");
        assertTrue(customer.getTags().contains("test"));
        customer.removeTag("test");
        assertFalse(customer.getTags().contains("test"));
        customer.save();
View Full Code Here

        customer.save();
        customer = new Item(database, "customer0");
        assertTrue(customer.getTags().contains("test"));
        customer.removeTag("test");
        assertFalse(customer.getTags().contains("test"));
        customer.save();
        customer = new Item(database, "customer0");
        assertFalse(customer.getTags().contains("test"));
    }

    @Test
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.