You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/02/10 22:39:21 UTC

[1/2] incubator-usergrid git commit: Added two tests and an commented out test that would check the import endpoint end to end. Migrated lots of the service side test structure to the resource test. Cleanup still needed but the tests there should work to

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-import c3839c83b -> 65e6feeb1


Added two tests and an commented out test that would check the import endpoint end to end. Migrated lots of the service side test structure to the resource test. Cleanup still needed but the tests there should work to see if import is working on a basic level. Added three resource files that contain exported json and an incorrectly formatted file for upload to s3 by the new s3Upload file.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7621be90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7621be90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7621be90

Branch: refs/heads/two-dot-o-import
Commit: 7621be9015f962f2f7ec1c8f3cac1027c756eb68
Parents: 6df5d00
Author: grey <gr...@apigee.com>
Authored: Tue Feb 10 13:38:46 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Feb 10 13:38:46 2015 -0800

----------------------------------------------------------------------
 .../rest/management/ImportResourceIT.java       | 402 +++++++++++++++++++
 .../resources/testImport.testApplication.2.json |  56 +++
 .../resources/testImport.testCollection.1.json  |  13 +
 ...testImportInvalidJson.testApplication.3.json | 139 +++++++
 .../management/importer/ImportCollectionIT.java |  70 +++-
 .../usergrid/management/importer/S3Upload.java  |  97 +++++
 .../resources/testImport.testApplication.2.json |  56 +++
 .../resources/testImport.testCollection.1.json  |  13 +
 ...testImportInvalidJson.testApplication.3.json | 139 +++++++
 9 files changed, 981 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
index 922d4fd..ad2fd0a 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
@@ -18,9 +18,25 @@
 package org.apache.usergrid.rest.management;
 
 import com.amazonaws.SDKGlobalConfiguration;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.util.concurrent.Service;
+import com.google.inject.Module;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 
+import org.apache.usergrid.ServiceITSetup;
+import org.apache.usergrid.ServiceITSetupImpl;
+import org.apache.usergrid.batch.service.JobSchedulerService;
+import org.apache.usergrid.cassandra.CassandraResource;
+import org.apache.usergrid.management.importer.ImportService;
+import org.apache.usergrid.management.importer.S3Upload;
+import org.apache.usergrid.persistence.ConnectionRef;
+import org.apache.usergrid.persistence.EntityManager;
+import org.apache.usergrid.persistence.EntityRef;
+import org.apache.usergrid.persistence.Results;
+import org.apache.usergrid.persistence.SimpleEntityRef;
+import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
+import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.model.Collection;
@@ -29,26 +45,111 @@ import com.fasterxml.jackson.databind.JsonNode;
 import org.apache.usergrid.rest.test.resource2point0.model.Organization;
 import org.apache.usergrid.rest.test.resource2point0.model.Token;
 
+import org.jclouds.ContextBuilder;
+import org.jclouds.blobstore.BlobStore;
+import org.jclouds.blobstore.BlobStoreContext;
+import org.jclouds.blobstore.ContainerNotFoundException;
+import org.jclouds.blobstore.domain.PageSet;
+import org.jclouds.blobstore.domain.StorageMetadata;
+import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
+import org.jclouds.logging.log4j.config.Log4JLoggingModule;
+import org.jclouds.netty.config.NettyPayloadModule;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.MediaType;
+
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.UUID;
 
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 
 public class ImportResourceIT extends AbstractRestIT {
 
+    private static final Logger logger = LoggerFactory.getLogger( ImportResourceIT.class );
+
+
+    private static String bucketPrefix;
+
+    private String bucketName;
+
+    boolean configured;
+
+
     public ImportResourceIT() throws Exception {
 
     }
 
+    private static CassandraResource cassandraResource = CassandraResource.newWithAvailablePorts();
+
+
+    @ClassRule
+    public static final ServiceITSetup setup =
+        new ServiceITSetupImpl( cassandraResource, new ElasticSearchResource() );
+
+    @BeforeClass
+    public static void setup() throws Exception {
+
+        bucketPrefix = System.getProperty( "bucketName" );
+
+        // start the scheduler after we're all set up
+        JobSchedulerService jobScheduler = cassandraResource.getBean( JobSchedulerService.class );
+        if ( jobScheduler.state() != Service.State.RUNNING ) {
+            jobScheduler.startAndWait();
+        }
+
+    }
+
+    @Before
+    public void before() {
+
+        configured =
+            !StringUtils.isEmpty( System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ) )
+                && !StringUtils.isEmpty(System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR))
+                && !StringUtils.isEmpty(System.getProperty("bucketName"));
+
+
+        if ( !configured ) {
+            logger.warn("Skipping test because {}, {} and bucketName not " +
+                    "specified as system properties, e.g. in your Maven settings.xml file.",
+                new Object[] {
+                    SDKGlobalConfiguration.SECRET_KEY_ENV_VAR,
+                    SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR
+                });
+        }
+
+        if ( !StringUtils.isEmpty( bucketPrefix )) {
+            deleteBucketsWithPrefix();
+        }
+
+        bucketName = bucketPrefix + RandomStringUtils.randomAlphanumeric( 10 ).toLowerCase();
+
+
+
+    }
+
+
+
     /**
      * Verify that we can get call the import endpoint and get the job state back.
      * @throws Exception
@@ -243,6 +344,307 @@ public class ImportResourceIT extends AbstractRestIT {
             assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
         }
 
+//    @Test
+//    public void testExportImportCollection() throws Exception {
+//        Assume.assumeTrue( configured );
+//        // create a collection of "thing" entities in the first application, export to S3
+//        try {
+//
+//            Map<UUID, org.apache.usergrid.persistence.Entity> thingsMap = new HashMap<>();
+//            List<org.apache.usergrid.persistence.Entity> things = new ArrayList<>();
+//            createTestEntities(emApp1, thingsMap, things, "thing");
+//
+//            deleteBucket();
+//            exportCollection( emApp1, "things" );
+//
+//            // create new second application, import the data from S3
+//
+//            final UUID appId2 = setup.getMgmtSvc().createApplication(
+//                organization.getUuid(), "second").getId();
+//
+//            final EntityManager emApp2 = setup.getEmf().getEntityManager(appId2);
+//            importCollection( emApp2, "things" );
+//
+//
+//            // make sure that it worked
+//
+//            logger.debug("\n\nCheck connections\n");
+//
+//            List<org.apache.usergrid.persistence.Entity> importedThings = emApp2.getCollection(
+//                appId2, "things", null, Query.Level.ALL_PROPERTIES).getEntities();
+//            assertTrue( !importedThings.isEmpty() );
+//
+//            // two things have connections
+//
+//            int conCount = 0;
+//            for ( org.apache.usergrid.persistence.Entity e : importedThings ) {
+//                Results r = emApp2.getConnectedEntities( e, "related", null, Query.Level.IDS);
+//                List<ConnectionRef> connections = r.getConnections();
+//                conCount += connections.size();
+//            }
+//            assertEquals( 2, conCount );
+//
+//            logger.debug("\n\nCheck dictionaries\n");
+//
+//            // first two items have things in dictionary
+//
+//            EntityRef entity0 = importedThings.get(0);
+//            Map connected0 = emApp2.getDictionaryAsMap(entity0, "connected_types");
+//            Map connecting0 = emApp2.getDictionaryAsMap(entity0, "connected_types");
+//            Assert.assertEquals( 1, connected0.size() );
+//            Assert.assertEquals( 1, connecting0.size() );
+//
+//            EntityRef entity1 = importedThings.get(1);
+//            Map connected1 = emApp2.getDictionaryAsMap(entity1, "connected_types");
+//            Map connecting1 = emApp2.getDictionaryAsMap(entity1, "connected_types");
+//            Assert.assertEquals( 1, connected1.size() );
+//            Assert.assertEquals( 1, connecting1.size() );
+//
+//            // the rest rest do not have connections
+//
+//            EntityRef entity2 = importedThings.get(2);
+//            Map connected2 = emApp2.getDictionaryAsMap(entity2, "connected_types");
+//            Map connecting2 = emApp2.getDictionaryAsMap(entity2, "connected_types");
+//            Assert.assertEquals( 0, connected2.size() );
+//            Assert.assertEquals( 0, connecting2.size() );
+//
+//            // if entities are deleted from app1, they still exist in app2
+//
+//            logger.debug("\n\nCheck dictionary\n");
+//            for ( org.apache.usergrid.persistence.Entity importedThing : importedThings ) {
+//                emApp1.delete( importedThing );
+//            }
+//            emApp1.refreshIndex();
+//            emApp2.refreshIndex();
+//
+//            importedThings = emApp2.getCollection(
+//                appId2, "things", null, Query.Level.ALL_PROPERTIES).getEntities();
+//            assertTrue( !importedThings.isEmpty() );
+//
+//        } finally {
+//            deleteBucket();
+//        }
+//    }
+
+
+    /**
+     * TODO: Test that importing bad JSON will result in an informative error message.
+     */
+    @Test
+    public void testImportGoodJson() throws Exception{
+        // import from a bad JSON file
+        Assume.assumeTrue( configured );
+
+        String org = clientSetup.getOrganizationName();
+        String app = clientSetup.getAppName();
+
+
+        //list out all the files in the resource directory you want uploaded
+        List<String> filenames = new ArrayList<>( 1 );
+
+        filenames.add( "testImport.testCollection.1.json" );
+        // create 10 applications each with collection of 10 things, export all to S3
+        S3Upload s3Upload = new S3Upload();
+        s3Upload.copyToS3( System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR), System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR),
+            bucketName, filenames );
+
+        // import all those exports from S3 into the default test application
+
+        Entity importEntity = importCollection( );
+
+        Entity importGet = this.management().orgs().organization( org ).app().addToPath( app )
+                               .addToPath( "import" ).addToPath( ( String ) importEntity.get( "Import Entity" ) ).get();
+
+
+        assertNotNull( importGet );
+
+        assertNull( importGet.get( "errorMessage" ) );
+        assertNotNull( importGet.get( "state" ) );
+        assertEquals("import",importGet.get( "type" ));
+
+//TODO: make sure it checks the actual imported entities. And the progress they have made.
+
+    }
+//export with two files and import the two files.
+    //also test the includes endpoint.
+    /**
+     * TODO: Test that importing bad JSON will result in an informative error message.
+     */
+    @Test
+    public void testImportBadJson() throws Exception{
+        // import from a bad JSON file
+        Assume.assumeTrue( configured );
+
+        String org = clientSetup.getOrganizationName();
+        String app = clientSetup.getAppName();
+
+
+        //list out all the files in the resource directory you want uploaded
+        List<String> filenames = new ArrayList<>( 1 );
+        filenames.add( "testImportInvalidJson.testApplication.3.json" );
+        // create 10 applications each with collection of 10 things, export all to S3
+        S3Upload s3Upload = new S3Upload();
+        s3Upload.copyToS3( System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR),
+            System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR),
+            bucketName, filenames );
+
+        // import all those exports from S3 into the default test application
+
+        Entity importEntity = importCollection( );
+
+        // we should now have 100 Entities in the default app
+
+        Entity importGet = this.management().orgs().organization( org ).app().addToPath( app )
+                               .addToPath( "import" ).addToPath( ( String ) importEntity.get( "Import Entity" ) )
+                               .get();
+
+        Entity importGetIncludes = this.management().orgs().organization( org ).app().addToPath( app )
+                               .addToPath( "import" ).addToPath( ( String ) importEntity.get( "Import Entity" ) )
+                               .addToPath( "includes" ).get();
+
+        assertNotNull( importGet );
+        //TODO: needs better error checking
+        assertNotNull(importGetIncludes);
+
+        // check that error message indicates JSON parsing error
+    }
+
+    /**
+     * Call importService to import files from the configured S3 bucket.
+     */
+    private Entity importCollection() throws Exception {
+
+        String org = clientSetup.getOrganizationName();
+        String app = clientSetup.getAppName();
+
+        logger.debug("\n\nImport into new app {}\n", app );
+
+        Entity importPayload =  new Entity (new HashMap<String, Object>() {{
+            put( "properties", new HashMap<String, Object>() {{
+                put( "storage_provider", "s3" );
+                put( "storage_info", new HashMap<String, Object>() {{
+                    put( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR,
+                        System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR ) );
+                    put( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR,
+                        System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR ) );
+                    put( "bucket_location", bucketName );
+                }});
+            }});
+        }});
+
+        Entity importEntity = this.management().orgs().organization( org ).app().addToPath( app ).addToPath( "import" ).post( importPayload );
+
+
+        Entity importGet = this.management().orgs().organization( org ).app().addToPath( app )
+                               .addToPath( "import" ).addToPath( ( String ) importEntity.get( "Import Entity" ) ).get();
+
+//        int maxRetries = 120;
+//        int retries = 0;
+//
+//        while ( !importGet.get( "state" ).equals( "FINISHED" ) && retries++ < maxRetries ) {
+//            logger.debug("Waiting for import...");
+//            Thread.sleep(1000);
+//        }
+
+        refreshIndex();
+
+        return importEntity;
+    }
+
+    /**
+     * Create test entities of a specified type.
+     * First two entities are connected.
+     */
+    private void createTestEntities() throws Exception {
+
+        logger.debug("\n\nCreating users in application {}\n",
+            clientSetup.getAppName());
+
+        List<org.apache.usergrid.persistence.Entity> created = new ArrayList<>();
+        for (int i = 0; i < 10; i++) {
+            String name = "test"+i;
+            Entity payload = new Entity(  );
+            payload.put( "name",name);
+            payload.put( "username",name );
+            payload.put("email",name+"@test.com");
+            this.app().collection( "users" ).post(payload);
+
+
+        }
+
+        this.refreshIndex();
+
+//        // first two things are related to each other
+//        em.createConnection(new SimpleEntityRef(type, created.get(0).getUuid()),
+//            "related", new SimpleEntityRef(type, created.get(1).getUuid()));
+//        em.createConnection(new SimpleEntityRef(type, created.get(1).getUuid()),
+//            "related", new SimpleEntityRef(type, created.get(0).getUuid()));
+//
+//        em.refreshIndex();
+    }
+
+    /**
+     * Delete the configured s3 bucket.
+     */
+    public void deleteBucket() {
+
+        logger.debug("\n\nDelete bucket\n");
+
+        String accessId = System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR);
+        String secretKey = System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR);
+
+        Properties overrides = new Properties();
+        overrides.setProperty("s3" + ".identity", accessId);
+        overrides.setProperty("s3" + ".credential", secretKey);
+
+        final Iterable<? extends Module> MODULES = ImmutableSet
+            .of( new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
+
+        BlobStoreContext context =
+            ContextBuilder.newBuilder( "s3" ).credentials(accessId, secretKey).modules(MODULES)
+                          .overrides(overrides).buildView(BlobStoreContext.class);
+
+        BlobStore blobStore = context.getBlobStore();
+        blobStore.deleteContainer( bucketName );
+    }
+
+    // might be handy if you need to clean up buckets
+    private static void deleteBucketsWithPrefix() {
+
+        logger.debug("\n\nDelete buckets with prefix {}\n", bucketPrefix );
+
+        String accessId = System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR);
+        String secretKey = System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR);
+
+        Properties overrides = new Properties();
+        overrides.setProperty("s3" + ".identity", accessId);
+        overrides.setProperty("s3" + ".credential", secretKey);
+
+        final Iterable<? extends Module> MODULES = ImmutableSet
+            .of(new JavaUrlHttpCommandExecutorServiceModule(),
+                new Log4JLoggingModule(),
+                new NettyPayloadModule());
+
+        BlobStoreContext context =
+            ContextBuilder.newBuilder("s3").credentials(accessId, secretKey).modules(MODULES)
+                          .overrides(overrides).buildView(BlobStoreContext.class);
+
+        BlobStore blobStore = context.getBlobStore();
+        final PageSet<? extends StorageMetadata> blobStoreList = blobStore.list();
+
+        for ( Object o : blobStoreList.toArray() ) {
+            StorageMetadata s = (StorageMetadata)o;
+
+            if ( s.getName().startsWith( bucketPrefix )) {
+                try {
+                    blobStore.deleteContainer(s.getName());
+                } catch ( ContainerNotFoundException cnfe ) {
+                    logger.warn("Attempted to delete bucket {} but it is already deleted", cnfe );
+                }
+                logger.debug("Deleted bucket {}", s.getName());
+            }
+        }
+    }
 
 
     /*Creates fake payload for testing purposes.*/

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/rest/src/test/resources/testImport.testApplication.2.json
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/testImport.testApplication.2.json b/stack/rest/src/test/resources/testImport.testApplication.2.json
new file mode 100644
index 0000000..f45d129
--- /dev/null
+++ b/stack/rest/src/test/resources/testImport.testApplication.2.json
@@ -0,0 +1,56 @@
+[ {
+    "Metadata" : {
+        "uuid" : "589d95fa-ad7c-11e4-98bc-0f85bf181834",
+        "type" : "qtsmagic",
+        "created" : 1423171030223,
+        "modified" : 1423171030223,
+        "email" : "test0@anuff.com",
+        "username" : "billybob0"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "589f91ca-ad7c-11e4-a250-63b6975ea888",
+        "type" : "qtsmagic",
+        "created" : 1423171030236,
+        "modified" : 1423171030236,
+        "email" : "test1@anuff.com",
+        "username" : "billybob1"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a1186a-ad7c-11e4-bfc2-89e1e7bff3a8",
+        "type" : "qtsmagic",
+        "created" : 1423171030246,
+        "modified" : 1423171030246,
+        "email" : "test2@anuff.com",
+        "username" : "billybob2"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a2c61a-ad7c-11e4-b2be-ab36d8b017f3",
+        "type" : "qtsmagic",
+        "created" : 1423171030257,
+        "modified" : 1423171030257,
+        "email" : "test3@anuff.com",
+        "username" : "billybob3"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a44cba-ad7c-11e4-9fe5-fb8577a1f4a5",
+        "type" : "qtsmagic",
+        "created" : 1423171030267,
+        "modified" : 1423171030267,
+        "email" : "test4@anuff.com",
+        "username" : "billybob4"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/rest/src/test/resources/testImport.testCollection.1.json
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/testImport.testCollection.1.json b/stack/rest/src/test/resources/testImport.testCollection.1.json
new file mode 100644
index 0000000..181eb4e
--- /dev/null
+++ b/stack/rest/src/test/resources/testImport.testCollection.1.json
@@ -0,0 +1,13 @@
+[ {
+    "Metadata" : {
+        "uuid" : "5db4619a-ad7c-11e4-adba-bd162708d0a6",
+        "type" : "user",
+        "name" : "me",
+        "created" : 1423171038761,
+        "modified" : 1423171038761,
+        "username" : "junkRealName",
+        "email" : "burp0@anuff.com"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/rest/src/test/resources/testImportInvalidJson.testApplication.3.json
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/testImportInvalidJson.testApplication.3.json b/stack/rest/src/test/resources/testImportInvalidJson.testApplication.3.json
new file mode 100644
index 0000000..4a095a0
--- /dev/null
+++ b/stack/rest/src/test/resources/testImportInvalidJson.testApplication.3.json
@@ -0,0 +1,139 @@
+[ {
+    "Metadata" : {
+        "uuid" : "a48f87da-ad7b-11e4-a929-1903ccb95468",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-0",
+        "created" : 1423170728141,
+        "modified" : 1423170728141,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    ,
+    "connections" : {
+        "related" : [ "a4921fea-ad7b-11e4-ab93-5b5c80acc33f" ]
+    },
+    "dictionaries" : {
+        "connected_types" : {
+            "related" : ""
+        },
+        "connecting_types" : {
+            "related" : ""
+        }
+    }
+}, {
+    "Metadata" : {
+        "uuid" : "a4921fea-ad7b-11e4-ab93-5b5c80acc33f",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-1",
+        "created" : 1423170728158,
+        "modified" : 1423170728158,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : {
+        "related" : [ "a48f87da-ad7b-11e4-a929-1903ccb95468" ]
+    },
+    "dictionaries" : {
+        "connected_types" : {
+            "related" : ""
+        },
+        "connecting_types" : {
+            "related" : ""
+        }
+    }
+}, {
+    "Metadata" : {
+        "uuid" : "a494b7fa-ad7b-11e4-b590-df421e4b4225",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-2",
+        "created" : 1423170728175,
+        "modified" : 1423170728175,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a497771a-ad7b-11e4-9168-173fd0d6b09b",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-3",
+        "created" : 1423170728193,
+        "modified" : 1423170728193,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49a0f2a-ad7b-11e4-b8c5-01f63321a18b",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-4",
+        "created" : 1423170728210,
+        "modified" : 1423170728210,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49ca73a-ad7b-11e4-afa9-abe6d52a0752",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-5",
+        "created" : 1423170728227,
+        "modified" : 1423170728227,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49f1844-ad7b-11e4-a9b2-71d39c6a3448",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-6",
+        "created" : 1423170728243,
+        "modified" : 1423170728243,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a1622a-ad7b-11e4-bf9f-3facb3ba8073",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-7",
+        "created" : 1423170728258,
+        "modified" : 1423170728258,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a3ac1a-ad7b-11e4-868c-b1d8d4f657f1",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-8",
+        "created" : 1423170728273,
+        "modified" : 1423170728273,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a6442a-ad7b-11e4-867e-976ae355c744",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-9",
+        "created" : 1423170728290,
+        "modified" : 1423170728290,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
index 334f465..9815d89 100644
--- a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportCollectionIT.java
@@ -31,10 +31,12 @@ import org.apache.usergrid.batch.service.JobSchedulerService;
 import org.apache.usergrid.cassandra.CassandraResource;
 import org.apache.usergrid.cassandra.ClearShiroSubject;
 import org.apache.usergrid.cassandra.Concurrent;
+import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 import org.apache.usergrid.management.OrganizationInfo;
 import org.apache.usergrid.management.UserInfo;
 import org.apache.usergrid.management.export.ExportService;
 import org.apache.usergrid.persistence.*;
+import org.apache.usergrid.persistence.entities.FileImport;
 import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.index.query.Query.Level;
@@ -53,6 +55,10 @@ import org.slf4j.LoggerFactory;
 
 import java.util.*;
 
+import javax.ws.rs.core.Response;
+
+import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -323,7 +329,7 @@ public class ImportCollectionIT {
             logger.debug("\n\nQuery to see if we now have 100 entities\n");
 
             Query query = Query.fromQL("select *").withLimit(101);
-            
+
             List<Entity> importedThings = emDefaultApp.getCollection(
                 emDefaultApp.getApplicationId(), "things", query, Level.ALL_PROPERTIES).getEntities();
 
@@ -341,13 +347,66 @@ public class ImportCollectionIT {
      * TODO: Test that importing bad JSON will result in an informative error message.
      */
     @Test
-    public void testImportBadJson() {
-
+    public void testImportBadJson() throws Exception{
         // import from a bad JSON file
 
+        deleteBucket();
+
+        //list out all the files in the resource directory you want uploaded
+        List<String> filenames = new ArrayList<>( 1 );
+
+        filenames.add( "testImportInvalidJson.testApplication.3.json" );
+        // create 10 applications each with collection of 10 things, export all to S3
+        S3Upload s3Upload = new S3Upload();
+        s3Upload.copyToS3( System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR), System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR),
+            bucketName, filenames );
+
+        // import all those exports from S3 into the default test application
+
+        final EntityManager emDefaultApp = setup.getEmf().getEntityManager( applicationId );
+        importCollection( emDefaultApp, "things" );
+
+        // we should now have 100 Entities in the default app
+
+        List<Entity> importedThings = emDefaultApp.getCollection(
+            emDefaultApp.getApplicationId(), "things", null, Level.ALL_PROPERTIES).getEntities();
+
+        assertTrue( importedThings.isEmpty() );
+      //  assertEquals( , importedThings.size() );
+
         // check that error message indicates JSON parsing error
     }
 
+    @Test
+    public void testImportWithMultipleFilesSomeBad() throws Exception {
+
+        deleteBucket();
+
+        //list out all the files in the resource directory you want uploaded
+        List<String> filenames = new ArrayList<>( 3 );
+        filenames.add( "testImport.testCollection.1.json" );
+        filenames.add( "testImport.testApplication.2.json" );
+        filenames.add( "testImportInvalidJson.testApplication.3.json" );
+        // create 10 applications each with collection of 10 things, export all to S3
+        S3Upload s3Upload = new S3Upload();
+        s3Upload.copyToS3( System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR), System.getProperty(SDKGlobalConfiguration.SECRET_KEY_ENV_VAR),
+            bucketName, filenames );
+
+        // import all those exports from S3 into the default test application
+
+        final EntityManager emDefaultApp = setup.getEmf().getEntityManager( applicationId );
+        importCollection( emDefaultApp, "things" );
+
+        // we should now have 100 Entities in the default app
+
+        List<Entity> importedThings = emDefaultApp.getCollection(
+            emDefaultApp.getApplicationId(), "things", null, Level.ALL_PROPERTIES).getEntities();
+
+        assertTrue( !importedThings.isEmpty() );
+        assertEquals( 7, importedThings.size() );
+        //TODO: have something that checks the exceptions and errors.
+    }
+
 
    //---------------------------------------------------------------------------------------------
 
@@ -378,9 +437,12 @@ public class ImportCollectionIT {
             }});
         }});
 
+
+
         int maxRetries = 120;
         int retries = 0;
-        while ( !importService.getState( importUUID ).equals( "FINISHED" ) && retries++ < maxRetries ) {
+        while ( (!importService.getState( importUUID ).equals( "FINISHED" ) ||
+                 !importService.getState( importUUID ).equals( "FAILED" )) && retries++ < maxRetries ) {
             logger.debug("Waiting for import...");
             Thread.sleep(1000);
         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/services/src/test/java/org/apache/usergrid/management/importer/S3Upload.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/management/importer/S3Upload.java b/stack/services/src/test/java/org/apache/usergrid/management/importer/S3Upload.java
new file mode 100644
index 0000000..c556bfd
--- /dev/null
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/S3Upload.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.management.importer;
+
+
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.jclouds.ContextBuilder;
+import org.jclouds.blobstore.BlobStore;
+import org.jclouds.blobstore.BlobStoreContext;
+import org.jclouds.blobstore.domain.Blob;
+import org.jclouds.blobstore.domain.BlobBuilder;
+import org.jclouds.blobstore.options.PutOptions;
+import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
+import org.jclouds.logging.log4j.config.Log4JLoggingModule;
+import org.jclouds.netty.config.NettyPayloadModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.amazonaws.SDKGlobalConfiguration;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Module;
+
+
+/**
+ * Helper class made to upload resource files to s3 so they can be imported later
+ */
+public class S3Upload {
+    private static final Logger logger = LoggerFactory.getLogger( S3Upload.class );
+
+    /*won't need any of the properties as I have the export info*/
+
+    public void copyToS3( String accessKey, String secretKey, String bucketName, List<String> filenames ) {
+
+
+        Properties overrides = new Properties();
+        overrides.setProperty( "s3" + ".identity", accessKey );
+        overrides.setProperty( "s3" + ".credential", secretKey );
+
+        final Iterable<? extends Module> MODULES = ImmutableSet
+            .of( new JavaUrlHttpCommandExecutorServiceModule(), new Log4JLoggingModule(), new NettyPayloadModule() );
+
+        BlobStoreContext context =
+            ContextBuilder.newBuilder( "s3" ).credentials( accessKey, secretKey ).modules( MODULES )
+                          .overrides( overrides ).buildView( BlobStoreContext.class );
+
+        // Create Container (the bucket in s3)
+        try {
+            BlobStore blobStore = context.getBlobStore();
+            if ( blobStore.createContainerInLocation( null, bucketName ) ) {
+                logger.info( "Created bucket " + bucketName );
+            }
+        }
+        catch ( Exception ex ) {
+            throw new RuntimeException( "Could not create bucket",ex );
+        }
+        Iterator<String> fileNameIterator = filenames.iterator();
+        while(fileNameIterator.hasNext()) {
+            String filename = fileNameIterator.next();
+            InputStream fileStream = S3Upload.class.getResourceAsStream( "/" + filename );
+            try {
+                BlobStore blobStore = context.getBlobStore();
+                BlobBuilder blobBuilder = blobStore.blobBuilder( "testorganization/"+filename ).payload( fileStream ).calculateMD5()
+                                                   .contentType( "application/json" );
+                Blob blob = blobBuilder.build();
+
+                final String uploadedFile = blobStore.putBlob( bucketName, blob, PutOptions.Builder.multipart() );
+
+                //wait for the file to finish uploading
+                Thread.sleep(4000);
+
+                logger.info( "Uploaded file name={} etag={}", filename, uploadedFile );
+            }
+            catch ( Exception e ) {
+                logger.error( "Error uploading to blob store", e );
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/services/src/test/resources/testImport.testApplication.2.json
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/testImport.testApplication.2.json b/stack/services/src/test/resources/testImport.testApplication.2.json
new file mode 100644
index 0000000..f45d129
--- /dev/null
+++ b/stack/services/src/test/resources/testImport.testApplication.2.json
@@ -0,0 +1,56 @@
+[ {
+    "Metadata" : {
+        "uuid" : "589d95fa-ad7c-11e4-98bc-0f85bf181834",
+        "type" : "qtsmagic",
+        "created" : 1423171030223,
+        "modified" : 1423171030223,
+        "email" : "test0@anuff.com",
+        "username" : "billybob0"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "589f91ca-ad7c-11e4-a250-63b6975ea888",
+        "type" : "qtsmagic",
+        "created" : 1423171030236,
+        "modified" : 1423171030236,
+        "email" : "test1@anuff.com",
+        "username" : "billybob1"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a1186a-ad7c-11e4-bfc2-89e1e7bff3a8",
+        "type" : "qtsmagic",
+        "created" : 1423171030246,
+        "modified" : 1423171030246,
+        "email" : "test2@anuff.com",
+        "username" : "billybob2"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a2c61a-ad7c-11e4-b2be-ab36d8b017f3",
+        "type" : "qtsmagic",
+        "created" : 1423171030257,
+        "modified" : 1423171030257,
+        "email" : "test3@anuff.com",
+        "username" : "billybob3"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "58a44cba-ad7c-11e4-9fe5-fb8577a1f4a5",
+        "type" : "qtsmagic",
+        "created" : 1423171030267,
+        "modified" : 1423171030267,
+        "email" : "test4@anuff.com",
+        "username" : "billybob4"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/services/src/test/resources/testImport.testCollection.1.json
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/testImport.testCollection.1.json b/stack/services/src/test/resources/testImport.testCollection.1.json
new file mode 100644
index 0000000..181eb4e
--- /dev/null
+++ b/stack/services/src/test/resources/testImport.testCollection.1.json
@@ -0,0 +1,13 @@
+[ {
+    "Metadata" : {
+        "uuid" : "5db4619a-ad7c-11e4-adba-bd162708d0a6",
+        "type" : "user",
+        "name" : "me",
+        "created" : 1423171038761,
+        "modified" : 1423171038761,
+        "username" : "junkRealName",
+        "email" : "burp0@anuff.com"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7621be90/stack/services/src/test/resources/testImportInvalidJson.testApplication.3.json
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/testImportInvalidJson.testApplication.3.json b/stack/services/src/test/resources/testImportInvalidJson.testApplication.3.json
new file mode 100644
index 0000000..4a095a0
--- /dev/null
+++ b/stack/services/src/test/resources/testImportInvalidJson.testApplication.3.json
@@ -0,0 +1,139 @@
+[ {
+    "Metadata" : {
+        "uuid" : "a48f87da-ad7b-11e4-a929-1903ccb95468",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-0",
+        "created" : 1423170728141,
+        "modified" : 1423170728141,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    ,
+    "connections" : {
+        "related" : [ "a4921fea-ad7b-11e4-ab93-5b5c80acc33f" ]
+    },
+    "dictionaries" : {
+        "connected_types" : {
+            "related" : ""
+        },
+        "connecting_types" : {
+            "related" : ""
+        }
+    }
+}, {
+    "Metadata" : {
+        "uuid" : "a4921fea-ad7b-11e4-ab93-5b5c80acc33f",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-1",
+        "created" : 1423170728158,
+        "modified" : 1423170728158,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : {
+        "related" : [ "a48f87da-ad7b-11e4-a929-1903ccb95468" ]
+    },
+    "dictionaries" : {
+        "connected_types" : {
+            "related" : ""
+        },
+        "connecting_types" : {
+            "related" : ""
+        }
+    }
+}, {
+    "Metadata" : {
+        "uuid" : "a494b7fa-ad7b-11e4-b590-df421e4b4225",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-2",
+        "created" : 1423170728175,
+        "modified" : 1423170728175,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a497771a-ad7b-11e4-9168-173fd0d6b09b",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-3",
+        "created" : 1423170728193,
+        "modified" : 1423170728193,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49a0f2a-ad7b-11e4-b8c5-01f63321a18b",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-4",
+        "created" : 1423170728210,
+        "modified" : 1423170728210,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49ca73a-ad7b-11e4-afa9-abe6d52a0752",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-5",
+        "created" : 1423170728227,
+        "modified" : 1423170728227,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a49f1844-ad7b-11e4-a9b2-71d39c6a3448",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-6",
+        "created" : 1423170728243,
+        "modified" : 1423170728243,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a1622a-ad7b-11e4-bf9f-3facb3ba8073",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-7",
+        "created" : 1423170728258,
+        "modified" : 1423170728258,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a3ac1a-ad7b-11e4-868c-b1d8d4f657f1",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-8",
+        "created" : 1423170728273,
+        "modified" : 1423170728273,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+}, {
+    "Metadata" : {
+        "uuid" : "a4a6442a-ad7b-11e4-867e-976ae355c744",
+        "type" : "thing",
+        "name" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport-thing-9",
+        "created" : 1423170728290,
+        "modified" : 1423170728290,
+        "originalAppId" : "a445ad9e-ad7b-11e4-9e42-e2c2c83d257d",
+        "originalAppName" : "org.apache.usergrid.management.importer.importcollectionit9dc7ff35ad7b11e49e42e2c2c83d257d/testupdatebyimport"
+    },
+    "connections" : { },
+    "dictionaries" : { }
+} ]


[2/2] incubator-usergrid git commit: Merge branch 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-import

Posted by gr...@apache.org.
Merge branch 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-import

# By Dave Johnson (1) and Todd Nine (1)
# Via Dave Johnson (1) and Todd Nine (1)
* 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid:
  Updated test. Won't fix until refactor.
  Add job service bootstrap.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/65e6feeb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/65e6feeb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/65e6feeb

Branch: refs/heads/two-dot-o-import
Commit: 65e6feeb1eeb8ceae5fa9e78a23816b946a6499d
Parents: 7621be9 c3839c8
Author: grey <gr...@apigee.com>
Authored: Tue Feb 10 13:38:58 2015 -0800
Committer: grey <gr...@apigee.com>
Committed: Tue Feb 10 13:38:58 2015 -0800

----------------------------------------------------------------------
 .../persistence/EntityConnectionsIT.java        | 121 +++++++++++++++++--
 .../usergrid/rest/JobServiceBoostrap.java       |  75 ++++++++++++
 .../main/resources/usergrid-rest-context.xml    |   6 +-
 .../management/importer/ImportServiceImpl.java  |   9 +-
 4 files changed, 191 insertions(+), 20 deletions(-)
----------------------------------------------------------------------