]> source.dussan.org Git - archiva.git/commitdiff
fix truncating datas in unit and wrong StringUtils usage
authorOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 01:36:21 +0000 (01:36 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 24 Mar 2014 01:36:21 +0000 (01:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580690 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraUtils.java
archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java

index 3482f59942bbf91ee5262174a1ee5895c47cb482..f1b8c71185237ce4574949120381da6bb47f8502 100644 (file)
@@ -76,7 +76,7 @@ public class CassandraUtils
 
     public static String getStringValue( ColumnSlice<String, String> columnSlice, String columnName )
     {
-        if ( StringUtils.isNotEmpty( columnName ) )
+        if ( StringUtils.isEmpty( columnName ) )
         {
             return null;
         }
@@ -87,7 +87,7 @@ public class CassandraUtils
 
     public static Long getLongValue( ColumnSlice<String, Long> columnSlice, String columnName )
     {
-        if ( StringUtils.isNotEmpty( columnName ) )
+        if ( StringUtils.isEmpty( columnName ) )
         {
             return null;
         }
@@ -99,7 +99,7 @@ public class CassandraUtils
     public static String getAsStringValue( ColumnSlice<String, Long> columnSlice, String columnName )
     {
         StringSerializer ss = StringSerializer.get();
-        if ( StringUtils.isNotEmpty( columnName ) )
+        if ( StringUtils.isEmpty( columnName ) )
         {
             return null;
         }
@@ -111,7 +111,7 @@ public class CassandraUtils
     public static Long getAsLongValue( ColumnSlice<String, String> columnSlice, String columnName )
     {
         LongSerializer ls = LongSerializer.get();
-        if ( StringUtils.isNotEmpty( columnName ) )
+        if ( StringUtils.isEmpty( columnName ) )
         {
             return null;
         }
index ed71dc7c79a2930c298ad76d618f0cf3cda7cc01..e501b82668e5d69aea41219840bc7a8a6f38cc05 100644 (file)
@@ -85,6 +85,18 @@ public class CassandraMetadataRepositoryTest
         cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(),
                                                        "repository" );
 
+        cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(),
+                                                       "projectversionmetadatamodel" );
+
+        cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(),
+                                                       "artifactmetadatamodel" );
+
+        cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(),
+                                                       "metadatafacetmodel" );
+
+        cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(),
+                                                       "metadatafacetmodel" );
+
     }
 
 }