forked from Qortal/qortal
Moved block/follow utility methods to a new ListUtils class
This commit is contained in:
parent
4835e5732d
commit
2086a2c476
@ -19,10 +19,7 @@ import org.qortal.repository.RepositoryManager;
|
|||||||
import org.qortal.arbitrary.ArbitraryDataFile.*;
|
import org.qortal.arbitrary.ArbitraryDataFile.*;
|
||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.transform.Transformer;
|
import org.qortal.transform.Transformer;
|
||||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
import org.qortal.utils.*;
|
||||||
import org.qortal.utils.Base58;
|
|
||||||
import org.qortal.utils.FilesystemUtils;
|
|
||||||
import org.qortal.utils.ZipUtils;
|
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
import javax.crypto.BadPaddingException;
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
@ -373,7 +370,7 @@ public class ArbitraryDataReader {
|
|||||||
ArbitraryTransactionUtils.checkAndRelocateMiscFiles(transactionData);
|
ArbitraryTransactionUtils.checkAndRelocateMiscFiles(transactionData);
|
||||||
|
|
||||||
if (!arbitraryDataFile.allFilesExist()) {
|
if (!arbitraryDataFile.allFilesExist()) {
|
||||||
if (ArbitraryDataStorageManager.getInstance().isNameBlocked(transactionData.getName())) {
|
if (ListUtils.isNameBlocked(transactionData.getName())) {
|
||||||
throw new DataException(
|
throw new DataException(
|
||||||
String.format("Unable to request missing data for file %s because the name is blocked", arbitraryDataFile));
|
String.format("Unable to request missing data for file %s because the name is blocked", arbitraryDataFile));
|
||||||
} else {
|
} else {
|
||||||
|
@ -11,13 +11,13 @@ import org.qortal.controller.arbitrary.ArbitraryDataManager;
|
|||||||
import org.qortal.controller.arbitrary.ArbitraryDataStorageManager;
|
import org.qortal.controller.arbitrary.ArbitraryDataStorageManager;
|
||||||
import org.qortal.data.arbitrary.ArbitraryResourceStatus;
|
import org.qortal.data.arbitrary.ArbitraryResourceStatus;
|
||||||
import org.qortal.data.transaction.ArbitraryTransactionData;
|
import org.qortal.data.transaction.ArbitraryTransactionData;
|
||||||
import org.qortal.list.ResourceListManager;
|
|
||||||
import org.qortal.repository.DataException;
|
import org.qortal.repository.DataException;
|
||||||
import org.qortal.repository.Repository;
|
import org.qortal.repository.Repository;
|
||||||
import org.qortal.repository.RepositoryManager;
|
import org.qortal.repository.RepositoryManager;
|
||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
import org.qortal.utils.ArbitraryTransactionUtils;
|
||||||
import org.qortal.utils.FilesystemUtils;
|
import org.qortal.utils.FilesystemUtils;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -74,8 +74,7 @@ public class ArbitraryDataResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if the name is blocked
|
// Check if the name is blocked
|
||||||
if (ResourceListManager.getInstance()
|
if (ListUtils.isNameBlocked(this.resourceId)) {
|
||||||
.listContains("blockedNames", this.resourceId, false)) {
|
|
||||||
return new ArbitraryResourceStatus(Status.BLOCKED, this.localChunkCount, this.totalChunkCount);
|
return new ArbitraryResourceStatus(Status.BLOCKED, this.localChunkCount, this.totalChunkCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,7 @@ import org.qortal.repository.RepositoryManager;
|
|||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.transaction.Transaction;
|
import org.qortal.transaction.Transaction;
|
||||||
import org.qortal.transaction.Transaction.TransactionType;
|
import org.qortal.transaction.Transaction.TransactionType;
|
||||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
import org.qortal.utils.*;
|
||||||
import org.qortal.utils.Base58;
|
|
||||||
import org.qortal.utils.FilesystemUtils;
|
|
||||||
import org.qortal.utils.NTP;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -239,7 +236,7 @@ public class ArbitraryDataCleanupManager extends Thread {
|
|||||||
|
|
||||||
// Delete random data associated with name if we're over our storage limit for this name
|
// Delete random data associated with name if we're over our storage limit for this name
|
||||||
// Use the DELETION_THRESHOLD, for the same reasons as above
|
// Use the DELETION_THRESHOLD, for the same reasons as above
|
||||||
for (String followedName : storageManager.followedNames()) {
|
for (String followedName : ListUtils.followedNames()) {
|
||||||
if (isStopping) {
|
if (isStopping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -487,7 +484,7 @@ public class ArbitraryDataCleanupManager extends Thread {
|
|||||||
|
|
||||||
// Delete data relating to blocked names
|
// Delete data relating to blocked names
|
||||||
String name = directory.getName();
|
String name = directory.getName();
|
||||||
if (name != null && storageManager.isNameBlocked(name)) {
|
if (name != null && ListUtils.isNameBlocked(name)) {
|
||||||
this.safeDeleteDirectory(directory, "blocked name");
|
this.safeDeleteDirectory(directory, "blocked name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import org.qortal.repository.Repository;
|
|||||||
import org.qortal.repository.RepositoryManager;
|
import org.qortal.repository.RepositoryManager;
|
||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.utils.Base58;
|
import org.qortal.utils.Base58;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
import org.qortal.utils.Triple;
|
import org.qortal.utils.Triple;
|
||||||
|
|
||||||
@ -503,7 +504,7 @@ public class ArbitraryDataFileListManager {
|
|||||||
|
|
||||||
// Forwarding
|
// Forwarding
|
||||||
if (isRelayRequest && Settings.getInstance().isRelayModeEnabled()) {
|
if (isRelayRequest && Settings.getInstance().isRelayModeEnabled()) {
|
||||||
boolean isBlocked = (arbitraryTransactionData == null || ArbitraryDataStorageManager.getInstance().isNameBlocked(arbitraryTransactionData.getName()));
|
boolean isBlocked = (arbitraryTransactionData == null || ListUtils.isNameBlocked(arbitraryTransactionData.getName()));
|
||||||
if (!isBlocked) {
|
if (!isBlocked) {
|
||||||
Peer requestingPeer = request.getB();
|
Peer requestingPeer = request.getB();
|
||||||
if (requestingPeer != null) {
|
if (requestingPeer != null) {
|
||||||
@ -682,7 +683,7 @@ public class ArbitraryDataFileListManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We may need to forward this request on
|
// We may need to forward this request on
|
||||||
boolean isBlocked = (transactionData == null || ArbitraryDataStorageManager.getInstance().isNameBlocked(transactionData.getName()));
|
boolean isBlocked = (transactionData == null || ListUtils.isNameBlocked(transactionData.getName()));
|
||||||
if (Settings.getInstance().isRelayModeEnabled() && !isBlocked) {
|
if (Settings.getInstance().isRelayModeEnabled() && !isBlocked) {
|
||||||
// In relay mode - so ask our other peers if they have it
|
// In relay mode - so ask our other peers if they have it
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ import org.qortal.transaction.ArbitraryTransaction;
|
|||||||
import org.qortal.transaction.Transaction.TransactionType;
|
import org.qortal.transaction.Transaction.TransactionType;
|
||||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
import org.qortal.utils.ArbitraryTransactionUtils;
|
||||||
import org.qortal.utils.Base58;
|
import org.qortal.utils.Base58;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
|
|
||||||
public class ArbitraryDataManager extends Thread {
|
public class ArbitraryDataManager extends Thread {
|
||||||
@ -172,7 +173,7 @@ public class ArbitraryDataManager extends Thread {
|
|||||||
|
|
||||||
private void processNames() throws InterruptedException {
|
private void processNames() throws InterruptedException {
|
||||||
// Fetch latest list of followed names
|
// Fetch latest list of followed names
|
||||||
List<String> followedNames = ResourceListManager.getInstance().getStringsInList("followedNames");
|
List<String> followedNames = ListUtils.followedNames();
|
||||||
if (followedNames == null || followedNames.isEmpty()) {
|
if (followedNames == null || followedNames.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,11 @@ import org.apache.logging.log4j.LogManager;
|
|||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.qortal.data.transaction.ArbitraryTransactionData;
|
import org.qortal.data.transaction.ArbitraryTransactionData;
|
||||||
import org.qortal.data.transaction.TransactionData;
|
import org.qortal.data.transaction.TransactionData;
|
||||||
import org.qortal.list.ResourceListManager;
|
|
||||||
import org.qortal.repository.DataException;
|
import org.qortal.repository.DataException;
|
||||||
import org.qortal.repository.Repository;
|
import org.qortal.repository.Repository;
|
||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.transaction.Transaction;
|
import org.qortal.transaction.Transaction;
|
||||||
import org.qortal.utils.ArbitraryTransactionUtils;
|
import org.qortal.utils.*;
|
||||||
import org.qortal.utils.Base58;
|
|
||||||
import org.qortal.utils.FilesystemUtils;
|
|
||||||
import org.qortal.utils.NTP;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UncheckedIOException;
|
import java.io.UncheckedIOException;
|
||||||
@ -135,11 +131,11 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
case ALL:
|
case ALL:
|
||||||
case VIEWED:
|
case VIEWED:
|
||||||
// If the policy includes viewed data, we can host it as long as it's not blocked
|
// If the policy includes viewed data, we can host it as long as it's not blocked
|
||||||
return !this.isNameBlocked(name);
|
return !ListUtils.isNameBlocked(name);
|
||||||
|
|
||||||
case FOLLOWED:
|
case FOLLOWED:
|
||||||
// If the policy is for followed data only, we have to be following it
|
// If the policy is for followed data only, we have to be following it
|
||||||
return this.isFollowingName(name);
|
return ListUtils.isFollowingName(name);
|
||||||
|
|
||||||
// For NONE or all else, we shouldn't host this data
|
// For NONE or all else, we shouldn't host this data
|
||||||
case NONE:
|
case NONE:
|
||||||
@ -188,14 +184,14 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Never fetch data from blocked names, even if they are followed
|
// Never fetch data from blocked names, even if they are followed
|
||||||
if (this.isNameBlocked(name)) {
|
if (ListUtils.isNameBlocked(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Settings.getInstance().getStoragePolicy()) {
|
switch (Settings.getInstance().getStoragePolicy()) {
|
||||||
case FOLLOWED:
|
case FOLLOWED:
|
||||||
case FOLLOWED_OR_VIEWED:
|
case FOLLOWED_OR_VIEWED:
|
||||||
return this.isFollowingName(name);
|
return ListUtils.isFollowingName(name);
|
||||||
|
|
||||||
case ALL:
|
case ALL:
|
||||||
return true;
|
return true;
|
||||||
@ -235,7 +231,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
* @return boolean - whether the resource is blocked or not
|
* @return boolean - whether the resource is blocked or not
|
||||||
*/
|
*/
|
||||||
public boolean isBlocked(ArbitraryTransactionData arbitraryTransactionData) {
|
public boolean isBlocked(ArbitraryTransactionData arbitraryTransactionData) {
|
||||||
return isNameBlocked(arbitraryTransactionData.getName());
|
return ListUtils.isNameBlocked(arbitraryTransactionData.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDataTypeAllowed(ArbitraryTransactionData arbitraryTransactionData) {
|
private boolean isDataTypeAllowed(ArbitraryTransactionData arbitraryTransactionData) {
|
||||||
@ -253,22 +249,6 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNameBlocked(String name) {
|
|
||||||
return ResourceListManager.getInstance().listContains("blockedNames", name, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isFollowingName(String name) {
|
|
||||||
return ResourceListManager.getInstance().listContains("followedNames", name, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> followedNames() {
|
|
||||||
return ResourceListManager.getInstance().getStringsInList("followedNames");
|
|
||||||
}
|
|
||||||
|
|
||||||
private int followedNamesCount() {
|
|
||||||
return ResourceListManager.getInstance().getItemCountForList("followedNames");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<ArbitraryTransactionData> loadAllHostedTransactions(Repository repository) {
|
public List<ArbitraryTransactionData> loadAllHostedTransactions(Repository repository) {
|
||||||
|
|
||||||
@ -513,7 +493,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int followedNamesCount = this.followedNamesCount();
|
int followedNamesCount = ListUtils.followedNamesCount();
|
||||||
if (followedNamesCount == 0) {
|
if (followedNamesCount == 0) {
|
||||||
// Not following any names, so we have space
|
// Not following any names, so we have space
|
||||||
return true;
|
return true;
|
||||||
@ -543,7 +523,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long storageCapacityPerName(double threshold) {
|
public long storageCapacityPerName(double threshold) {
|
||||||
int followedNamesCount = this.followedNamesCount();
|
int followedNamesCount = ListUtils.followedNamesCount();
|
||||||
if (followedNamesCount == 0) {
|
if (followedNamesCount == 0) {
|
||||||
// Not following any names, so we have the total space available
|
// Not following any names, so we have the total space available
|
||||||
return this.getStorageCapacityIncludingThreshold(threshold);
|
return this.getStorageCapacityIncludingThreshold(threshold);
|
||||||
|
@ -16,6 +16,7 @@ import org.qortal.repository.Repository;
|
|||||||
import org.qortal.repository.RepositoryManager;
|
import org.qortal.repository.RepositoryManager;
|
||||||
import org.qortal.settings.Settings;
|
import org.qortal.settings.Settings;
|
||||||
import org.qortal.utils.Base58;
|
import org.qortal.utils.Base58;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
import org.qortal.utils.Triple;
|
import org.qortal.utils.Triple;
|
||||||
|
|
||||||
@ -332,7 +333,7 @@ public class ArbitraryMetadataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if the name is blocked
|
// Check if the name is blocked
|
||||||
boolean isBlocked = (arbitraryTransactionData == null || ArbitraryDataStorageManager.getInstance().isNameBlocked(arbitraryTransactionData.getName()));
|
boolean isBlocked = (arbitraryTransactionData == null || ListUtils.isNameBlocked(arbitraryTransactionData.getName()));
|
||||||
if (!isBlocked) {
|
if (!isBlocked) {
|
||||||
Peer requestingPeer = request.getB();
|
Peer requestingPeer = request.getB();
|
||||||
if (requestingPeer != null) {
|
if (requestingPeer != null) {
|
||||||
@ -420,7 +421,7 @@ public class ArbitraryMetadataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We may need to forward this request on
|
// We may need to forward this request on
|
||||||
boolean isBlocked = (transactionData == null || ArbitraryDataStorageManager.getInstance().isNameBlocked(transactionData.getName()));
|
boolean isBlocked = (transactionData == null || ListUtils.isNameBlocked(transactionData.getName()));
|
||||||
if (Settings.getInstance().isRelayModeEnabled() && !isBlocked) {
|
if (Settings.getInstance().isRelayModeEnabled() && !isBlocked) {
|
||||||
// In relay mode - so ask our other peers if they have it
|
// In relay mode - so ask our other peers if they have it
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import java.util.function.Predicate;
|
|||||||
import org.qortal.account.Account;
|
import org.qortal.account.Account;
|
||||||
import org.qortal.account.PublicKeyAccount;
|
import org.qortal.account.PublicKeyAccount;
|
||||||
import org.qortal.asset.Asset;
|
import org.qortal.asset.Asset;
|
||||||
|
import org.qortal.controller.arbitrary.ArbitraryDataStorageManager;
|
||||||
import org.qortal.crypto.Crypto;
|
import org.qortal.crypto.Crypto;
|
||||||
import org.qortal.crypto.MemoryPoW;
|
import org.qortal.crypto.MemoryPoW;
|
||||||
import org.qortal.data.naming.NameData;
|
import org.qortal.data.naming.NameData;
|
||||||
@ -22,6 +23,7 @@ import org.qortal.settings.Settings;
|
|||||||
import org.qortal.transform.TransformationException;
|
import org.qortal.transform.TransformationException;
|
||||||
import org.qortal.transform.transaction.ChatTransactionTransformer;
|
import org.qortal.transform.transaction.ChatTransactionTransformer;
|
||||||
import org.qortal.transform.transaction.TransactionTransformer;
|
import org.qortal.transform.transaction.TransactionTransformer;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
|
|
||||||
public class ChatTransaction extends Transaction {
|
public class ChatTransaction extends Transaction {
|
||||||
@ -156,8 +158,7 @@ public class ChatTransaction extends Transaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for blocked author by address
|
// Check for blocked author by address
|
||||||
ResourceListManager listManager = ResourceListManager.getInstance();
|
if (ListUtils.isAddressBlocked(this.chatTransactionData.getSender())) {
|
||||||
if (listManager.listContains("blockedAddresses", this.chatTransactionData.getSender(), true)) {
|
|
||||||
return ValidationResult.ADDRESS_BLOCKED;
|
return ValidationResult.ADDRESS_BLOCKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +167,7 @@ public class ChatTransaction extends Transaction {
|
|||||||
if (names != null && names.size() > 0) {
|
if (names != null && names.size() > 0) {
|
||||||
for (NameData nameData : names) {
|
for (NameData nameData : names) {
|
||||||
if (nameData != null && nameData.getName() != null) {
|
if (nameData != null && nameData.getName() != null) {
|
||||||
if (listManager.listContains("blockedNames", nameData.getName(), false)) {
|
if (ListUtils.isNameBlocked(nameData.getName())) {
|
||||||
return ValidationResult.NAME_BLOCKED;
|
return ValidationResult.NAME_BLOCKED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
src/main/java/org/qortal/utils/ListUtils.java
Normal file
38
src/main/java/org/qortal/utils/ListUtils.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package org.qortal.utils;
|
||||||
|
|
||||||
|
import org.qortal.list.ResourceListManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ListUtils {
|
||||||
|
|
||||||
|
/* Blocking */
|
||||||
|
|
||||||
|
public static List<String> blockedNames() {
|
||||||
|
return ResourceListManager.getInstance().getStringsInList("blockedNames");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNameBlocked(String name) {
|
||||||
|
return ResourceListManager.getInstance().listContains("blockedNames", name, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isAddressBlocked(String address) {
|
||||||
|
return ResourceListManager.getInstance().listContains("blockedAddresses", address, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Following */
|
||||||
|
|
||||||
|
public static List<String> followedNames() {
|
||||||
|
return ResourceListManager.getInstance().getStringsInList("followedNames");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isFollowingName(String name) {
|
||||||
|
return ResourceListManager.getInstance().listContains("followedNames", name, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int followedNamesCount() {
|
||||||
|
return ListUtils.followedNames().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -24,6 +24,7 @@ import org.qortal.test.common.TransactionUtils;
|
|||||||
import org.qortal.test.common.transaction.TestTransaction;
|
import org.qortal.test.common.transaction.TestTransaction;
|
||||||
import org.qortal.transaction.RegisterNameTransaction;
|
import org.qortal.transaction.RegisterNameTransaction;
|
||||||
import org.qortal.utils.Base58;
|
import org.qortal.utils.Base58;
|
||||||
|
import org.qortal.utils.ListUtils;
|
||||||
import org.qortal.utils.NTP;
|
import org.qortal.utils.NTP;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -103,6 +104,7 @@ public class ArbitraryDataStorageCapacityTests extends Common {
|
|||||||
|
|
||||||
// Storage capacity should initially equal the total
|
// Storage capacity should initially equal the total
|
||||||
assertEquals(0, resourceListManager.getItemCountForList("followedNames"));
|
assertEquals(0, resourceListManager.getItemCountForList("followedNames"));
|
||||||
|
assertEquals(0, ListUtils.followedNamesCount());
|
||||||
long totalStorageCapacity = storageManager.getStorageCapacityIncludingThreshold(storageFullThreshold);
|
long totalStorageCapacity = storageManager.getStorageCapacityIncludingThreshold(storageFullThreshold);
|
||||||
assertEquals(totalStorageCapacity, storageManager.storageCapacityPerName(storageFullThreshold));
|
assertEquals(totalStorageCapacity, storageManager.storageCapacityPerName(storageFullThreshold));
|
||||||
|
|
||||||
@ -114,6 +116,7 @@ public class ArbitraryDataStorageCapacityTests extends Common {
|
|||||||
|
|
||||||
// Ensure the followed name count is correct
|
// Ensure the followed name count is correct
|
||||||
assertEquals(4, resourceListManager.getItemCountForList("followedNames"));
|
assertEquals(4, resourceListManager.getItemCountForList("followedNames"));
|
||||||
|
assertEquals(4, ListUtils.followedNamesCount());
|
||||||
|
|
||||||
// Storage space per name should be the total storage capacity divided by the number of names
|
// Storage space per name should be the total storage capacity divided by the number of names
|
||||||
long expectedStorageCapacityPerName = (long)(totalStorageCapacity / 4.0f);
|
long expectedStorageCapacityPerName = (long)(totalStorageCapacity / 4.0f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user