Package com.socrata.model

Examples of com.socrata.model.Meta


        final Nomination  nomination = new Nomination(UUID.randomUUID().toString(), "Test Agent", "Department of Testing", "https://sandbox.demo.socrata.com", nominationDate, null, false, false);
        final Nomination  nominationUpdate = new Nomination(nomination.getName(), "Test Agent", "Department of Testing", "https://sandbox.demo.socrata.com", nominationDate, voteDate, true, false);

        final Soda2Producer producer= createProducer();

        final Meta objectMetadata = producer.addObject(UPDATE_DATA_SET, nomination);
        final Nomination createdNomination = producer.getById(UPDATE_DATA_SET, objectMetadata.getId(), Nomination.class);
        TestCase.assertTrue(EqualsBuilder.reflectionEquals(nomination, createdNomination));

        final Meta updateMeta= producer.update(UPDATE_DATA_SET, objectMetadata.getId(), nominationUpdate);
        TestCase.assertEquals(objectMetadata.getId(), updateMeta.getId());

        TestCase.assertEquals(objectMetadata.getCreatedAt(), updateMeta.getCreatedAt());
        TestCase.assertEquals(objectMetadata.getCreatedMeta(), updateMeta.getCreatedMeta());
        TestCase.assertFalse(objectMetadata.getCreatedAt().after(updateMeta.getUpdatedAt()));

        final Nomination updatedNomination = producer.getById(UPDATE_DATA_SET, objectMetadata.getId(), Nomination.class);

        //UNDONE(willpugh) -- Turn back on when bug 7102 is fixed.
        //TestCase.assertTrue(EqualsBuilder.reflectionEquals(nominationUpdate, updatedNomination));
View Full Code Here


        final DatasetInfo createdView = importer.createDataset(view);


        LocationTestClass   obj1 = new LocationTestClass(2, new Location(83.121212, 84.121212, null), "Name 1");
        Meta m = producer.addObject(createdView.getId(), obj1);
        TestCase.assertNotNull(m);

        List<LocationTestClass> retVal = consumer.query(createdView.getId(), SoqlQuery.SELECT_ALL, LocationTestClass.LIST_TYPE);
        TestCase.assertEquals(1, retVal.size());
View Full Code Here

                new Column(0, "location", "location", "A location", "Location", 0, 10, format, "Location"));



        LocationTestClass   obj1 = new LocationTestClass(2, new Location(83.121212, 84.121212, null), "Name 1");
        Meta m = producer.addObject(createdView.getId(), obj1);
        TestCase.assertNotNull(m);

        List<LocationTestClass> retVal = consumer.query(createdView.getId(), SoqlQuery.SELECT_ALL, LocationTestClass.LIST_TYPE);
        TestCase.assertEquals(1, retVal.size());
View Full Code Here

        //Get the producer class to allow updates of the data set.
        final Soda2Producer producer = Soda2Producer.newProducer("https://sandbox.demo.socrata.com", "testuser@gmail.com", "OpenData", "D8Atrg62F2j017ZTdkMpuZ9vY");

        //Get get this automatically serialized into a set of Java Beans annotated with Jackson JOSN annotations
        Meta nominationAddedMeta = producer.addObject("testupdate", NOMINATION_TO_ADD);

        //Update the nomination
        Meta nominationUpdatedMeta = producer.update("testupdate", nominationAddedMeta.getId(), NOMINATION_TO_UPDATE);

        //Delete the nomination
        producer.delete("testupdate", nominationUpdatedMeta.getId());
    }
View Full Code Here

TOP

Related Classes of com.socrata.model.Meta

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.