usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [20/51] [abbrv] git commit: Because of the way we initialize modules and configurations we need to be able to access the available port finder inside the collection module. I moved that over to the main source folder instead of test and cleaned up some o
Date Thu, 16 Jan 2014 17:30:16 GMT
Because of the way we initialize modules and configurations we need
to be able to access the available port finder inside the collection
module. I moved that over to the main source folder instead of test
and cleaned up some of the code used to handle the thrift and gossip
ports for the CassandraRule. Also found a bug associated with running
in the UNIT deployment context in CassandraRule.


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

Branch: refs/pull/18/merge
Commit: 4c29d3064d36fa608ec138456efd57f1e27c9309
Parents: a5bae70
Author: Alex Karasulu <akarasulu@gmail.com>
Authored: Wed Jan 15 18:35:51 2014 +0200
Committer: Alex Karasulu <akarasulu@gmail.com>
Committed: Wed Jan 15 18:35:51 2014 +0200

----------------------------------------------------------------------
 .../astyanax/AstyanaxKeyspaceProvider.java      |   2 +-
 .../collection/astyanax/CassandraFig.java       |   2 +-
 .../cassandra/AvailablePortFinder.java          | 187 +++++++++++++++++++
 .../collection/guice/CollectionModule.java      |  37 ++++
 .../cassandra/AvailablePortFinder.java          | 187 -------------------
 .../collection/cassandra/CassandraRule.java     |  22 +--
 ...MvccEntitySerializationStrategyImplTest.java |  21 +--
 7 files changed, 233 insertions(+), 225 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
index 512f2fa..e1fc105 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/AstyanaxKeyspaceProvider.java
@@ -38,7 +38,7 @@ public class AstyanaxKeyspaceProvider implements Provider<Keyspace>
{
 
         ConnectionPoolConfiguration connectionPoolConfiguration =
                 new ConnectionPoolConfigurationImpl( "UsergridConnectionPool" )
-                        .setPort( cassandraConfig.getPort() )
+                        .setPort( cassandraConfig.getThriftPort() )
                         .setMaxConnsPerHost( cassandraConfig.getConnections() )
                         .setSeeds( cassandraConfig.getHosts() )
                         .setSocketTimeout( cassandraConfig.getTimeout() );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
index 0728656..cfc361b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/astyanax/CassandraFig.java
@@ -29,7 +29,7 @@ public interface CassandraFig extends GuicyFig {
 
     @Key( "cassandra.port" )
     @Default( "9160" )
-    int getPort();
+    int getThriftPort();
 
     @Key( "cassandra.connections" )
     @Default( "20" )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
new file mode 100644
index 0000000..f18d728
--- /dev/null
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
@@ -0,0 +1,187 @@
+/*
+ *  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.persistence.collection.cassandra;
+
+
+import java.io.IOException;
+import java.net.DatagramSocket;
+import java.net.ServerSocket;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.TreeSet;
+
+
+/**
+ * Finds currently available server ports.
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * @see <a href="http://www.iana.org/assignments/port-numbers">IANA.org</a>
+ */
+public class AvailablePortFinder {
+    /** The minimum number of server port number. */
+    public static final int MIN_PORT_NUMBER = 1;
+
+    /** The maximum number of server port number. */
+    public static final int MAX_PORT_NUMBER = 49151;
+
+
+    /** Creates a new instance. */
+    private AvailablePortFinder() {
+        // Do nothing
+    }
+
+
+    /**
+     * Returns the {@link java.util.Set} of currently available port numbers ({@link Integer}).
 This method is identical to
+     * <code>getAvailablePorts(MIN_PORT_NUMBER, MAX_PORT_NUMBER)</code>.
+     * <p/>
+     * WARNING: this can take a very long time.
+     */
+    public static Set<Integer> getAvailablePorts() {
+        return getAvailablePorts( MIN_PORT_NUMBER, MAX_PORT_NUMBER );
+    }
+
+
+    /**
+     * Gets an available port, selected by the system.
+     *
+     * @throws java.util.NoSuchElementException if there are no ports available
+     */
+    public static int getNextAvailable() {
+        ServerSocket serverSocket = null;
+
+        try {
+            // Here, we simply return an available port found by the system
+            serverSocket = new ServerSocket( 0 );
+            int port = serverSocket.getLocalPort();
+
+            // Don't forget to close the socket...
+            serverSocket.close();
+
+            return port;
+        }
+        catch ( IOException ioe ) {
+            throw new NoSuchElementException( ioe.getMessage() );
+        }
+    }
+
+
+    /**
+     * Gets the next available port starting at a port.
+     *
+     * @param fromPort the port to scan for availability
+     *
+     * @throws java.util.NoSuchElementException if there are no ports available
+     */
+    public static int getNextAvailable( int fromPort ) {
+        if ( fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER ) {
+            throw new IllegalArgumentException( "Invalid start port: " + fromPort );
+        }
+
+        for ( int i = fromPort; i <= MAX_PORT_NUMBER; i++ ) {
+            if ( available( i ) ) {
+                return i;
+            }
+        }
+
+        throw new NoSuchElementException( "Could not find an available port " + "above "
+ fromPort );
+    }
+
+
+    /**
+     * Checks to see if a specific port is available.
+     *
+     * @param port the port to check for availability
+     */
+    public static boolean available( int port ) {
+        if ( port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER ) {
+            throw new IllegalArgumentException( "Invalid start port: " + port );
+        }
+
+        ServerSocket ss = null;
+        DatagramSocket ds = null;
+
+        try {
+            ss = new ServerSocket( port );
+            ss.setReuseAddress( true );
+            ds = new DatagramSocket( port );
+            ds.setReuseAddress( true );
+            return true;
+        }
+        catch ( IOException e ) {
+            // Do nothing
+        }
+        finally {
+            if ( ds != null ) {
+                ds.close();
+            }
+
+            if ( ss != null ) {
+                try {
+                    ss.close();
+                }
+                catch ( IOException e ) {
+                    /* should not be thrown */
+                }
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Returns the {@link java.util.Set} of currently avaliable port numbers ({@link Integer})
between the specified port range.
+     *
+     * @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER}
and {@link
+     * #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
+     */
+    public static Set<Integer> getAvailablePorts( int fromPort, int toPort ) {
+        if ( fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort >
toPort ) {
+            throw new IllegalArgumentException( "Invalid port range: " + fromPort + " ~ "
+ toPort );
+        }
+
+        Set<Integer> result = new TreeSet<Integer>();
+
+        for ( int i = fromPort; i <= toPort; i++ ) {
+            ServerSocket s = null;
+
+            try {
+                s = new ServerSocket( i );
+                result.add( new Integer( i ) );
+            }
+            catch ( IOException e ) {
+                // Do nothing
+            }
+            finally {
+                if ( s != null ) {
+                    try {
+                        s.close();
+                    }
+                    catch ( IOException e ) {
+                        /* should not be thrown */
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
index 8bc2a79..c35464b 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/guice/CollectionModule.java
@@ -1,12 +1,16 @@
 package org.apache.usergrid.persistence.collection.guice;
 
 
+import java.io.IOException;
+
+import org.safehaus.guicyfig.Env;
 import org.safehaus.guicyfig.GuicyFigModule;
 
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
 import org.apache.usergrid.persistence.collection.EntityCollectionManagerSync;
 import org.apache.usergrid.persistence.collection.astyanax.CassandraFig;
+import org.apache.usergrid.persistence.collection.cassandra.AvailablePortFinder;
 import org.apache.usergrid.persistence.collection.impl.EntityCollectionManagerImpl;
 import org.apache.usergrid.persistence.collection.impl.EntityCollectionManagerSyncImpl;
 import org.apache.usergrid.persistence.collection.migration.MigrationManagerFig;
@@ -17,7 +21,10 @@ import org.apache.usergrid.persistence.collection.serialization.impl.Serializati
 import org.apache.usergrid.persistence.collection.service.impl.ServiceModule;
 
 import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
 import com.google.inject.assistedinject.FactoryModuleBuilder;
+import com.netflix.config.ConfigurationManager;
 
 import rx.Scheduler;
 
@@ -29,6 +36,36 @@ import rx.Scheduler;
  */
 public class CollectionModule extends AbstractModule {
 
+    static {
+        /*
+         * --------------------------------------------------------------------
+         * Archaius Configuration Settings
+         * --------------------------------------------------------------------
+         */
+
+        try {
+            ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
+        }
+        catch ( IOException e ) {
+            throw new RuntimeException( "Cannot do much without properly loading our configuration.",
e );
+        }
+
+        Injector injector = Guice.createInjector( new GuicyFigModule( CassandraFig.class,
RxFig.class ) );
+        CassandraFig cassandraFig = injector.getInstance( CassandraFig.class );
+        RxFig rxFig = injector.getInstance( RxFig.class );
+
+        Env env = Env.getEnvironment();
+        if ( env == Env.UNIT || env == Env.ALL ) {
+            String thriftPort = String.valueOf( AvailablePortFinder.getNextAvailable() );
+            cassandraFig.bypass( "getThriftPort", thriftPort );
+            cassandraFig.bypass( "getConnections", "20" );
+            rxFig.bypass( "getMaxThreadCount", "20" );
+            cassandraFig.bypass( "getHosts", "localhost" );
+            cassandraFig.bypass( "getClusterName", "Usergrid" );
+            cassandraFig.bypass( "getKeyspaceName", "Usergrid_Collections" );
+        }
+    }
+
     @Override
     protected void configure() {
         //noinspection unchecked

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
deleted file mode 100644
index f18d728..0000000
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/AvailablePortFinder.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- *  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.persistence.collection.cassandra;
-
-
-import java.io.IOException;
-import java.net.DatagramSocket;
-import java.net.ServerSocket;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.TreeSet;
-
-
-/**
- * Finds currently available server ports.
- *
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * @see <a href="http://www.iana.org/assignments/port-numbers">IANA.org</a>
- */
-public class AvailablePortFinder {
-    /** The minimum number of server port number. */
-    public static final int MIN_PORT_NUMBER = 1;
-
-    /** The maximum number of server port number. */
-    public static final int MAX_PORT_NUMBER = 49151;
-
-
-    /** Creates a new instance. */
-    private AvailablePortFinder() {
-        // Do nothing
-    }
-
-
-    /**
-     * Returns the {@link java.util.Set} of currently available port numbers ({@link Integer}).
 This method is identical to
-     * <code>getAvailablePorts(MIN_PORT_NUMBER, MAX_PORT_NUMBER)</code>.
-     * <p/>
-     * WARNING: this can take a very long time.
-     */
-    public static Set<Integer> getAvailablePorts() {
-        return getAvailablePorts( MIN_PORT_NUMBER, MAX_PORT_NUMBER );
-    }
-
-
-    /**
-     * Gets an available port, selected by the system.
-     *
-     * @throws java.util.NoSuchElementException if there are no ports available
-     */
-    public static int getNextAvailable() {
-        ServerSocket serverSocket = null;
-
-        try {
-            // Here, we simply return an available port found by the system
-            serverSocket = new ServerSocket( 0 );
-            int port = serverSocket.getLocalPort();
-
-            // Don't forget to close the socket...
-            serverSocket.close();
-
-            return port;
-        }
-        catch ( IOException ioe ) {
-            throw new NoSuchElementException( ioe.getMessage() );
-        }
-    }
-
-
-    /**
-     * Gets the next available port starting at a port.
-     *
-     * @param fromPort the port to scan for availability
-     *
-     * @throws java.util.NoSuchElementException if there are no ports available
-     */
-    public static int getNextAvailable( int fromPort ) {
-        if ( fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER ) {
-            throw new IllegalArgumentException( "Invalid start port: " + fromPort );
-        }
-
-        for ( int i = fromPort; i <= MAX_PORT_NUMBER; i++ ) {
-            if ( available( i ) ) {
-                return i;
-            }
-        }
-
-        throw new NoSuchElementException( "Could not find an available port " + "above "
+ fromPort );
-    }
-
-
-    /**
-     * Checks to see if a specific port is available.
-     *
-     * @param port the port to check for availability
-     */
-    public static boolean available( int port ) {
-        if ( port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER ) {
-            throw new IllegalArgumentException( "Invalid start port: " + port );
-        }
-
-        ServerSocket ss = null;
-        DatagramSocket ds = null;
-
-        try {
-            ss = new ServerSocket( port );
-            ss.setReuseAddress( true );
-            ds = new DatagramSocket( port );
-            ds.setReuseAddress( true );
-            return true;
-        }
-        catch ( IOException e ) {
-            // Do nothing
-        }
-        finally {
-            if ( ds != null ) {
-                ds.close();
-            }
-
-            if ( ss != null ) {
-                try {
-                    ss.close();
-                }
-                catch ( IOException e ) {
-                    /* should not be thrown */
-                }
-            }
-        }
-
-        return false;
-    }
-
-
-    /**
-     * Returns the {@link java.util.Set} of currently avaliable port numbers ({@link Integer})
between the specified port range.
-     *
-     * @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER}
and {@link
-     * #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
-     */
-    public static Set<Integer> getAvailablePorts( int fromPort, int toPort ) {
-        if ( fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort >
toPort ) {
-            throw new IllegalArgumentException( "Invalid port range: " + fromPort + " ~ "
+ toPort );
-        }
-
-        Set<Integer> result = new TreeSet<Integer>();
-
-        for ( int i = fromPort; i <= toPort; i++ ) {
-            ServerSocket s = null;
-
-            try {
-                s = new ServerSocket( i );
-                result.add( new Integer( i ) );
-            }
-            catch ( IOException e ) {
-                // Do nothing
-            }
-            finally {
-                if ( s != null ) {
-                    try {
-                        s.close();
-                    }
-                    catch ( IOException e ) {
-                        /* should not be thrown */
-                    }
-                }
-            }
-        }
-
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
index ab94574..a9123c1 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/cassandra/CassandraRule.java
@@ -4,6 +4,7 @@ package org.apache.usergrid.persistence.collection.cassandra;
 import java.io.File;
 import java.io.IOException;
 
+import org.safehaus.guicyfig.Env;
 import org.safehaus.guicyfig.EnvironResource;
 import org.safehaus.guicyfig.GuicyFigModule;
 import org.slf4j.Logger;
@@ -25,10 +26,6 @@ import com.netflix.astyanax.test.EmbeddedCassandra;
 public class CassandraRule extends EnvironResource {
     private static final Logger LOG = LoggerFactory.getLogger( CassandraRule.class );
 
-    public static final int THRIFT_PORT = AvailablePortFinder.getNextAvailable();
-    public static final int GOSSIP_PORT = AvailablePortFinder.getNextAvailable();
-    public static final String THRIFT_PORT_STR = Integer.toString( THRIFT_PORT );
-
     private static final Object mutex = new Object();
 
     private static EmbeddedCassandra cass;
@@ -39,7 +36,7 @@ public class CassandraRule extends EnvironResource {
 
 
     public CassandraRule() {
-        super();
+        super( Env.UNIT );
 
         Injector injector = Guice.createInjector( new GuicyFigModule( CassandraFig.class
) );
         cassandraFig = injector.getInstance( CassandraFig.class );
@@ -53,11 +50,6 @@ public class CassandraRule extends EnvironResource {
 
     @Override
     protected void before() throws Throwable {
-        cassandraFig.override( "getPort", THRIFT_PORT_STR );
-        cassandraFig.override( "getConnections", "20" );
-        cassandraFig.override( "getHosts", "localhost" );
-        cassandraFig.override( "getClusterName", "Usergrid" );
-        cassandraFig.override( "getKeyspaceName", "Usergrid_Collections" );
 
         if ( started ) {
             return;
@@ -65,13 +57,6 @@ public class CassandraRule extends EnvironResource {
 
         synchronized ( mutex ) {
 
-            //we're late to the party, bail
-            if ( started ) {
-                return;
-            }
-
-            cassandraFig.bypass( "getPort", THRIFT_PORT_STR );
-
             File dataDir = Files.createTempDir();
             dataDir.deleteOnExit();
 
@@ -83,7 +68,8 @@ public class CassandraRule extends EnvironResource {
             try {
                 LOG.info( "Starting cassandra" );
 
-                cass = new EmbeddedCassandra( dataDir, "Usergrid", THRIFT_PORT, GOSSIP_PORT
);
+                cass = new EmbeddedCassandra( dataDir, "Usergrid", cassandraFig.getThriftPort(),
+                        AvailablePortFinder.getNextAvailable() );
                 cass.start();
 
                 LOG.info( "Cassandra started" );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4c29d306/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index 97dc803..c18158d 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -16,6 +16,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.safehaus.chop.api.IterationChop;
 import org.safehaus.guicyfig.Env;
+import org.safehaus.guicyfig.GuicyFigModule;
 import org.safehaus.guicyfig.Option;
 import org.safehaus.guicyfig.Overrides;
 
@@ -45,7 +46,9 @@ import org.apache.usergrid.persistence.model.field.UUIDField;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.common.base.Optional;
+import com.google.inject.Guice;
 import com.google.inject.Inject;
+import com.google.inject.Injector;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 import com.netflix.config.ConfigurationManager;
 
@@ -66,20 +69,6 @@ public class MvccEntitySerializationStrategyImplTest {
     /** Our RX I/O threads and this should have the same value */
     private static final String CONNECTION_COUNT = "20";
 
-    static {
-        /*
-         * --------------------------------------------------------------------
-         * Archaius Configuration Settings
-         * --------------------------------------------------------------------
-         */
-
-        try {
-            ConfigurationManager.loadCascadedPropertiesFromResources( "usergrid" );
-        }
-        catch ( IOException e ) {
-            throw new RuntimeException( "Cannot do much without properly loading our configuration.",
e );
-        }
-    }
 
     @Inject
     private MvccEntitySerializationStrategy serializationStrategy;
@@ -122,12 +111,8 @@ public class MvccEntitySerializationStrategyImplTest {
 
     @Before
     public void setupClass() {
-
         assertNotNull( cassandraFig );
-        cassandraFig.bypass( "getPort", CassandraRule.THRIFT_PORT_STR );
-
         assertNotNull( rxFig );
-        rxFig.bypass( "getMaxThreadCount", CassandraRule.THRIFT_PORT_STR );
     }
 
 


Mime
View raw message