diff --git a/admin/admin-api/src/main/java/org/marketcetera/admin/AdminClient.java b/admin/admin-api/src/main/java/org/marketcetera/admin/AdminClient.java
index d2690d7501..66bd111f1c 100644
--- a/admin/admin-api/src/main/java/org/marketcetera/admin/AdminClient.java
+++ b/admin/admin-api/src/main/java/org/marketcetera/admin/AdminClient.java
@@ -107,6 +107,7 @@ void updateFixSession(String inIncomingName,
*
* @param inNewUser a User value
* @param inPassword a String value
+ * @return a User value
*/
User createUser(User inNewUser,
String inPassword);
diff --git a/client/src/test/java/org/marketcetera/client/ClientTest.java b/client/src/test/java/org/marketcetera/client/ClientTest.java
index 8ea0eb52e5..3e5b789f1d 100644
--- a/client/src/test/java/org/marketcetera/client/ClientTest.java
+++ b/client/src/test/java/org/marketcetera/client/ClientTest.java
@@ -8,7 +8,6 @@
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.marketcetera.trade.TypesTestBase.assertCancelRejectEquals;
import static org.marketcetera.trade.TypesTestBase.assertExecReportEquals;
@@ -31,6 +30,7 @@
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicLong;
+import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.AfterClass;
@@ -437,7 +437,7 @@ protected void run() throws Exception {
Map, BigDecimal> positions = getClient().
getOptionPositionsAsOf(date, "XYZ", "PQR");
assertEquals(2, positions.size());
- assertThat(positions, allOf(hasEntry(
+ MatcherAssert.assertThat(positions, allOf(hasEntry(
PositionKeyFactory.createOptionKey("XYZ",
option.getExpiry(), option.getStrikePrice(),
option.getType(), "acc", "tra"),
@@ -452,7 +452,7 @@ protected void run() throws Exception {
//getAllOptionPositionsAsOf()
positions = getClient().getAllOptionPositionsAsOf(date);
assertEquals(1, positions.size());
- assertThat(positions, Matchers.hasEntry(
+ MatcherAssert.assertThat(positions, Matchers.hasEntry(
PositionKeyFactory.createOptionKey("OPT",
option.getExpiry(), option.getStrikePrice(),
option.getType(), "acc", "tra"),
@@ -486,7 +486,7 @@ protected void run() throws Exception {
roots = getClient().getOptionRoots(symbol);
assertEquals(symbol.length(), roots.size());
- assertThat(roots, Matchers.hasItem(symbol));
+ MatcherAssert.assertThat(roots, Matchers.hasItem(symbol));
//verify caching
sServer.getServiceImpl().resetServiceInvoked();
assertSame(roots, getClient().getOptionRoots(symbol));
@@ -1104,7 +1104,7 @@ protected void run() throws Exception {
}
/**
- * Verifies the interplay between client initialization, reconnect & close.
+ * Verifies the interplay between client initialization, reconnect & close.
*
* @throws Exception if there were errors
*/
diff --git a/client/src/test/java/org/marketcetera/client/MockClient.java b/client/src/test/java/org/marketcetera/client/MockClient.java
index bb1470a297..3c8f2efa9f 100644
--- a/client/src/test/java/org/marketcetera/client/MockClient.java
+++ b/client/src/test/java/org/marketcetera/client/MockClient.java
@@ -536,7 +536,7 @@ public void setSendOrderSingleException(ConnectionException inException)
/**
* Sets the sendOrderReplaceConnectionException value.
*
- * @param a ConnectionException value
+ * @param inSendOrderReplaceConnectionException a ConnectionException value
*/
public void setSendOrderReplaceConnectionException(ConnectionException inSendOrderReplaceConnectionException)
{
@@ -545,7 +545,7 @@ public void setSendOrderReplaceConnectionException(ConnectionException inSendOrd
/**
* Sets the sendOrderCancelConnectionException value.
*
- * @param a ConnectionException value
+ * @param inSendOrderCancelConnectionException a ConnectionException value
*/
public void setSendOrderCancelConnectionException(ConnectionException inSendOrderCancelConnectionException)
{
@@ -554,7 +554,7 @@ public void setSendOrderCancelConnectionException(ConnectionException inSendOrde
/**
* Sets the sendOrderSingleValidationException value.
*
- * @param an OrderValidationException value
+ * @param inSendOrderSingleValidationException an OrderValidationException value
*/
public void setSendOrderSingleValidationException(OrderValidationException inSendOrderSingleValidationException)
{
@@ -563,7 +563,7 @@ public void setSendOrderSingleValidationException(OrderValidationException inSen
/**
* Sets the sendOrderReplaceValidationException value.
*
- * @param an OrderValidationException value
+ * @param inSendOrderReplaceValidationException an OrderValidationException value
*/
public void setSendOrderReplaceValidationException(OrderValidationException inSendOrderReplaceValidationException)
{
@@ -572,7 +572,7 @@ public void setSendOrderReplaceValidationException(OrderValidationException inSe
/**
* Sets the sendOrderCancelValidationException value.
*
- * @param an OrderValidationException value
+ * @param inSendOrderCancelValidationException an OrderValidationException value
*/
public void setSendOrderCancelValidationException(OrderValidationException inSendOrderCancelValidationException)
{
diff --git a/client/src/test/java/org/marketcetera/client/MockServer.java b/client/src/test/java/org/marketcetera/client/MockServer.java
index d10c8d3c90..c858b8718c 100644
--- a/client/src/test/java/org/marketcetera/client/MockServer.java
+++ b/client/src/test/java/org/marketcetera/client/MockServer.java
@@ -237,7 +237,7 @@ message, new BrokerID("default"),
/**
* The URL for the broker hosted by this server.
- * Do note that this URL is changed, the mock_server.xml & broker.xml
+ * Do note that this URL is changed, the mock_server.xml & broker.xml
* files need to be updated as well.
*/
public static final String URL = "tcp://localhost:61616";
diff --git a/cluster/cluster-api/src/main/java/org/marketcetera/cluster/service/ClusterService.java b/cluster/cluster-api/src/main/java/org/marketcetera/cluster/service/ClusterService.java
index 23dc7908f3..500d598a8b 100644
--- a/cluster/cluster-api/src/main/java/org/marketcetera/cluster/service/ClusterService.java
+++ b/cluster/cluster-api/src/main/java/org/marketcetera/cluster/service/ClusterService.java
@@ -25,6 +25,7 @@ public interface ClusterService
/**
* Adds the given object to the given cluster queue.
*
+ * @param the type of object
* @param inQueueDescriptor a QueueDescriptor<Class> value
* @param inObject a Clazz value
*/
@@ -33,6 +34,7 @@ void addToQueue(QueueDescriptor inQueueDescr
/**
* Peeks the top value in the given queue.
*
+ * @param the type of object held by the queue
* @param inQueueDescriptor a QueueDescriptor<Class> value
* @return a Clazz value or null
*/
@@ -42,6 +44,8 @@ void addToQueue(QueueDescriptor inQueueDescr
*
*
This call will block until a value becomes available.
*
+ * @param the type of object held by the queue
+ * @param inQueueDescriptor a QueueDescriptor<Class> value
* @return a QueueDescriptor<Class> value
* @throws InterruptedException if this call is interrupted
*/
@@ -56,6 +60,7 @@ Clazz takeFromQueue(QueueDescriptor inQueueD
/**
* Asynchronously executes the given task on members of the cluster as determined by the task.
*
+ * @param the type of object returned by the task
* @param inTask a CallableClusterTask<Clazz> value
* @return an Map<Object,Future<Clazz> value containing the result tokens by cluster member
* @throws Exception if an error occurs executing the task
diff --git a/cluster/cluster-core/src/main/java/org/marketcetera/cluster/service/AbstractClusterService.java b/cluster/cluster-core/src/main/java/org/marketcetera/cluster/service/AbstractClusterService.java
index ba110c67e9..6716816f54 100644
--- a/cluster/cluster-core/src/main/java/org/marketcetera/cluster/service/AbstractClusterService.java
+++ b/cluster/cluster-core/src/main/java/org/marketcetera/cluster/service/AbstractClusterService.java
@@ -547,10 +547,10 @@ protected ClusterWorkUnitDescriptor generateWorkUnitDescriptor(ClusterWorkUnitSp
* Returns a candidate that suits the given work unit spec if one exists.
*
* @param inWorkUnitSpec a ClusterWorkUnitSpec value
- * @return an Object value
- * @throws InvocationTargetException
- * @throws IllegalArgumentException
- * @throws IllegalAccessException
+ * @return an Object value or null
+ * @throws InvocationTargetException if the candidate cannot be instantiated
+ * @throws IllegalArgumentException if an error occurs finding the candidate
+ * @throws IllegalAccessException if the candidate cannot be instatiated
*/
protected Object findCandidateFor(ClusterWorkUnitSpec inWorkUnitSpec)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
@@ -590,10 +590,10 @@ protected void activateWorkUnit(Object inCandidate)
* Finds a candidate bean for the given work unit spec and activates it.
*
* @param inWorkUnitSpec a ClusterWorkUnitSpec value
- * @return an Objectvalue
- * @throws InvocationTargetException
- * @throws IllegalArgumentException
- * @throws IllegalAccessException
+ * @return an Objectvalue or null
+ * @throws InvocationTargetException if the work unit cannot be activated
+ * @throws IllegalArgumentException if an error occurs finding the work unit
+ * @throws IllegalAccessException if the work unit cannot be activated
*/
protected Object findAndActivateWorkUnit(ClusterWorkUnitSpec inWorkUnitSpec)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
@@ -723,6 +723,8 @@ protected Map findAllBeansWith(Class extends Annotation> inAnno
/**
* Gets the annotation of the given type from the given argument.
*
+ * @param the class of the given object
+ * @param the type of the given annotation
* @param inInstance an Object value
* @param inAnnotation a Class<AnnotationClazz> value
* @return an AnnotationClazz value
@@ -859,6 +861,7 @@ protected void logClusterMetaData()
/**
* Marshals the given value as XML.
*
+ * @param the type of the provided data
* @param inData a Clazz value
* @return a String value
* @throws JAXBException if the given object cannot be marshaled
diff --git a/core/src/main/java/org/marketcetera/core/ApplicationBase.java b/core/src/main/java/org/marketcetera/core/ApplicationBase.java
index a5dd8af7d7..d2ccda03ac 100644
--- a/core/src/main/java/org/marketcetera/core/ApplicationBase.java
+++ b/core/src/main/java/org/marketcetera/core/ApplicationBase.java
@@ -132,8 +132,11 @@ public void stopWaitingForever()
public boolean isWaitingForever() {
return waitingForever;
}
-
- /** Get the FIX version associated with this application */
+ /**
+ * Get the FIX version associated with this application.
+ *
+ * @return a FIXVersion value
+ */
public FIXVersion getFIXVersion()
{
return fixVersion;
@@ -153,8 +156,11 @@ public long getApproximateTime() {
// TODO: make this read a variable that is updated periodically by a thread
return System.currentTimeMillis(); //i18n_datetime
}
-
- /** Returns a pointer to the Spring application context that started this app */
+ /**
+ * Returns a pointer to the Spring application context that started this app.
+ *
+ * @return a ClassPathXmlApplicationContext value
+ */
public ClassPathXmlApplicationContext getAppCtx() {
return appCtx;
}
diff --git a/core/src/main/java/org/marketcetera/core/BigDecimalUtil.java b/core/src/main/java/org/marketcetera/core/BigDecimalUtil.java
index af3522c435..3b57eeaf01 100644
--- a/core/src/main/java/org/marketcetera/core/BigDecimalUtil.java
+++ b/core/src/main/java/org/marketcetera/core/BigDecimalUtil.java
@@ -40,22 +40,32 @@
*
*/
public final class BigDecimalUtil {
+ /**
+ * constant used to round float values up
+ */
private static final double ROUNDING_UP_FLOAT = 0.5d;
+ /**
+ * maximum scale value for inverting
+ */
private static final int MAX_SCALE_FOR_INVERSE = 20;
+ /**
+ * number format instance
+ */
private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance();
-
+ /**
+ * Create a new BigDecimalUtil instance.
+ */
private BigDecimalUtil() {
}
-
/**
* Convenience method to create a BigDecimal with a String, can be statically imported.
+ *
* @param val a string representing the BigDecimal
* @return the new BigDecimal
*/
public static BigDecimal bd(final String val) {
return new BigDecimal(val);
}
-
/**
* Return the inverse of value if not null or zero, using scale.
* @param value the nullable BigDecimal
@@ -68,7 +78,6 @@ public static BigDecimal inverse(final BigDecimal value, final int scale) {
}
return null;
}
-
/**
* Return the inverse of value if no tnull of zero
* @param value the nullable BigDecimal
@@ -80,48 +89,54 @@ public static BigDecimal inverse(final BigDecimal value) {
}
return null;
}
-
/**
- * @param value the nullable BigDecimal
- * @return true if value !=null and <gt; 0.
+ * Indicate if the given value is not zero.
+ *
+ * @param value the nullable BigDecimal
+ * @return true if value !=null and <gt; 0.
*/
public static boolean isNotZero(final BigDecimal value) {
return value != null && value.signum() != 0;
}
-
/**
+ * Indicate if the given value is zero.
+ *
* @param value the nullable BigDecimal
* @return true if value !=null and 0.
*/
public static boolean isZero(final BigDecimal value) {
return value != null && value.signum() == 0;
}
-
/**
- * @param value the nullable BigDecimal
- * @return true if value !=null and < 0.
+ * Indicate if the given value is negative.
+ *
+ * @param value the nullable BigDecimal
+ * @return true if value !=null and < 0.
*/
public static boolean isNegative(final BigDecimal value) {
return value != null && value.signum() == -1;
}
-
/**
- * @param value the nullable BigDecimal
- * @return true if value !=null and >0.
+ * Indicate if the given value is strictly positive.
+ *
+ * @param value the nullable BigDecimal
+ * @return true if value !=null and >0.
*/
public static boolean isStrictlyPositive(final BigDecimal value) {
return value != null && value.signum() == 1;
}
-
/**
- * @param value the nullable BigDecimal
- * @return true if value ==null OR 0.
+ * Indicate if the given value is null or zero.
+ *
+ * @param value the nullable BigDecimal
+ * @return true if value == null OR 0.
*/
public static boolean isNullOrZero(final BigDecimal value) {
return value == null || value.signum() == 0;
}
-
/**
+ * Indicate the two given values are the same value.
+ *
* @param val1 the nullable BigDecimal
* @param val2 the nullable BigDecimal
* @return true if val1 == val2 (ignoring scale and null are treated as 0)
@@ -129,8 +144,9 @@ public static boolean isNullOrZero(final BigDecimal value) {
public static boolean isSameValue(final BigDecimal val1, final BigDecimal val2) {
return val1 == null && val2 == null || val1 != null && val2 != null && val1.compareTo(val2) == 0;
}
-
/**
+ * Indicate if the two values are the same value, treating null values as zero.
+ *
* @param val1 the nullable BigDecimal
* @param val2 the nullable BigDecimal
* @return true if val1 == val2 (ignoring scale and null are treated as 0)
@@ -138,9 +154,9 @@ public static boolean isSameValue(final BigDecimal val1, final BigDecimal val2)
public static boolean isSameValueTreatNullAsZero(final BigDecimal val1, final BigDecimal val2) {
return val1 == null && val2 == null || signum(val1) == 0 && signum(val2) == 0 || val1 != null && val2 != null && val1.compareTo(val2) == 0;
}
-
/**
- * Add 2 BigDecimal safely (i.e. handles nulls as zeros)
+ * Add 2 BigDecimal safely (i.e. handles nulls as zeros).
+ *
* @param v1 the nullable BigDecimal
* @param v2 the nullable BigDecimal
* @return the sum of the 2 BigDecimal
@@ -154,9 +170,9 @@ private static BigDecimal doAdd(final BigDecimal v1, final BigDecimal v2) {
}
return total;
}
-
/**
- * Add n BigDecimal safely (i.e. handles nulls)
+ * Add n BigDecimal safely (i.e. handles nulls).
+ *
* @param start initial BigDecimal
* @param values series of BigDecimals can be null/empty
* @return the sum of the n non null BigDecimals
@@ -170,9 +186,9 @@ public static BigDecimal add(final BigDecimal start, final BigDecimal... values)
}
return total;
}
-
/**
* Subtract n BigDecimal safely from the start value (i.e. handles nulls as zeros), returns 0
+ *
* @param start starting point, if null, use 0
* @param values series of BigDecimal to subtract from start, can be null / empty
* @return start - the series of values
@@ -186,9 +202,12 @@ public static BigDecimal subtract(final BigDecimal start, final BigDecimal... va
}
return total;
}
-
/**
- * Subtract 2 BigDecimal safely (i.e. handles nulls) v1 - v2
+ * Subtract 2 BigDecimal safely (i.e. handles nulls) v1 - v2.
+ *
+ * @param v1 a BigDecimal value or null
+ * @param v2 a BigDecimal value or null
+ * @return a BigDecimal value
*/
private static BigDecimal doSubtract(final BigDecimal v1, final BigDecimal v2) {
BigDecimal diff = v1;
@@ -199,8 +218,12 @@ private static BigDecimal doSubtract(final BigDecimal v1, final BigDecimal v2) {
}
return diff;
}
-
/**
+ * Divide the given numerator by the given denominator with the given rounding mode.
+ *
+ * @param numerator a BigDecimal value
+ * @param denominator a BigDecimal value
+ * @param rounding an int value
* @return numerator / denominator if they are not null and the denominator is not zero, it returns null otherwise.
*/
public static BigDecimal divide(final BigDecimal numerator, final BigDecimal denominator, final int rounding) {
@@ -210,13 +233,24 @@ public static BigDecimal divide(final BigDecimal numerator, final BigDecimal den
}
return diff;
}
-
+ /**
+ * Calculate the weighted average value from the given value and total.
+ *
+ * @param value a BigDecimal value
+ * @param total a BigDecimal value
+ * @return a BigDecimal value
+ */
public static BigDecimal calculateWeight(final BigDecimal value, final BigDecimal total) {
return BigDecimalUtil.setScale(
BigDecimalUtil.divide(BigDecimalUtil.setScale(value, 9), BigDecimalUtil.setScale(total, 9), BigDecimal.ROUND_HALF_UP), 9);
}
-
/**
+ * Divide the given numerator by the given denominator with the given numerator scale and rounding modes.
+ *
+ * @param numeratorScale an int value
+ * @param numerator a BigDecimal value
+ * @param denominator a BigDecimal value
+ * @param rounding an int value
* @return numerator / denominator if they are not null and the denominator is not zero, it returns null otherwise.
*/
public static BigDecimal divide(final int numeratorScale, final BigDecimal numerator, final BigDecimal denominator, final int rounding) {
@@ -226,8 +260,13 @@ public static BigDecimal divide(final int numeratorScale, final BigDecimal numer
}
return diff;
}
-
/**
+ * Divide the given numerator by the given denominator using the given scale for the result and the given rounding mode.
+ *
+ * @param numerator a BigDecimal value
+ * @param denominator a BigDecimal value
+ * @param scale an int value
+ * @param rounding an int value
* @return numerator / denominator if they are not null and the denominator is not zero, it returns null otherwise.
*/
public static BigDecimal divide(final BigDecimal numerator, final BigDecimal denominator, final int scale, final int rounding) {
@@ -237,7 +276,13 @@ public static BigDecimal divide(final BigDecimal numerator, final BigDecimal den
}
return BigDecimalUtil.setScale(diff, scale, rounding);
}
-
+ /**
+ * Multiply the given values, returning null if either input value is null.
+ *
+ * @param value a BigDecimal value or null
+ * @param multiplicand a BigDecimal value or null
+ * @return a BigDecimal value or null
+ */
public static BigDecimal multiply(final BigDecimal value, final BigDecimal multiplicand) {
BigDecimal diff = null;
if (value != null && multiplicand != null) {
@@ -245,7 +290,13 @@ public static BigDecimal multiply(final BigDecimal value, final BigDecimal multi
}
return diff;
}
-
+ /**
+ * Multiply the given value by all the additional values.
+ *
+ * @param value a BigDecimal value
+ * @param multiplicand a BigDecimal[] value
+ * @return a BigDecimal value
+ */
public static BigDecimal multiply(final BigDecimal value, final BigDecimal... multiplicand) {
BigDecimal diff = null;
if (value != null && multiplicand != null) {
@@ -258,7 +309,6 @@ public static BigDecimal multiply(final BigDecimal value, final BigDecimal... mu
}
return diff;
}
-
/**
* Returns the ABS of the value, handles null.
* @param value nullable BigDecimal
@@ -267,7 +317,6 @@ public static BigDecimal multiply(final BigDecimal value, final BigDecimal... mu
public static BigDecimal abs(final BigDecimal value) {
return value != null ? value.abs() : null;
}
-
/**
* Returns the negate of the value, handles null.
* @param value nullable BigDecimal
@@ -318,9 +367,13 @@ public static boolean isSameAbsValue(final BigDecimal v1, final BigDecimal v2) {
}
/**
+ * Compare two values.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return 1 if v1 > v2 or v2==null and v2!=null
- * @return 0 if v1 == v2 or v1==null and v2==null
- * @return -1 if v1 < v2 or v1==null and v2!=null
+ * 0 if v1 == v2 or v1==null and v2==null
+ * -1 if v1 < v2 or v1==null and v2!=null
*/
public static int compareTo(final BigDecimal v1, final BigDecimal v2) {
int ret = 1;
@@ -333,28 +386,36 @@ public static int compareTo(final BigDecimal v1, final BigDecimal v2) {
}
return ret;
}
-
/**
+ * Compare the absolute values of two values.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return true if the ABS(v1) > ABS(v2)
*/
public static int absCompareTo(final BigDecimal v1, final BigDecimal v2) {
return compareTo(abs(v1), abs(v2));
}
-
/**
+ * Calculate the absolute difference between two values.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return true if the ABS( ABS(v1) - ABS(v2) )
*/
public static BigDecimal absDiff(final BigDecimal v1, final BigDecimal v2) {
return abs(doSubtract(abs(v1), abs(v2)));
}
-
/**
* Safe shift (check for null), shift RIGHT if shift>0.
+ *
+ * @param v1 a BigDecimal value
+ * @param shift an int value
+ * @return a BigDecimal value
*/
public static BigDecimal movePoint(final BigDecimal v1, final int shift) {
return v1 == null ? null : v1.movePointRight(shift);
}
-
/**
* returns a new BigDecimal with correct scale after being round to n dec places.
*
@@ -366,32 +427,33 @@ public static BigDecimal movePoint(final BigDecimal v1, final int shift) {
public static BigDecimal roundTo(final BigDecimal bd, final int numberOfDecPlaces, final int finalScale) {
return setScale(setScale(bd, numberOfDecPlaces, BigDecimal.ROUND_HALF_UP), finalScale);
}
-
/**
* returns a new BigDecimal with correct scale.
*
- * @param bd
+ * @param bd a BigDecimal value
+ * @param scale an int value
* @return new bd or null
*/
public static BigDecimal setScale(final BigDecimal bd, final int scale) {
return setScale(bd, scale, BigDecimal.ROUND_HALF_UP);
}
-
/**
* returns a new BigDecimal with correct Scale.
*
- * @param bd
+ * @param bd a BigDecimal value
+ * @param scale an int value
* @return new bd or null
*/
public static BigDecimal setScale(final BigDecimal bd, final Integer scale) {
return setScale(bd, scale, BigDecimal.ROUND_HALF_UP);
}
-
/**
* returns a new BigDecimal with correct Scales.PERCENT_SCALE. This is used
* by the table renderer.
*
- * @param bd
+ * @param bd a BigDecimal value
+ * @param scale an int value
+ * @param rounding an int value
* @return new bd or null
*/
public static BigDecimal setScale(final BigDecimal bd, final Integer scale, final int rounding) {
@@ -400,24 +462,29 @@ public static BigDecimal setScale(final BigDecimal bd, final Integer scale, fina
}
return null;
}
-
/**
* If value is null return 0 otherwise the signum().
- * @param value
+ * @param value a BigDecimal value
* @return an int value
*/
public static int signum(final BigDecimal value) {
return value == null ? 0 : value.signum();
}
-
/**
+ * Indicate if the two values are the same sign.
+ *
+ * @param v1 a BigDecimal value or null
+ * @param v2 a BigDecimal value or null
* @return true if both v1/v2 are null or same sign.
*/
public static boolean isSameSignum(final BigDecimal v1, final BigDecimal v2) {
return signum(v1) == signum(v2);
}
-
/**
+ * Indicate if the two numbers are of opposite signs and both not zero.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return true if both v1.signum() != v2.signum() and NOT zero.
*/
public static boolean hasSignedFlippedAndNotZero(final BigDecimal v1, final BigDecimal v2) {
@@ -425,48 +492,55 @@ public static boolean hasSignedFlippedAndNotZero(final BigDecimal v1, final BigD
final int v2Sign = signum(v2);
return v1Sign != v2Sign && v1Sign != 0 && v2Sign != 0;
}
-
/**
+ * Indicate if the two numbers are of opposite signs.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return true if v1.signum() != v2.signum().
*/
public static boolean hasSignedChanged(final BigDecimal v1, final BigDecimal v2) {
return signum(v1) != signum(v2);
}
-
/**
- * @param bd
- * @param lowerLimit
- * @param upperLimit
+ * Indicate if the given value is out of the inclusive range established by the given parameters.
+ *
+ * @param bd a BigDecimal value
+ * @param lowerLimit a BigDecimal value
+ * @param upperLimit a BigDecimal value
* @return true if outside the range
*/
public static boolean isOutsideRange(final BigDecimal bd, final BigDecimal lowerLimit, final BigDecimal upperLimit) {
return !isInsideInclusiveRange(bd, lowerLimit, upperLimit);
}
-
/**
- * @param bd
- * @param lowerLimit
- * @param upperLimit
+ * Indicate if the given value is inside of the inclusive range established by the given parameters.
+ *
+ * @param bd a BigDecimal value
+ * @param lowerLimit a BigDecimal value
+ * @param upperLimit a BigDecimal value
* @return true if inside the inclusive range
*/
public static boolean isInsideInclusiveRange(final BigDecimal bd, final BigDecimal lowerLimit, final BigDecimal upperLimit) {
return ObjectUtil.noneNull(bd, lowerLimit, upperLimit) && bd.compareTo(lowerLimit) >= 0 && bd.compareTo(upperLimit) <= 0;
}
-
/**
+ * Return the given value or the fallback value if the given value is null.
+ *
+ * @param o1 a BigDecimal value
+ * @param fallBack a BigDecimal value
* @return o1 if not null, otherwise fallBack
*/
public static BigDecimal assignNonNull(final BigDecimal o1, final BigDecimal fallBack) {
return o1 != null ? o1 : fallBack;
}
-
/**
* Calculate the weight of the constituent and add it to the running weighted value.
* runningWeightedVal + valueToAdd * weightForValueToAdd / totalWeight
- * @param runningWeightedVal
- * @param valueToAdd
- * @param weightForValueToAdd
- * @param totalWeight
+ * @param runningWeightedVal a BigDecimal value
+ * @param valueToAdd a BigDecimal value
+ * @param weightForValueToAdd a BigDecimal value
+ * @param totalWeight a BigDecimal value
* @return a BigDecimal value
*/
public static BigDecimal addWeightedConstituent(final BigDecimal runningWeightedVal, final BigDecimal valueToAdd,
@@ -475,8 +549,10 @@ public static BigDecimal addWeightedConstituent(final BigDecimal runningWeighted
BigDecimalUtil.multiply(valueToAdd, BigDecimalUtil.abs(weightForValueToAdd)), BigDecimalUtil.abs(totalWeight),
BigDecimal.ROUND_HALF_UP));
}
-
/**
+ * Indicate if all the values are null or zero.
+ *
+ * @param values a BigDecimal[] value
* @return true if all values are either null or zero
*/
public static boolean allNullOrZero(final BigDecimal... values) {
@@ -487,39 +563,41 @@ public static boolean allNullOrZero(final BigDecimal... values) {
}
return true;
}
-
/**
- * return a Number formatted or empty string if null.
- * @param bd
+ * Return a number formatted with {@link #NUMBER_FORMAT} or an empty string if null.
+ *
+ * @param bd a BigDecimal value
+ * @return a formatted number or empty string if null.
*/
public static String format(final BigDecimal bd) {
return bd != null ? NUMBER_FORMAT.format(bd) : "";
}
-
/**
- * return a Number formatted or empty string if null.
- * @param bd
+ * Return a number interpreted as a percentage formatted with {@link #NUMBER_FORMAT} or an empty string if null.
+ *
+ * @param bd a BigDecimal value
+ * @return a String value
*/
public static String percentFormat(final BigDecimal bd) {
return bd != null ? NUMBER_FORMAT.format(bd.movePointRight(2)) : "";
}
-
/**
- * true if ABS((startValue-newValue)/startValue) <= abs(thresholdPercent)
- * @param startValue
- * @param newValue
- * @param thresholdPercent
+ * Return true if ABS((startValue-newValue)/startValue) <= abs(thresholdPercent).
+ *
+ * @param startValue a BigDecimal value
+ * @param newValue a BigDecimal value
+ * @param thresholdPercent a BigDecimal value
* @return a boolean value
*/
public static boolean movedInsideThresholdPercentage(final BigDecimal startValue, final BigDecimal newValue, final BigDecimal thresholdPercent) {
return !movedStrictlyOutsideThresholdPercentage(startValue, newValue, thresholdPercent);
}
-
/**
- * true if ABS((startValue-newValue)/startValue) > abs(thresholdPercent)
- * @param startValue
- * @param newValue
- * @param thresholdPercent
+ * Return true if ABS((startValue-newValue)/startValue) > abs(thresholdPercent).
+ *
+ * @param startValue a BigDecimal value
+ * @param newValue a BigDecimal value
+ * @param thresholdPercent a BigDecimal value
* @return a boolean value
*/
public static boolean movedStrictlyOutsideThresholdPercentage(final BigDecimal startValue, final BigDecimal newValue,
@@ -587,7 +665,6 @@ private static double roundDown(final double n, final int p) {
private static short sign(final double d) {
return (short) (d == 0 ? 0 : d < 0 ? -1 : 1);
}
-
/**
* Returns a value rounded-up to p digits after decimal.
* If p is negative, then the number is rounded to
@@ -600,8 +677,8 @@ private static short sign(final double d) {
* by the sign value of n (@see MathX.sign(double d)).
* Thus, -0.2 rounded-up to p=0 will give -1 not 0.
*
If n is NaN, returned value is NaN.
- * @param n
- * @param p
+ * @param n a BigDecimal value
+ * @param p an int value
* @return a BigDecimal value
*/
public static BigDecimal roundUp(final BigDecimal n, final int p) {
@@ -611,7 +688,6 @@ public static BigDecimal roundUp(final BigDecimal n, final int p) {
final int scale = n.scale();
return BigDecimalUtil.setScale(new BigDecimal(roundUp(n.doubleValue(), p)), scale);
}
-
/**
* Returns a value rounded to p digits after decimal.
* If p is negative, then the number is rounded to
@@ -624,8 +700,8 @@ public static BigDecimal roundUp(final BigDecimal n, final int p) {
* by the sign value of n (@see MathX.sign(double d)).
* Thus, -0.8 rounded-down to p=0 will give 0 not -1.
*
If n is NaN, returned value is NaN.
- * @param n
- * @param p
+ * @param n a BigDecimal value
+ * @param p an int value
* @return a BigDecimal value
*/
public static BigDecimal roundDown(final BigDecimal n, final int p) {
@@ -653,29 +729,40 @@ public static BigDecimal roundDownForIncrement(final BigDecimal n, final BigDeci
final int scale = n.scale();
return BigDecimalUtil.setScale(new BigDecimal(roundDown(n.doubleValue(), p)), scale);
}
-
/**
* Return minimum if the value is < minimum.
+ *
+ * @param minimum a BigDecimal value
+ * @param value a BigDecimal value
+ * @return a BigDecimal value
*/
public static BigDecimal ensureMin(final BigDecimal minimum, final BigDecimal value) {
return BigDecimalUtil.compareTo(minimum, value) == 1 ? minimum : value;
}
-
/**
* Return a negative amount based on amount.
+ *
+ * @param amount a BigDecimal value
+ * @return a BigDecimal value
*/
public static BigDecimal forceNegative(final BigDecimal amount) {
return BigDecimalUtil.negate(BigDecimalUtil.abs(amount));
}
-
/**
* Return a negative amount based on amount if true, otherwise return the ABS.
+ *
+ * @param condition a boolean value
+ * @param amount a BigDecimal value
+ * @return a BigDecimal value
*/
public static BigDecimal forceNegativeIfTrue(final boolean condition, final BigDecimal amount) {
return condition ? BigDecimalUtil.negate(BigDecimalUtil.abs(amount)) : BigDecimalUtil.abs(amount);
}
-
/**
+ * Return the minimum of the two values.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
* @return return the min amount
*/
public static BigDecimal min(final BigDecimal v1, final BigDecimal v2) {
@@ -686,8 +773,10 @@ public static BigDecimal min(final BigDecimal v1, final BigDecimal v2) {
}
return v1.compareTo(v2) <= 0 ? v1 : v2;
}
-
/**
+ * Return the maximum of all the given values.
+ *
+ * @param v1 a BigDecimal[] value
* @return return the max amount
*/
public static BigDecimal max(final BigDecimal... v1) {
@@ -700,10 +789,12 @@ public static BigDecimal max(final BigDecimal... v1) {
}
return max;
}
-
/**
* Move by 2 DEC place to the left and take the long value, this
* takes care of values like 0.18 in fractions.
+ *
+ * @param v a BigDecimal value
+ * @return a long value
*/
public static long longForFraction(final BigDecimal v) {
if (v == null) {
@@ -711,8 +802,12 @@ public static long longForFraction(final BigDecimal v) {
}
return BigDecimalUtil.movePoint(v, 2).longValue();
}
-
/**
+ * Indicate if the absolute difference is more than the given threshold.
+ *
+ * @param v1 a BigDecimal value
+ * @param v2 a BigDecimal value
+ * @param threshold a BigDecimal value
* @return true if abs(abs(v1)-abs(v2)) < abs(threshold)
*/
public static boolean isDiffMoreThanAbsThreshold(final BigDecimal v1, final BigDecimal v2, final BigDecimal threshold) {
@@ -723,17 +818,20 @@ public static boolean isDiffMoreThanAbsThreshold(final BigDecimal v1, final BigD
public static double doubleValue(final BigDecimal val) {
return val != null ? val.doubleValue() : 0.0;
}
-
/**
+ * Indicate if the given value is zero or less.
+ *
+ * @param value a BigDecimal value
* @return true if value !=null and <=0.
*/
public static boolean isZeroOrLess(final BigDecimal value) {
return value != null && value.signum() <= 0;
}
-
/**
* Return the decimal part of the value.
- * @param val
+ *
+ * @param val a BigDecimal value
+ * @return a BigDecimal value
*/
public static BigDecimal decimalPart(final BigDecimal val) {
return BigDecimalUtil.subtract(val, val.setScale(0, BigDecimal.ROUND_DOWN));
diff --git a/core/src/main/java/org/marketcetera/core/BigDecimalUtils.java b/core/src/main/java/org/marketcetera/core/BigDecimalUtils.java
index d7c0262972..fb531783c5 100644
--- a/core/src/main/java/org/marketcetera/core/BigDecimalUtils.java
+++ b/core/src/main/java/org/marketcetera/core/BigDecimalUtils.java
@@ -9,59 +9,61 @@
@ClassVersion("$Id$") //$NON-NLS-1$
public class BigDecimalUtils {
-// default to read a double primitive value of 18 digit
-// precision
- public static final NumberFormat DEFAULT_DECIMAL_FORMAT =
- new DecimalFormat ("#.0#################",new DecimalFormatSymbols(Locale.US)); //$NON-NLS-1$
-
+ // default to read a double primitive value of 18 digit
+ // precision
+ public static final NumberFormat DEFAULT_DECIMAL_FORMAT = new DecimalFormat ("#.0#################",
+ new DecimalFormatSymbols(Locale.US)); //$NON-NLS-1$
public static final MathContext DEFAULT_CONTEXT = new MathContext(4);
- public static BigDecimal add (BigDecimal a, BigDecimal b) {
- if (a == null) return (b == null) ? BigDecimal.ZERO : b;
- return a.add (b);
- }
+ public static BigDecimal add (BigDecimal a, BigDecimal b) {
+ if (a == null) return (b == null) ? BigDecimal.ZERO : b;
+ return a.add (b);
+ }
- public static BigDecimal subtract (BigDecimal a, BigDecimal b) {
- if (a == null) return (b == null) ? BigDecimal.ZERO : b;
- return a.subtract (b);
- }
+ public static BigDecimal subtract (BigDecimal a, BigDecimal b) {
+ if (a == null) return (b == null) ? BigDecimal.ZERO : b;
+ return a.subtract (b);
+ }
- public static BigDecimal multiply (double a, double b) {
- String s = DEFAULT_DECIMAL_FORMAT.format(a);
- BigDecimal bd = new BigDecimal (s); //non-i18n
- return multiply (bd, b);
- }
+ public static BigDecimal multiply (double a, double b) {
+ String s = DEFAULT_DECIMAL_FORMAT.format(a);
+ BigDecimal bd = new BigDecimal (s); //non-i18n
+ return multiply (bd, b);
+ }
- public static BigDecimal multiply (BigDecimal a, double b) {
- String s = DEFAULT_DECIMAL_FORMAT.format(b);
- BigDecimal bd = new BigDecimal (s); //non-i18n
- return multiply (a, bd);
- }
+ public static BigDecimal multiply (BigDecimal a, double b) {
+ String s = DEFAULT_DECIMAL_FORMAT.format(b);
+ BigDecimal bd = new BigDecimal (s); //non-i18n
+ return multiply (a, bd);
+ }
- public static BigDecimal multiply (BigDecimal a, BigDecimal b) {
- if (a == null) return (b == null) ? BigDecimal.ZERO : b;
- return a.multiply (b);
- }
+ public static BigDecimal multiply (BigDecimal a, BigDecimal b) {
+ if (a == null) return (b == null) ? BigDecimal.ZERO : b;
+ return a.multiply (b);
+ }
- public static BigDecimal divide (BigDecimal a, BigDecimal b) { return divide(a, b, MathContext.DECIMAL128); }
+ public static BigDecimal divide (BigDecimal a, BigDecimal b) { return divide(a, b, MathContext.DECIMAL128); }
- public static BigDecimal divide (BigDecimal a, BigDecimal b, MathContext context) {
- if (a == null) return (b == null) ? BigDecimal.ZERO : b;
- return a.divide (b, context);
- }
-
- /** Returns the BigDecimal value n with trailing zeroes removed. */
- public static BigDecimal trim(BigDecimal n) {
- try {
+ public static BigDecimal divide (BigDecimal a, BigDecimal b, MathContext context) {
+ if (a == null) return (b == null) ? BigDecimal.ZERO : b;
+ return a.divide (b, context);
+ }
+ /**
+ * Returns the BigDecimal value n with trailing zeroes removed.
+ *
+ * @param n a BigDecimal value
+ * @return a BigDecimal value
+ */
+ public static BigDecimal trim(BigDecimal n) {
+ try {
int scale;
while((scale = n.scale()) > 0) {
n = n.setScale(scale - 1);
}
- } catch (ArithmeticException e) {
- // no more trailing zeroes so exit.
- }
- return n;
- }
-
+ } catch (ArithmeticException e) {
+ // no more trailing zeroes so exit.
+ }
+ return n;
+ }
}
diff --git a/core/src/main/java/org/marketcetera/core/ExternalIDFactory.java b/core/src/main/java/org/marketcetera/core/ExternalIDFactory.java
index 6f30dd381c..20a56035ba 100644
--- a/core/src/main/java/org/marketcetera/core/ExternalIDFactory.java
+++ b/core/src/main/java/org/marketcetera/core/ExternalIDFactory.java
@@ -40,8 +40,11 @@ public String getNext() throws NoMoreIDsException
return prefix + (mNextID++);
}
}
-
- /** Returns the value of the next ID, but does not increment the id - this is more of a peek */
+ /**
+ * Returns the value of the next ID, but does not increment the id - this is more of a peek
+ *
+ * @return a long value
+ */
protected long peekNextAsInt()
{
return mNextID;
diff --git a/core/src/main/java/org/marketcetera/core/IDFactory.java b/core/src/main/java/org/marketcetera/core/IDFactory.java
index 31de120dac..99f5636907 100644
--- a/core/src/main/java/org/marketcetera/core/IDFactory.java
+++ b/core/src/main/java/org/marketcetera/core/IDFactory.java
@@ -14,8 +14,12 @@ public interface IDFactory {
* @throws NoMoreIDsException When there are no more exceptions to get from the DB
* @return the next unique identifier as a string
*/
- public String getNext() throws NoMoreIDsException;
-
- /** Do your init thing, you factory, you! */
- public void init() throws ClassNotFoundException, NoMoreIDsException ;
+ String getNext() throws NoMoreIDsException;
+ /**
+ * Do your init thing, you factory, you!
+ *
+ * @throws ClassNotFoundException if the ID factory cannot be initialized
+ * @throws NoMoreIDsException if no more IDs are available
+ */
+ void init() throws ClassNotFoundException, NoMoreIDsException ;
}
diff --git a/core/src/main/java/org/marketcetera/core/InMemoryIDFactory.java b/core/src/main/java/org/marketcetera/core/InMemoryIDFactory.java
index 361a192a99..b843432981 100644
--- a/core/src/main/java/org/marketcetera/core/InMemoryIDFactory.java
+++ b/core/src/main/java/org/marketcetera/core/InMemoryIDFactory.java
@@ -1,6 +1,5 @@
package org.marketcetera.core;
-
/**
* Implementation of IDFactory that provides identifiers unique to this run of the
* Java VM. They are simply the string representation of a counter that is incremented
@@ -19,23 +18,22 @@ public class InMemoryIDFactory implements IDFactory {
* @param startAt the value at which to start the unique identifiers.
*/
public InMemoryIDFactory(long startAt) {
- this(startAt, ""); //$NON-NLS-1$
+ this(startAt, ""); //$NON-NLS-1$
}
-
/**
* Creates a new instance of InMemoryOrderIDFactory, with the given starting
* number, and a prefix for the identifiers
* @param startAt the value at which to start the unique identifiers.
+ * @param suffix a String value
*/
public InMemoryIDFactory(long startAt, String suffix) {
mNextID = startAt;
- this.prefix = suffix;
+ this.prefix = suffix;
}
-
/**
* Returns the next unique identifier as a string
* @return the next unique identifier
- * @throws NoMoreIDsException
+ * @throws NoMoreIDsException if no more IDs are available
*/
public String getNext() throws NoMoreIDsException {
long retVal = 0;
@@ -43,12 +41,10 @@ public String getNext() throws NoMoreIDsException {
retVal = mNextID++;
}
if (retVal == Long.MAX_VALUE){
- throw new NoMoreIDsException(Messages.ERROR_IN_MEMORY_ID_FACTORY_OVERRUN);
+ throw new NoMoreIDsException(Messages.ERROR_IN_MEMORY_ID_FACTORY_OVERRUN);
}
return prefix+retVal;
}
-
-
public void init() {
// no-op
}
diff --git a/core/src/main/java/org/marketcetera/core/LockHelper.java b/core/src/main/java/org/marketcetera/core/LockHelper.java
index 90af2af3f5..72938acee7 100644
--- a/core/src/main/java/org/marketcetera/core/LockHelper.java
+++ b/core/src/main/java/org/marketcetera/core/LockHelper.java
@@ -24,6 +24,7 @@ public class LockHelper
* Executes the given {@link Callable} block within the context of a
* write lock.
*
+ * @param a T value
* @param inBlock a Callable<T> value
* @return a T value
* @throws Exception if an error occurs during block execution
@@ -57,6 +58,7 @@ public void executeWrite(Runnable inBlock)
* Executes the given {@link Callable} block within the context of a
* read lock.
*
+ * @param a T value
* @param inBlock a Callable<T> value
* @return a T value
* @throws Exception if an error occurs during block execution
diff --git a/core/src/main/java/org/marketcetera/core/ObjectUtil.java b/core/src/main/java/org/marketcetera/core/ObjectUtil.java
index 50a976709c..759e08b86a 100644
--- a/core/src/main/java/org/marketcetera/core/ObjectUtil.java
+++ b/core/src/main/java/org/marketcetera/core/ObjectUtil.java
@@ -34,13 +34,15 @@
import java.math.BigDecimal;
-public final class ObjectUtil {
- private ObjectUtil() {
- }
-
+public final class ObjectUtil
+{
/**
* Return true if i1 equals (according to {@link Integer#equals(Object)}) 12.
* Also returns true if 11 is null and 12 is null! Is safe on either 11 or 12 being null.
+ *
+ * @param i1 an Integer value
+ * @param i2 an Integer value
+ * @return a boolean value
*/
public static boolean equalsValue(final Integer i1, final Integer i2) {
if (i1 == null) {
@@ -48,12 +50,15 @@ public static boolean equalsValue(final Integer i1, final Integer i2) {
}
return i1.equals(i2);
}
-
/**
* Return true if bd1 has the same value (according to
* {@link BigDecimalUtil#isSameValue(BigDecimal, BigDecimal)}, which takes care of different scales)
* as bd2.
* Also returns true if bd1 is null and bd2 is null! Is safe on either bd1 or bd2 being null.
+ *
+ * @param bd1 a BigDecimal value
+ * @param bd2 a BigDecimal value
+ * @return a boolean value
*/
public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
if (bd1 == null) {
@@ -61,10 +66,13 @@ public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
}
return BigDecimalUtil.isSameValue(bd1, bd2);
}
-
/**
* Return true if o1 equals (according to {@link Object#equals(Object)}) o2.
* Also returns true if o1 is null and o2 is null! Is safe on either o1 or o2 being null.
+ *
+ * @param o1 an Object value
+ * @param o2 an Object value
+ * @return a boolean value
*/
public static boolean equalsValue(final Object o1, final Object o2) {
if (o1 == null) {
@@ -72,10 +80,13 @@ public static boolean equalsValue(final Object o1, final Object o2) {
}
return o1.equals(o2);
}
-
/**
* Return true if o1 equals (according to {@link Object#equals(Object)} any of the given objects.
* Also returns true if o1 is null and any of the given objects is null as well!
+ *
+ * @param o1 an Object value
+ * @param o2s an Object[] value
+ * @return a boolean value
*/
public static boolean equalsAny(final Object o1, final Object... o2s) {
for (final Object o2 : o2s) {
@@ -92,9 +103,12 @@ public static boolean equalsAny(final Object o1, final Object... o2s) {
}
return false;
}
-
/**
* Return true if o1 equals (according to {@link Object#equals(Object)} ALL of the given objects.
+ *
+ * @param o1 an Object value
+ * @param o2s an Object[] value
+ * @return a boolean value
*/
public static boolean equalsAll(final Object o1, final Object... o2s) {
for (final Object o2 : o2s) {
@@ -111,17 +125,22 @@ public static boolean equalsAll(final Object o1, final Object... o2s) {
}
return true;
}
-
/**
* Return true if o1 does NOT equal (according to {@link Object#equals(Object)} any of the given objects.
* Also returns false if o1 is null and any of the given objects is null as well!
+ *
+ * @param o1 an Object value
+ * @param o2s an Object[] value
+ * @return a boolean value
*/
public static boolean notEqualsAny(final Object o1, final Object... o2s) {
return !equalsAny(o1, o2s);
}
-
/**
* Return true if any of the given objects are null.
+ *
+ * @param o1s an Object[] value
+ * @return a boolean value
*/
public static boolean anyNull(final Object... o1s) {
for (final Object o1 : o1s) {
@@ -131,9 +150,11 @@ public static boolean anyNull(final Object... o1s) {
}
return false;
}
-
/**
* Return true if ALL of the given objects are null.
+ *
+ * @param o1s an Object[] value
+ * @return a boolean value
*/
public static boolean allNull(final Object... o1s) {
for (final Object o1 : o1s) {
@@ -143,9 +164,11 @@ public static boolean allNull(final Object... o1s) {
}
return true;
}
-
/**
* Return true if at least one of the given objects is not null.
+ *
+ * @param o1s an Object[] value
+ * @return a boolean value
*/
public static boolean atLeastOneNotNull(final Object... o1s) {
for (final Object o1 : o1s) {
@@ -155,11 +178,17 @@ public static boolean atLeastOneNotNull(final Object... o1s) {
}
return false;
}
-
/**
* Return true if NONE of the given objects are null.
+ *
+ * @param o1s an Object[] value
+ * @return a boolean value
*/
public static boolean noneNull(final Object... o1s) {
return !anyNull(o1s);
}
+ /**
+ * Create a new ObjectUtil instance.
+ */
+ private ObjectUtil() {}
}
diff --git a/core/src/main/java/org/marketcetera/core/Pair.java b/core/src/main/java/org/marketcetera/core/Pair.java
index ae30706a86..b75ca3eadb 100644
--- a/core/src/main/java/org/marketcetera/core/Pair.java
+++ b/core/src/main/java/org/marketcetera/core/Pair.java
@@ -19,6 +19,8 @@ public class Pair
/**
* Creates a new Pair with the given attributes.
*
+ * @param a Clazz1 value
+ * @param a Clazz2 value
* @param inType1 a Clazz1 value
* @param inType2 a Clazz2 value
* @return a Pair<Clazz1,Clazz2> value
diff --git a/core/src/main/java/org/marketcetera/core/ThreadLocalSimpleDateFormat.java b/core/src/main/java/org/marketcetera/core/ThreadLocalSimpleDateFormat.java
index 55192bef5f..6b6b574d21 100644
--- a/core/src/main/java/org/marketcetera/core/ThreadLocalSimpleDateFormat.java
+++ b/core/src/main/java/org/marketcetera/core/ThreadLocalSimpleDateFormat.java
@@ -21,59 +21,60 @@
*/
public class ThreadLocalSimpleDateFormat extends ThreadLocal {
- private final String formatString;
- private final Locale locale;
- private TimeZone timeZone;
+ private final String formatString;
+ private final Locale locale;
+ private TimeZone timeZone;
- /**
- * Constructor that invokes the String construtor of SimpleDateFormat
- * on each accessing thread.
- *
+ /**
+ * Constructor that invokes the String constructor of SimpleDateFormat
+ * on each accessing thread.
+ *
+ * @param formatString a String value
* @exception NullPointerException if the given pattern is null
* @exception IllegalArgumentException if the given pattern is invalid
- * @see SimpleDateFormat#SimpleDateFormat(String)
- */
- public ThreadLocalSimpleDateFormat(String formatString) {
- this(formatString, null);
- }
-
-
- /**
- * Constructor that invokes the (String, Locale) constructor
- * on each accessing thread.
- *
+ * @see SimpleDateFormat#SimpleDateFormat(String)
+ */
+ public ThreadLocalSimpleDateFormat(String formatString) {
+ this(formatString, null);
+ }
+ /**
+ * Constructor that invokes the (String, Locale) constructor
+ * on each accessing thread.
+ *
+ * @param formatString a String value
+ * @param locale a Locale value
* @exception NullPointerException if the given pattern is null
* @exception IllegalArgumentException if the given pattern is invalid
- * @see SimpleDateFormat#SimpleDateFormat(String, Locale)
- */
- public ThreadLocalSimpleDateFormat(String formatString, Locale locale) {
- this.formatString = formatString;
- this.locale = locale;
- new SimpleDateFormat(formatString);
- }
+ * @see SimpleDateFormat#SimpleDateFormat(String, Locale)
+ */
+ public ThreadLocalSimpleDateFormat(String formatString, Locale locale) {
+ this.formatString = formatString;
+ this.locale = locale;
+ new SimpleDateFormat(formatString);
+ }
- @Override
- protected SimpleDateFormat initialValue() { //i18n_datetime
- SimpleDateFormat simpleDateFormat;
- if (locale != null){
- simpleDateFormat = new SimpleDateFormat(formatString, locale);
- } else {
- simpleDateFormat = new SimpleDateFormat(formatString);
- }
- if (timeZone != null){
- simpleDateFormat.setTimeZone(timeZone);
- }
- return simpleDateFormat;
- }
+ @Override
+ protected SimpleDateFormat initialValue() { //i18n_datetime
+ SimpleDateFormat simpleDateFormat;
+ if (locale != null){
+ simpleDateFormat = new SimpleDateFormat(formatString, locale);
+ } else {
+ simpleDateFormat = new SimpleDateFormat(formatString);
+ }
+ if (timeZone != null){
+ simpleDateFormat.setTimeZone(timeZone);
+ }
+ return simpleDateFormat;
+ }
- /**
- * Sets the timeZone string that will be set on each
- * instance of SimpleDateFormat created by this object.
- *
- * @param timeZone the time zone as a string
- * @see SimpleDateFormat#setTimeZone(TimeZone)
- */
- public void setTimeZone(TimeZone timeZone) {
- this.timeZone = timeZone;
- }
+ /**
+ * Sets the timeZone string that will be set on each
+ * instance of SimpleDateFormat created by this object.
+ *
+ * @param timeZone the time zone as a string
+ * @see SimpleDateFormat#setTimeZone(TimeZone)
+ */
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
}
diff --git a/core/src/main/java/org/marketcetera/core/Total.java b/core/src/main/java/org/marketcetera/core/Total.java
index 27110f9a8f..38f61f6f61 100644
--- a/core/src/main/java/org/marketcetera/core/Total.java
+++ b/core/src/main/java/org/marketcetera/core/Total.java
@@ -76,10 +76,11 @@ public void setTotal(final BigDecimal total) {
this.value = total;
}
}
-
/**
+ * Add the given values if the condition evaluates to true.
+ *
* @param condition if true, do the addition.
- * @param values
+ * @param values a BigDecimal[] value
* @return the total with changed value if condition is true.
* @since 1.4.0
*/
@@ -89,8 +90,10 @@ public Total addIfTrue(final boolean condition, final BigDecimal... values) {
}
return this;
}
-
/**
+ * Add the given values to the Total value and return the new value.
+ *
+ * @param value a BigDecimal[] value
* @return the current Sum with new total.
*/
public Total add(final BigDecimal... value) {
@@ -100,10 +103,11 @@ public Total add(final BigDecimal... value) {
}
return this;
}
-
/**
+ * Subtract the given values if the condition evaluates to true.
+ *
* @param condition if true, do the subtraction.
- * @param values
+ * @param values a BigDecimal[] value
* @return the total with changed value if condition is true.
* @since 1.4.0
*/
@@ -129,8 +133,10 @@ public Total add(final Integer value) {
}
return this;
}
-
/**
+ * Add the given Total and return the new value.
+ *
+ * @param value a Total value
* @return the current Sum with new total.
*/
public Total add(final Total value) {
@@ -140,8 +146,10 @@ public Total add(final Total value) {
}
return this;
}
-
/**
+ * Subtract the given values and return the new value.
+ *
+ * @param value a BigDecimal[] value
* @return the current Sum with new total.
*/
public Total minus(final BigDecimal... value) {
@@ -151,8 +159,10 @@ public Total minus(final BigDecimal... value) {
}
return this;
}
-
/**
+ * Subtract the given value and return the new value.
+ *
+ * @param value a Total value
* @return the current Sum with new total.
*/
public Total minus(final Total value) {
diff --git a/core/src/main/java/org/marketcetera/core/Util.java b/core/src/main/java/org/marketcetera/core/Util.java
index 3a964a58b5..f5e9b5e33e 100644
--- a/core/src/main/java/org/marketcetera/core/Util.java
+++ b/core/src/main/java/org/marketcetera/core/Util.java
@@ -30,7 +30,7 @@ public class Util
/** Tries to load the named file from a classpath
* If the file name doesn't start with a leading / then
* if we fail to load it we prepend the / and try again
- * @param inFileName
+ * @param inFileName a String value
* @param inObj some object to get the classloader from
* @return The URL to the resource or NULL if it's not found
*/
@@ -44,15 +44,15 @@ public static URL loadFileFromClasspath(String inFileName, Object inObj)
}
return resource;
}
-
/**
* Reads the entire file and stuffs it into a StringBuffer and returns the string
* The file is loaded from classpath.
* Use wisely, this will choke on very large files.
*
- * @param inFileName
+ * @param inFileName a String value
* @param inObj some object to get the classloader from
* @return The entire contents of the file
+ * @throws Exception if an error occurs reading the file
*/
public static String getStringFromFile(String inFileName, Object inObj) throws Exception
{
@@ -69,10 +69,11 @@ public static String getStringFromFile(String inFileName, Object inObj) throws E
/**
* Deep copies the given object.
*
+ * @param the type of the object to copy
* @param inOriginalObject a Clazz value
* @return a Clazz value
- * @throws IOException
- * @throws ClassNotFoundException
+ * @throws IOException if an error occurs copying the object
+ * @throws ClassNotFoundException if the new copy cannot be created
*/
@SuppressWarnings("unchecked")
public static Clazz deepCopy(Clazz inOriginalObject)
diff --git a/core/src/main/java/org/marketcetera/core/instruments/CFICodeUtils.java b/core/src/main/java/org/marketcetera/core/instruments/CFICodeUtils.java
index 4b3fa21289..ac2cc3f0f2 100644
--- a/core/src/main/java/org/marketcetera/core/instruments/CFICodeUtils.java
+++ b/core/src/main/java/org/marketcetera/core/instruments/CFICodeUtils.java
@@ -144,13 +144,12 @@ static String getCFICode(Currency inInstrument)
}
return code.toString();
}
-
/**
- *
- *
+ * Get the CFI code from the given instrument.
*
- * @param inInstrument
- * @return
+ * @param inInstrument an Instrument value
+ * @return a String value
+ * @throws UnsupportedOperationException if the given instrument does not have a CFI code
*/
public static String getCFICode(Instrument inInstrument)
{
diff --git a/core/src/main/java/org/marketcetera/core/instruments/package-info.java b/core/src/main/java/org/marketcetera/core/instruments/package-info.java
index 2c16efaa08..fbdb5cb4f1 100644
--- a/core/src/main/java/org/marketcetera/core/instruments/package-info.java
+++ b/core/src/main/java/org/marketcetera/core/instruments/package-info.java
@@ -18,6 +18,7 @@
* instrument instance is available is abstracted out by
* implementing it in a subclass of
* {@link org.marketcetera.core.instruments.InstrumentFunctionHandler}.
+ *
*
* A {@link org.marketcetera.core.instruments.StaticInstrumentFunctionSelector}
* instance can be used to dynamically select the appropriate handler
@@ -26,10 +27,10 @@
* The selector chooses the appropriate instrument specific subclass of
* {@link org.marketcetera.core.instruments.StaticInstrumentFunctionSelector}
* based on the runtime type of the instrument.
+ *
*
* See {@link org.marketcetera.core.instruments.InstrumentToMessage} for an
- * example.
- *
+ * example.
*
DynamicInstrumentHandler
* In cases when an instrument instance is not available and instrument
* specific functionality needs to be invoked based on an arbitrary data,
diff --git a/core/src/main/java/org/marketcetera/core/position/PositionKeyFactory.java b/core/src/main/java/org/marketcetera/core/position/PositionKeyFactory.java
index 3b75e50d3f..9d63c27286 100644
--- a/core/src/main/java/org/marketcetera/core/position/PositionKeyFactory.java
+++ b/core/src/main/java/org/marketcetera/core/position/PositionKeyFactory.java
@@ -24,14 +24,11 @@ public class PositionKeyFactory {
* Creates an equity position key. Note that account and traderId are
* converted to null if they only contain whitespace.
*
- * @param symbol
- * symbol, cannot be null or whitespace
- * @param account
- * account
- * @param traderId
- * trader id
- * @throws IllegalArgumentException
- * if symbol is null or whitespace
+ * @param symbol symbol, cannot be null or whitespace
+ * @param account account
+ * @param traderId trader id
+ * @return a PositionKey<Equity> value
+ * @throws IllegalArgumentException if symbol is null or whitespace
*/
public static PositionKey createEquityKey(String symbol,
@Nullable String account, @Nullable String traderId) {
@@ -79,6 +76,7 @@ public static PositionKey createFutureKey(String inSymbol,
* @param inSymbol a String value
* @param inAccount a String value
* @param inTraderId a String value
+ * @return a PositionKey<ConvertibleBond> value
* @throws IllegalArgumentException if one of the given parameters are invalid
*/
public static PositionKey createConvertibleBondKey(String inSymbol,
@@ -99,14 +97,15 @@ public static PositionKey createConvertibleBondKey(String inSym
* @param farTenor a String value
* @param inAccount a String value
* @param inTraderId a String value
+ * @return a PositionKey<Currency> value
* @throws IllegalArgumentException if one of the given parameters are invalid
*/
public static PositionKey createCurrencyKey(String baseCCY,
- String plCCY,
- String nearTenor,
- @Nullable String farTenor,
- @Nullable String inAccount,
- @Nullable String inTraderId)
+ String plCCY,
+ String nearTenor,
+ @Nullable String farTenor,
+ @Nullable String inAccount,
+ @Nullable String inTraderId)
{
return createKey(new Currency(baseCCY, plCCY, nearTenor, farTenor),inAccount,
inTraderId);
@@ -118,6 +117,9 @@ public static PositionKey createCurrencyKey(String baseCCY,
* @param inExpiry a String value
* @param inStrikePrice a BigDecimal value
* @param inType an OptionType value
+ * @param inAccount a String value
+ * @param inTraderId a String value
+ * @return a PositionKey<Currency> value
* @throws IllegalArgumentException if any argument is null, or if symbol or expiry is whitespace
*/
public static PositionKey
This section documents the sequence of API invocations that happen when running a multi
diff --git a/core/src/main/java/org/marketcetera/rpc/BaseRpcClient.java b/core/src/main/java/org/marketcetera/rpc/BaseRpcClient.java
index 1fccdaf8d6..53d00bf651 100644
--- a/core/src/main/java/org/marketcetera/rpc/BaseRpcClient.java
+++ b/core/src/main/java/org/marketcetera/rpc/BaseRpcClient.java
@@ -217,47 +217,42 @@ protected SessionId getSessionId()
return sessionId;
}
/**
- *
+ * Get the application id value.
*
- *
- * @return
+ * @return an AppId value
*/
protected abstract AppId getAppId();
/**
- *
- *
+ * Get the version info value.
*
- * @return
+ * @return a VersionInfo value
*/
protected abstract VersionInfo getVersionInfo();
/**
- *
- *
+ * Create the client.
*
- * @param inChannel
- * @return
+ * @param inChannel an RpcClientChannel value
+ * @return a BlockingInterfaceClazz value
*/
protected abstract BlockingInterfaceClazz createClient(RpcClientChannel inChannel);
/**
- *
- *
+ * Execute the login action.
*
- * @param inController
- * @param inRequest
- * @return
- * @throws ServiceException
+ * @param inController an RpcController value
+ * @param inRequest a BaseRpc.LoginRequest value
+ * @return a BaseRpc.LoginResponse value
+ * @throws ServiceException if the login fails
*/
protected abstract BaseRpc.LoginResponse executeLogin(RpcController inController,
BaseRpc.LoginRequest inRequest)
throws ServiceException;
/**
- *
- *
+ * Execute the logout action.
*
- * @param inController
- * @param inRequest
- * @return
- * @throws ServiceException
+ * @param inController an RpcController value
+ * @param inRequest a BaseRpc.LogoutRequest value
+ * @return a BaseRpc.LogoutResponse value
+ * @throws ServiceException if the logout fails
*/
protected abstract BaseRpc.LogoutResponse executeLogout(RpcController inController,
BaseRpc.LogoutRequest inRequest)
diff --git a/core/src/main/java/org/marketcetera/trade/Currency.java b/core/src/main/java/org/marketcetera/trade/Currency.java
index e3df621a0b..ddf809c027 100644
--- a/core/src/main/java/org/marketcetera/trade/Currency.java
+++ b/core/src/main/java/org/marketcetera/trade/Currency.java
@@ -30,316 +30,318 @@
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@ClassVersion("$Id$")
-public class Currency extends Instrument implements Comparable{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * validation/set of permissible tenors
- * OUTRIGHTS:
- * TOD = Tomorrow (T+0)
- * ON = Overnight (T+0)
- * TN = Tomorrow Next (T+1)
- * SP = Spot -- T+1 in CAD,PHP,RUB ... rest are T+2
- * SN = Spot Next (Spot+1)
- * nD = n days until settlement
- * nW = n weeks until settlement
- * nM = n months until settlement
- * nY = n years until settlement
- * nIMM = n'th nearest IMM date. an IMM date is the 3rd Wednesday
- * of March, June, September and December months
- *
- *
- */
-
- // when metc upgrades to newest guava, replace with ImmutableSet.of(...)
- /*protected static Set TENORSET = new HashSet();
- static{
- String[] TENORARRAY =
- {"TOD","ON","TN","SP","SN",
- "1D","2D","3D","4D","5D","6D","7D","8D","9D","10D",
- "1W","2W","3W",
- "1M","2M","3M","4M","5M","6M","7M","8M","9M","10M","11M","12M",
- "1Y","2Y","3Y",
- "1IMM","2IMM","3IMM","4IMM"};
-
- TENORSET.addAll(Arrays.asList(TENORARRAY));
- }*/
-
- /*public static Set getTenorSet()
- {
- return Collections.unmodifiableSet(TENORSET);
- }*/
- protected static DateTimeFormatter fixDateFormat = DateTimeFormat.forPattern("yyyyMMdd");
-
- /**
- * aka the "base" currency, eg EUR in EURUSD
- *
- */
- protected final String leftCCY;
-
- /**
- * aka the "pl" or "variable" currency, eg JPY in USDJPY
- */
- protected final String rightCCY;
-
- /**
- * store the tenor as a string
- * trading systems often value generic representations, eg Spot
- * alternatively if we stored it as a date object
- * we'd have to actually calculate the settlement date when any of the
- * generics are specified which requires a holiday calendar of many countries
- */
- protected final String nearTenor;
- protected final String farTenor;
-
- /**
- * leftCCY/rightCCY, final cached for minute performance gain in getSymbol()
- */
- protected final String fixSymbol;
-
- /**
- * likewise cache a hashCode
- */
- private final int hashCode;
-
- /**
- * currency pertaining to the order submitted
- * eg, both the SIDE and QUANTITY refer to this currency
- */
- protected String tradedCCY;
-
-
- /**
- * JAXB empty constructor
- * JAXB cannot instantiate an object without empty constructor
- */
- protected Currency()
+public class Currency
+ extends Instrument
+ implements Comparable
+{
+ /**
+ * validation/set of permissible tenors
+ * OUTRIGHTS:
+ * TOD = Tomorrow (T+0)
+ * ON = Overnight (T+0)
+ * TN = Tomorrow Next (T+1)
+ * SP = Spot -- T+1 in CAD,PHP,RUB ... rest are T+2
+ * SN = Spot Next (Spot+1)
+ * nD = n days until settlement
+ * nW = n weeks until settlement
+ * nM = n months until settlement
+ * nY = n years until settlement
+ * nIMM = n'th nearest IMM date. an IMM date is the 3rd Wednesday
+ * of March, June, September and December months
+ *
+ *
+ */
+
+ // when metc upgrades to newest guava, replace with ImmutableSet.of(...)
+ /*protected static Set TENORSET = new HashSet();
+ static{
+ String[] TENORARRAY =
+ {"TOD","ON","TN","SP","SN",
+ "1D","2D","3D","4D","5D","6D","7D","8D","9D","10D",
+ "1W","2W","3W",
+ "1M","2M","3M","4M","5M","6M","7M","8M","9M","10M","11M","12M",
+ "1Y","2Y","3Y",
+ "1IMM","2IMM","3IMM","4IMM"};
+
+ TENORSET.addAll(Arrays.asList(TENORARRAY));
+ }*/
+
+ /*public static Set getTenorSet()
+ {
+ return Collections.unmodifiableSet(TENORSET);
+ }*/
+ protected static DateTimeFormatter fixDateFormat = DateTimeFormat.forPattern("yyyyMMdd");
+
+ /**
+ * aka the "base" currency, eg EUR in EURUSD
+ *
+ */
+ protected final String leftCCY;
+
+ /**
+ * aka the "pl" or "variable" currency, eg JPY in USDJPY
+ */
+ protected final String rightCCY;
+
+ /**
+ * store the tenor as a string
+ * trading systems often value generic representations, eg Spot
+ * alternatively if we stored it as a date object
+ * we'd have to actually calculate the settlement date when any of the
+ * generics are specified which requires a holiday calendar of many countries
+ */
+ protected final String nearTenor;
+ protected final String farTenor;
+
+ /**
+ * leftCCY/rightCCY, final cached for minute performance gain in getSymbol()
+ */
+ protected final String fixSymbol;
+
+ /**
+ * likewise cache a hashCode
+ */
+ private final int hashCode;
+
+ /**
+ * currency pertaining to the order submitted
+ * eg, both the SIDE and QUANTITY refer to this currency
+ */
+ protected String tradedCCY;
+
+
+ /**
+ * JAXB empty constructor
+ * JAXB cannot instantiate an object without empty constructor
+ */
+ protected Currency()
{
//this("","","","");
- leftCCY = null;
- rightCCY = null;
- nearTenor = null;
- farTenor = null;
- hashCode = -1;
- fixSymbol = null;
-
+ leftCCY = null;
+ rightCCY = null;
+ nearTenor = null;
+ farTenor = null;
+ hashCode = -1;
+ fixSymbol = null;
+
}
-
- public Currency(String symbol)
- {
- String[] currencies = symbol.split("/");
- fixSymbol = symbol;
- nearTenor=null;
- farTenor=null;
- if(currencies.length ==2)
- {
- leftCCY = currencies[0];
- rightCCY = currencies[1];
- tradedCCY = currencies[0];
- } else {
- leftCCY=null;
- rightCCY=null;
- tradedCCY=null;
- }
+
+ public Currency(String symbol)
+ {
+ String[] currencies = symbol.split("/");
+ fixSymbol = symbol;
+ nearTenor=null;
+ farTenor=null;
+ if(currencies.length ==2)
+ {
+ leftCCY = currencies[0];
+ rightCCY = currencies[1];
+ tradedCCY = currencies[0];
+ } else {
+ leftCCY=null;
+ rightCCY=null;
+ tradedCCY=null;
+ }
hashCode = new HashCodeBuilder().append(fixSymbol).toHashCode();
- }
-
- /**
- * outright trade constructor for generic delivery date
- *
- * @param baseCCY
- * @param plCCY
- * @param nearTenor
- *
- */
- public Currency(String baseCCY, String plCCY, String nearTenor){
- this(baseCCY, plCCY, nearTenor, new String(""));
- }
-
-
-
-
- /**
- * outright trade constructor for an exact delivery date
- *
- * @param baseCCY
- * @param plCCY
- * @param nearTenor
- */
- public Currency(String baseCCY, String plCCY, LocalDate nearTenor){
- this(baseCCY,plCCY,nearTenor,null);
- }
-
-
- /**
- * swap trade constructor for generic near tenor, exact far tenor swap
- * (eg typically for use in Spot vs IMM fwd)
- *
- * @param baseCCY
- * @param plCCY
- * @param nearTenor
- */
- public Currency(String baseCCY, String plCCY, String nearTenor, LocalDate farTenor){
- this(baseCCY, plCCY, nearTenor,
- farTenor==null ? null : farTenor.toString(fixDateFormat));
- }
-
- /**
- * swap trade constructor for exact swap dates
- *
- * @param baseCCY
- * @param plCCY
- * @param nearTenor
- */
- public Currency(String baseCCY, String plCCY, LocalDate nearTenor, LocalDate farTenor){
- this(baseCCY, plCCY, nearTenor.toString(fixDateFormat),
- farTenor==null ? null : farTenor.toString(fixDateFormat));
- }
-
- /**
- * outright trade constructor -OR- generic swap constructor
- *
- * @param leftCCY
- * @param rightCCY
- * @param nearTenor
- * @param farTenor
- * @param baseCCY
- *
- */
- public Currency(String leftCCY, String rightCCY, String nearTenor, String farTenor, String baseCCY){
- leftCCY = StringUtils.trimToNull(leftCCY);
- rightCCY = StringUtils.trimToNull(rightCCY);
- nearTenor = StringUtils.trimToNull(nearTenor);
- farTenor = StringUtils.trimToNull(farTenor);
- Validate.notNull(leftCCY,Messages.MISSING_LEFT_CURRENCY.getText());
- Validate.notNull(rightCCY,Messages.MISSING_RIGHT_CURRENCY.getText());
- this.leftCCY = leftCCY;
- this.rightCCY = rightCCY;
- this.fixSymbol = this.leftCCY+"/"+this.rightCCY;
- if(Currency.isValidTenor(nearTenor)){
- this.nearTenor = nearTenor;
- }else{
- this.nearTenor = null;
- }
- if(Currency.isValidTenor(farTenor)){
- this.farTenor = farTenor;
- }else{
- this.farTenor = null;
- }
- this.setTradedCCY(baseCCY);
+ }
+
+ /**
+ * outright trade constructor for generic delivery date
+ *
+ * @param baseCCY a String value
+ * @param plCCY a String value
+ * @param nearTenor a String value
+ *
+ */
+ public Currency(String baseCCY, String plCCY, String nearTenor){
+ this(baseCCY, plCCY, nearTenor, new String(""));
+ }
+
+
+
+
+ /**
+ * outright trade constructor for an exact delivery date
+ *
+ * @param baseCCY a String value
+ * @param plCCY a String value
+ * @param nearTenor a LocalDate value
+ */
+ public Currency(String baseCCY, String plCCY, LocalDate nearTenor){
+ this(baseCCY,plCCY,nearTenor,null);
+ }
+
+
+ /**
+ * swap trade constructor for generic near tenor, exact far tenor swap
+ * (eg typically for use in Spot vs IMM fwd)
+ *
+ * @param baseCCY a String value
+ * @param plCCY a String value
+ * @param nearTenor a String value
+ * @param farTenor a LocalDate value
+ */
+ public Currency(String baseCCY, String plCCY, String nearTenor, LocalDate farTenor){
+ this(baseCCY, plCCY, nearTenor,
+ farTenor==null ? null : farTenor.toString(fixDateFormat));
+ }
+
+ /**
+ * swap trade constructor for exact swap dates
+ *
+ * @param baseCCY a String value
+ * @param plCCY a String value
+ * @param nearTenor a LocalDate value
+ * @param farTenor a LocalDate value
+ */
+ public Currency(String baseCCY, String plCCY, LocalDate nearTenor, LocalDate farTenor){
+ this(baseCCY, plCCY, nearTenor.toString(fixDateFormat),
+ farTenor==null ? null : farTenor.toString(fixDateFormat));
+ }
+
+ /**
+ * outright trade constructor -OR- generic swap constructor
+ *
+ * @param leftCCY a String value
+ * @param rightCCY a String value
+ * @param nearTenor a String value
+ * @param farTenor a String value
+ * @param baseCCY a String value
+ */
+ public Currency(String leftCCY, String rightCCY, String nearTenor, String farTenor, String baseCCY){
+ leftCCY = StringUtils.trimToNull(leftCCY);
+ rightCCY = StringUtils.trimToNull(rightCCY);
+ nearTenor = StringUtils.trimToNull(nearTenor);
+ farTenor = StringUtils.trimToNull(farTenor);
+ Validate.notNull(leftCCY,Messages.MISSING_LEFT_CURRENCY.getText());
+ Validate.notNull(rightCCY,Messages.MISSING_RIGHT_CURRENCY.getText());
+ this.leftCCY = leftCCY;
+ this.rightCCY = rightCCY;
+ this.fixSymbol = this.leftCCY+"/"+this.rightCCY;
+ if(Currency.isValidTenor(nearTenor)){
+ this.nearTenor = nearTenor;
+ }else{
+ this.nearTenor = null;
+ }
+ if(Currency.isValidTenor(farTenor)){
+ this.farTenor = farTenor;
+ }else{
+ this.farTenor = null;
+ }
+ this.setTradedCCY(baseCCY);
hashCode = new HashCodeBuilder().append(fixSymbol).toHashCode();
- }
-
- public Currency(String leftCCY, String rightCCY, String nearTenor, String farTenor){
- this(leftCCY, rightCCY, nearTenor, farTenor, leftCCY);
- }
-
-
- /**
- * utility method determining if this is a currency swap
- * eg when the farTenor is null
- *
- * @return
- */
- public boolean isSwap(){
- return (farTenor!=null);
- }
-
- /**
- * returns the "base" or left ccy of the currency pair
- * @return
- */
- public String getLeftCCY() {
- return leftCCY;
- }
-
- /**
- * returns the "pl" or right ccy of the currency pair
- * @return
- */
- public String getRightCCY() {
- return rightCCY;
- }
-
- /**
- * returns the delivery date for the currency outright trade
- * or if it is a currency swap the near leg's delivery date
- *
- * @return
- */
- public String getNearTenor(){
- return nearTenor;
- }
-
- /**
- * returns the far delivery date for the currency swap trade
- * @return
- */
- public String getFarTenor(){
- return farTenor;
- }
-
- /**
- * determines which currency OrderQty (and related FIX fields)
- * relates to... FIX Tag 15
- *
- * that is if sending an order for symbol USD/JPY, the order can specify
- * whether the desired qty traded is in JPY or USD
- *
- * @param ccy
- */
- public void setTradedCCY(String ccy){
- if(ccy.equals(leftCCY)){
- this.tradedCCY=ccy;
- }else{
- if(ccy.equals(rightCCY)){
- this.tradedCCY=ccy;
- }
- }
- }
-
- /**
- * returns the currency specified in the qty fields of FIX orders
- * for this Instrument
- *
- * @return
- */
- public String getTradedCCY(){
- return this.tradedCCY;
- }
-
-
- /**
- * returns the METC API enum corresponding to tag167
- */
- @Override
- public SecurityType getSecurityType() {
- return SecurityType.Currency; // SecurityType.Currency
- }
-
- /**
- * returns the FIX tag55 value for this Instrument
- */
- @Override
- public String getSymbol() {
- return this.fixSymbol;
- }
-
- /**
- * simple String hashcode of symbol+tenors
- *
- */
- public int hashCode(){
- return this.hashCode;
- }
-
+ }
+
+ public Currency(String leftCCY, String rightCCY, String nearTenor, String farTenor){
+ this(leftCCY, rightCCY, nearTenor, farTenor, leftCCY);
+ }
+
+
+ /**
+ * utility method determining if this is a currency swap
+ * eg when the farTenor is null
+ *
+ * @return a boolean value
+ */
+ public boolean isSwap(){
+ return (farTenor!=null);
+ }
+
+ /**
+ * returns the "base" or left ccy of the currency pair
+ * @return a String value
+ */
+ public String getLeftCCY() {
+ return leftCCY;
+ }
+
+ /**
+ * returns the "pl" or right ccy of the currency pair
+ * @return a String value
+ */
+ public String getRightCCY() {
+ return rightCCY;
+ }
+
+ /**
+ * returns the delivery date for the currency outright trade
+ * or if it is a currency swap the near leg's delivery date
+ *
+ * @return a String value
+ */
+ public String getNearTenor(){
+ return nearTenor;
+ }
+
+ /**
+ * returns the far delivery date for the currency swap trade
+ * @return a String value
+ */
+ public String getFarTenor(){
+ return farTenor;
+ }
+
+ /**
+ * determines which currency OrderQty (and related FIX fields)
+ * relates to... FIX Tag 15
+ *
+ * that is if sending an order for symbol USD/JPY, the order can specify
+ * whether the desired qty traded is in JPY or USD
+ *
+ * @param ccy a String value
+ */
+ public void setTradedCCY(String ccy){
+ if(ccy.equals(leftCCY)){
+ this.tradedCCY=ccy;
+ }else{
+ if(ccy.equals(rightCCY)){
+ this.tradedCCY=ccy;
+ }
+ }
+ }
+
+ /**
+ * returns the currency specified in the qty fields of FIX orders
+ * for this Instrument
+ *
+ * @return a String value
+ */
+ public String getTradedCCY(){
+ return this.tradedCCY;
+ }
+
+
+ /**
+ * returns the METC API enum corresponding to tag167
+ *
+ * @return a SecurityType value
+ */
@Override
- public boolean equals(Object obj) {
+ public SecurityType getSecurityType() {
+ return SecurityType.Currency; // SecurityType.Currency
+ }
+
+ /**
+ * returns the FIX tag55 value for this Instrument
+ *
+ * @return a String value
+ */
+ @Override
+ public String getSymbol() {
+ return this.fixSymbol;
+ }
+
+ /**
+ * simple String hashcode of symbol+tenors
+ *
+ * @return an int value
+ */
+ public int hashCode(){
+ return this.hashCode;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
@@ -348,80 +350,76 @@ public boolean equals(Object obj) {
return false;
Currency other = (Currency) obj;
return new EqualsBuilder().append(fixSymbol,other.fixSymbol).isEquals();
- }
-
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("Currency [leftCCY=").append(leftCCY)
- .append(", rightCCY=").append(rightCCY).append(", nearTenor=")
- .append(nearTenor).append(", farTenor=").append(farTenor)
- .append(", fixSymbol=").append(fixSymbol).append(", hashCode=")
- .append(hashCode).append(", tradedCCY=").append(tradedCCY)
- .append("]");
- return builder.toString();
- }
-
-
- /**
- * utility method to invert the ccypair and return a new instrument
- * eg for Currency Pair EUR/USD, returns USD/EUR
- *
- * WARN: inverse MAINTAINS the tradedCCY field
- *
- * @return
- */
- public Currency inverse(){
- Currency inverse = new Currency(this.rightCCY,this.leftCCY,this.nearTenor,this.farTenor);
- inverse.setTradedCCY(this.getTradedCCY());
- return inverse;
- }
-
- /**
- * utility static method to verify tenors
- * @param tenor
- * @return
- */
- protected static boolean isValidTenor(String tenor){
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
- sdf.setLenient(false);
- try {
- sdf.parse(tenor);
- return true;
- } catch (Exception ignore) {
-
- }
- return false;
- }
-
-
- @Override
- public int compareTo(Currency o2) {
- Currency o1 = this;
- if(o2==null){
- //throw new NullPointerException("compareTo invalid for null objects in Currency.compareTo");
- return 1; // prefer to say this object is always greater than a null?
- }
- int symbolComp = o1.getSymbol().compareTo(o2.getSymbol());
- if(symbolComp==0){
- int nearTenorComp = o1.getNearTenor().compareTo(o2.getNearTenor());
- if(nearTenorComp==0){
- if(o1.isSwap() && o2.isSwap()){
- return o1.getFarTenor().compareTo(o2.getFarTenor());
- }else{
- return 0;
- }
- }else{
- return nearTenorComp;
- }
- }else{
- return symbolComp;
- }
- }
-
-}
+ }
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Currency [leftCCY=").append(leftCCY)
+ .append(", rightCCY=").append(rightCCY).append(", nearTenor=")
+ .append(nearTenor).append(", farTenor=").append(farTenor)
+ .append(", fixSymbol=").append(fixSymbol).append(", hashCode=")
+ .append(hashCode).append(", tradedCCY=").append(tradedCCY)
+ .append("]");
+ return builder.toString();
+ }
+ /**
+ * utility method to invert the ccypair and return a new instrument
+ * eg for Currency Pair EUR/USD, returns USD/EUR
+ *
+ * WARN: inverse MAINTAINS the tradedCCY field
+ *
+ * @return a Currency value
+ */
+ public Currency inverse(){
+ Currency inverse = new Currency(this.rightCCY,this.leftCCY,this.nearTenor,this.farTenor);
+ inverse.setTradedCCY(this.getTradedCCY());
+ return inverse;
+ }
+
+ /**
+ * utility static method to verify tenors
+ * @param tenor a String value
+ * @return a boolean value
+ */
+ protected static boolean isValidTenor(String tenor){
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+ sdf.setLenient(false);
+ try {
+ sdf.parse(tenor);
+ return true;
+ } catch (Exception ignore) {
+
+ }
+ return false;
+ }
+
+
+ @Override
+ public int compareTo(Currency o2) {
+ Currency o1 = this;
+ if(o2==null){
+ //throw new NullPointerException("compareTo invalid for null objects in Currency.compareTo");
+ return 1; // prefer to say this object is always greater than a null?
+ }
+ int symbolComp = o1.getSymbol().compareTo(o2.getSymbol());
+ if(symbolComp==0){
+ int nearTenorComp = o1.getNearTenor().compareTo(o2.getNearTenor());
+ if(nearTenorComp==0){
+ if(o1.isSwap() && o2.isSwap()){
+ return o1.getFarTenor().compareTo(o2.getFarTenor());
+ }else{
+ return 0;
+ }
+ }else{
+ return nearTenorComp;
+ }
+ }else{
+ return symbolComp;
+ }
+ }
+ private static final long serialVersionUID = 2835154918602655086L;
+}
diff --git a/core/src/main/java/org/marketcetera/trade/utils/OrderHistoryManager.java b/core/src/main/java/org/marketcetera/trade/utils/OrderHistoryManager.java
index d4aab3709b..0a431f6b83 100644
--- a/core/src/main/java/org/marketcetera/trade/utils/OrderHistoryManager.java
+++ b/core/src/main/java/org/marketcetera/trade/utils/OrderHistoryManager.java
@@ -401,6 +401,7 @@ public void clear(OrderID inOrderId)
*
If the given OrderID has no corresponding order history, the
* returned collection will be empty.
*
+ * @param inOrderId an OrderID value
* @return a Set<OrderID> value
*/
public Set getOrderChain(OrderID inOrderId)
diff --git a/core/src/test/java/org/marketcetera/core/AccessViolator.java b/core/src/test/java/org/marketcetera/core/AccessViolator.java
index 3d231a4b6d..2ab6077c9a 100644
--- a/core/src/test/java/org/marketcetera/core/AccessViolator.java
+++ b/core/src/test/java/org/marketcetera/core/AccessViolator.java
@@ -1,8 +1,8 @@
package org.marketcetera.core;
import java.lang.reflect.Field;
-import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
/**
* @author Graham Miller
@@ -39,7 +39,14 @@ public Object invokeMethod(String methodName, Object reference, Object [] args,
}
- /** Sets the speicified field to the passed-in value */
+ /** Sets the specified field to the passed-in value.*
+ *
+ * @param fieldName a String value
+ * @param reference an Object value
+ * @param value an Object value
+ * @throws NoSuchFieldException if the field cannot be set because it doesn't exist
+ * @throws IllegalAccessException if the field cannot be set because it cannot be accessed
+ */
public void setField(String fieldName, Object reference, Object value)
throws NoSuchFieldException, IllegalAccessException {
Field theField = violatedClass.getDeclaredField(fieldName);
diff --git a/core/src/test/java/org/marketcetera/core/ExpectedTestFailure.java b/core/src/test/java/org/marketcetera/core/ExpectedTestFailure.java
index 8cfd5fbe57..5cf4a858e8 100644
--- a/core/src/test/java/org/marketcetera/core/ExpectedTestFailure.java
+++ b/core/src/test/java/org/marketcetera/core/ExpectedTestFailure.java
@@ -10,7 +10,7 @@
*
*
@@ -33,13 +33,18 @@ public ExpectedTestFailure(Class> inThrowable, String inContains)
mContains = inContains;
}
- /** Subclasses must override this method with an implementation that
- * throws their expected error
- * @throws Throwable
+ /**
+ * Subclasses must override this method with an implementation that throws their expected error.
+ *
+ * @throws Throwable if an error occurs during execution
*/
protected abstract void execute() throws Throwable;
- /** Executes the code that was implemented in @link {execute()} method */
+ /**
+ * Executes the code that was implemented in @link {execute()} method.
+ *
+ * @return a Throwable value
+ */
public Throwable run()
{
try {
diff --git a/core/src/test/java/org/marketcetera/core/ExpectedTestFailureTest.java b/core/src/test/java/org/marketcetera/core/ExpectedTestFailureTest.java
index 7fb026d923..a486c02d82 100644
--- a/core/src/test/java/org/marketcetera/core/ExpectedTestFailureTest.java
+++ b/core/src/test/java/org/marketcetera/core/ExpectedTestFailureTest.java
@@ -52,7 +52,10 @@ protected void execute() throws Throwable
}
- /** Check the case when the exception has a message (toString()) but getMessage() returns null */
+ /** Check the case when the exception has a message (toString()) but getMessage() returns null.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testExceptinoHasNoMessageButHasString() throws Exception {
final Exception ex = new Exception() {
private static final long serialVersionUID = 1L;
diff --git a/core/src/test/java/org/marketcetera/core/LoggerStartupTest.java b/core/src/test/java/org/marketcetera/core/LoggerStartupTest.java
index 84f16e768a..e98cb12de1 100644
--- a/core/src/test/java/org/marketcetera/core/LoggerStartupTest.java
+++ b/core/src/test/java/org/marketcetera/core/LoggerStartupTest.java
@@ -1,8 +1,9 @@
package org.marketcetera.core;
+import org.marketcetera.util.log.SLF4JLoggerProxy;
+
import junit.framework.Test;
import junit.framework.TestCase;
-import org.marketcetera.util.log.SLF4JLoggerProxy;
/**
* @author Toli Kuznets
@@ -18,9 +19,10 @@ public static Test suite() {
return new MarketceteraTestSuite(LoggerStartupTest.class);
}
- /** This is a dummy test, mostly for visual checking of whether or not
- * the logger is initialized correctly.
- * @throws Exception
+ /**
+ * This is a dummy test, mostly for visual checking of whether or not the logger is initialized correctly.
+ *
+ * @throws Exception if an unexpected error occurs
*/
public void testLogSomething() throws Exception {
new ApplicationBase();
diff --git a/core/src/test/java/org/marketcetera/core/VersionInfoTest.java b/core/src/test/java/org/marketcetera/core/VersionInfoTest.java
index eb53a4eb98..185d6f7e10 100644
--- a/core/src/test/java/org/marketcetera/core/VersionInfoTest.java
+++ b/core/src/test/java/org/marketcetera/core/VersionInfoTest.java
@@ -13,7 +13,7 @@
/* $License$ */
/**
- * Tests {@link #VersionInfo}.
+ * Tests VersionInfo.
*
* @author Colin DuPlantis
* @version $Id$
@@ -22,7 +22,7 @@
public class VersionInfoTest
{
/**
- * Tests {@link VersionInfo#VersionInfo(String)}.
+ * Tests the VersionInfo constructor.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/core/instruments/InstrumentToMessageTest.java b/core/src/test/java/org/marketcetera/core/instruments/InstrumentToMessageTest.java
index 3fb6f0e765..74bda05abb 100644
--- a/core/src/test/java/org/marketcetera/core/instruments/InstrumentToMessageTest.java
+++ b/core/src/test/java/org/marketcetera/core/instruments/InstrumentToMessageTest.java
@@ -604,7 +604,7 @@ protected void run()
}
}
/**
- * Tests {@link InstrumentToMessage#setSecurityType(org.marketcetera.trade.Instrument, String, quickfix.Message)}.
+ * Tests {@link InstrumentToMessage#setSecurityType(Instrument, String, quickfix.FieldMap)}.
*
* @throws Exception if there were unexpected errors.
*/
diff --git a/core/src/test/java/org/marketcetera/core/notifications/NotificationManagerTest.java b/core/src/test/java/org/marketcetera/core/notifications/NotificationManagerTest.java
index 8a1d1e823c..3b864f3342 100644
--- a/core/src/test/java/org/marketcetera/core/notifications/NotificationManagerTest.java
+++ b/core/src/test/java/org/marketcetera/core/notifications/NotificationManagerTest.java
@@ -26,7 +26,7 @@ public class NotificationManagerTest
/**
* Tests that the static getter returns a non-null value.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void testGetter()
@@ -40,7 +40,7 @@ public void testGetter()
*
Note that this is not an exhaustive test of the {@link PublisherEngine} because
* that is covered in {@link PublisherEngineTest}.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void testSubscribeAndPublish()
diff --git a/core/src/test/java/org/marketcetera/core/position/impl/OrderingComparison.java b/core/src/test/java/org/marketcetera/core/position/impl/OrderingComparison.java
index 9161d829d5..8932907454 100644
--- a/core/src/test/java/org/marketcetera/core/position/impl/OrderingComparison.java
+++ b/core/src/test/java/org/marketcetera/core/position/impl/OrderingComparison.java
@@ -49,36 +49,56 @@ else if (compare == 0) {
/**
* Is value = expected?
+ *
+ * @param a T value
+ * @param value a T value
+ * @return a Matcher<? super T> value
*/
public static > Matcher super T> comparesEqualTo(T value) {
return new OrderingComparison(value, 0, 0);
}
/**
- * Is value > expected?
+ * Is value > expected?
+ *
+ * @param a T value
+ * @param value a T value
+ * @return a Matcher<? super T> value
*/
public static > Matcher super T> greaterThan(T value) {
return new OrderingComparison(value, -1, -1);
}
/**
- * Is value >= expected?
+ * Is value ≥ expected?
+ *
+ * @param a T value
+ * @param value a T value
+ * @return a Matcher<? super T> value
*/
public static > Matcher super T> greaterThanOrEqualTo(T value) {
return new OrderingComparison(value, -1, 0);
}
/**
- * Is value < expected?
+ * Is value < expected?
+ *
+ * @param a T value
+ * @param value a T value
+ * @return a Matcher<? super T> value
*/
public static > Matcher super T> lessThan(T value) {
return new OrderingComparison(value, 1, 1);
}
/**
- * Is value <= expected?
+ * Is value ≤ expected?
+ *
+ * @param a T value
+ * @param value a T value
+ * @return a Matcher<? super T> value
*/
public static > Matcher super T> lessThanOrEqualTo(T value) {
return new OrderingComparison(value, 0, 1);
}
-}
\ No newline at end of file
+}
diff --git a/core/src/test/java/org/marketcetera/core/position/impl/OrderingTestHelper.java b/core/src/test/java/org/marketcetera/core/position/impl/OrderingTestHelper.java
index 88816a16b0..54ae530a83 100644
--- a/core/src/test/java/org/marketcetera/core/position/impl/OrderingTestHelper.java
+++ b/core/src/test/java/org/marketcetera/core/position/impl/OrderingTestHelper.java
@@ -1,13 +1,14 @@
package org.marketcetera.core.position.impl;
import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
+import org.hamcrest.MatcherAssert;
+
import com.google.common.collect.Lists;
/* $License$ */
@@ -24,11 +25,11 @@ public class OrderingTestHelper {
/**
* Verifies a list of objects can be sorted.
*
- * @param ordered
- * the ordered list of objects
+ * @param a T extends Comparable<? super T> value
+ * @param ordered the ordered list of objects
*/
- public static > void testOrdering(
- List ordered) {
+ public static > void testOrdering(List ordered)
+ {
List copy = Lists.newArrayList(ordered);
Collections.shuffle(copy);
Collections.sort(copy);
@@ -38,24 +39,31 @@ public static > void testOrdering(
/**
* Verifies that a comparator correctly sorts a list of objects.
*
- * @param ordered
- * the ordered list of objects
- * @param comparator
- * the comparator to test
+ * @param a T value
+ * @param ordered the ordered list of objects
+ * @param comparator the comparator to test
*/
public static void testOrdering(List ordered,
- Comparator super T> comparator) {
+ Comparator super T> comparator)
+ {
List copy = Lists.newArrayList(ordered);
Collections.shuffle(copy);
Collections.sort(copy, comparator);
assertSameOrder(ordered, copy);
}
-
- private static void assertSameOrder(List ordered, List copy) {
+ /**
+ * Verify that the two lists are in the same order.
+ *
+ * @param a T value
+ * @param ordered a List<T> value
+ * @param copy a List<T> value
+ */
+ private static void assertSameOrder(List ordered, List copy)
+ {
Iterator> sorted = copy.iterator();
Iterator> original = ordered.iterator();
for (int i = 0; i < copy.size(); i++) {
- assertThat("Element " + i, sorted.next(), is((Object) original
+ MatcherAssert.assertThat("Element " + i, sorted.next(), is((Object) original
.next()));
}
}
diff --git a/core/src/test/java/org/marketcetera/core/position/impl/PositionRowUpdaterConcurrencyTest.java b/core/src/test/java/org/marketcetera/core/position/impl/PositionRowUpdaterConcurrencyTest.java
index ac822bdfef..7309d5db2b 100644
--- a/core/src/test/java/org/marketcetera/core/position/impl/PositionRowUpdaterConcurrencyTest.java
+++ b/core/src/test/java/org/marketcetera/core/position/impl/PositionRowUpdaterConcurrencyTest.java
@@ -260,6 +260,8 @@ public final void run() {
/**
* Hook for subclass code to run. Any thrown exception will be reported.
+ *
+ * @throws Exception if an error occurs
*/
protected abstract void runWithReporting() throws Exception;
}
diff --git a/core/src/test/java/org/marketcetera/event/MockEvent.java b/core/src/test/java/org/marketcetera/event/MockEvent.java
index a7f88c3ee6..ea9fc0423a 100644
--- a/core/src/test/java/org/marketcetera/event/MockEvent.java
+++ b/core/src/test/java/org/marketcetera/event/MockEvent.java
@@ -28,8 +28,8 @@ public MockEvent()
/**
* Create a new MockEvent instance.
*
- * @param inMessageId
- * @param inTimestamp
+ * @param inMessageId a long value
+ * @param inTimestamp a long value
*/
public MockEvent(long inMessageId,
long inTimestamp)
@@ -40,7 +40,7 @@ public MockEvent(long inMessageId,
/**
* Create a new MockEvent instance.
*
- * @param inRequest
+ * @param inRequest a MarketDataRequest value
*/
public MockEvent(MarketDataRequest inRequest)
{
diff --git a/core/src/test/java/org/marketcetera/event/MockEventTranslator.java b/core/src/test/java/org/marketcetera/event/MockEventTranslator.java
index 3d0107c535..daad985f35 100644
--- a/core/src/test/java/org/marketcetera/event/MockEventTranslator.java
+++ b/core/src/test/java/org/marketcetera/event/MockEventTranslator.java
@@ -99,7 +99,7 @@ public static void setTranslateToEventsReturnsNull(boolean inTranslateToEventsRe
/**
* Sets the requestToReturn value.
*
- * @param a DataRequest value
+ * @param inRequestToReturn a DataRequest value
*/
public static void setRequestToReturn(MarketDataRequest inRequestToReturn)
{
diff --git a/core/src/test/java/org/marketcetera/event/QuantityTuple.java b/core/src/test/java/org/marketcetera/event/QuantityTuple.java
index 6bdfa4b05a..74115f82c1 100644
--- a/core/src/test/java/org/marketcetera/event/QuantityTuple.java
+++ b/core/src/test/java/org/marketcetera/event/QuantityTuple.java
@@ -29,6 +29,7 @@ public class QuantityTuple
*
* @param inPrice a BigDecimal value
* @param inSize a BigDecimal value
+ * @param inType a Class<? extends MarketDataEvent> value
*/
public QuantityTuple(BigDecimal inPrice,
BigDecimal inSize,
@@ -59,7 +60,7 @@ public BigDecimal getSize()
/**
* Get the type value.
*
- * @return a Class extends MarketDataEvent> value
+ * @return a Class<? extends MarketDataEvent> value
*/
public Class extends MarketDataEvent> getType()
{
diff --git a/core/src/test/java/org/marketcetera/event/beans/DividendBeanTest.java b/core/src/test/java/org/marketcetera/event/beans/DividendBeanTest.java
index 01b50fb5ea..f2d34c4324 100644
--- a/core/src/test/java/org/marketcetera/event/beans/DividendBeanTest.java
+++ b/core/src/test/java/org/marketcetera/event/beans/DividendBeanTest.java
@@ -64,7 +64,7 @@ public void equity()
bean.getInstrumentAsString());
}
/**
- * Tests {@link DividendBean#getAmount()} and {@link DividendBean#setAmount(org.marketcetera.trade.Amount)}.
+ * Tests {@link DividendBean#getAmount()} and {@link DividendBean#setAmount(BigDecimal)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -82,7 +82,7 @@ public void amount()
bean.getAmount());
}
/**
- * Tests {@link DividendBean#getCurrency()} and {@link DividendBean#setCurrency(org.marketcetera.trade.Currency)}.
+ * Tests {@link DividendBean#getCurrency()} and {@link DividendBean#setCurrency(String)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -100,7 +100,7 @@ public void currency()
bean.getCurrency());
}
/**
- * Tests {@link DividendBean#getDeclareDate()} and {@link DividendBean#setDeclareDate(org.marketcetera.trade.DeclareDate)}.
+ * Tests {@link DividendBean#getDeclareDate()} and {@link DividendBean#setDeclareDate(String)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -121,7 +121,7 @@ public void declareDate()
bean.getDeclareDate());
}
/**
- * Tests {@link DividendBean#getExecutionDate()} and {@link DividendBean#setExecutionDate(org.marketcetera.trade.ExecutionDate)}.
+ * Tests {@link DividendBean#getExecutionDate()} and {@link DividendBean#setExecutionDate(String)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -142,7 +142,7 @@ public void executionDate()
bean.getExecutionDate());
}
/**
- * Tests {@link DividendBean#getPaymentDate()} and {@link DividendBean#setPaymentDate(org.marketcetera.trade.PaymentDate)}.
+ * Tests {@link DividendBean#getPaymentDate()} and {@link DividendBean#setPaymentDate(String)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -163,7 +163,7 @@ public void paymentDate()
bean.getPaymentDate());
}
/**
- * Tests {@link DividendBean#getRecordDate()} and {@link DividendBean#setRecordDate(org.marketcetera.trade.RecordDate)}.
+ * Tests {@link DividendBean#getRecordDate()} and {@link DividendBean#setRecordDate(String)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -184,7 +184,7 @@ public void recordDate()
bean.getRecordDate());
}
/**
- * Tests {@link DividendBean#getFrequency()} and {@link DividendBean#setFrequency(org.marketcetera.trade.Frequency)}.
+ * Tests {@link DividendBean#getFrequency()} and {@link DividendBean#setFrequency(DividendFrequency)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -202,7 +202,7 @@ public void frequency()
bean.getFrequency());
}
/**
- * Tests {@link DividendBean#getStatus()} and {@link DividendBean#setStatus(org.marketcetera.trade.Status)}.
+ * Tests {@link DividendBean#getStatus()} and {@link DividendBean#setStatus(DividendStatus)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -220,7 +220,7 @@ public void status()
bean.getStatus());
}
/**
- * Tests {@link DividendBean#getType()} and {@link DividendBean#setType(org.marketcetera.trade.Type)}.
+ * Tests {@link DividendBean#getType()} and {@link DividendBean#setType(DividendType)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/event/beans/MarketDataBeanTest.java b/core/src/test/java/org/marketcetera/event/beans/MarketDataBeanTest.java
index 525d34b908..aa3cb5cf06 100644
--- a/core/src/test/java/org/marketcetera/event/beans/MarketDataBeanTest.java
+++ b/core/src/test/java/org/marketcetera/event/beans/MarketDataBeanTest.java
@@ -40,7 +40,7 @@ public void copy()
doCopyTest(new MarketDataBean());
}
/**
- * Tests {@link E#getInstrument()} and {@link E#setInstrument(org.marketcetera.trade.Instrument)}.
+ * Tests {@link MarketDataBean#getInstrument()} and {@link MarketDataBean#setInstrument(Instrument)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/event/beans/MarketstatBeanTest.java b/core/src/test/java/org/marketcetera/event/beans/MarketstatBeanTest.java
index 00df104aa0..c3074cb9f7 100644
--- a/core/src/test/java/org/marketcetera/event/beans/MarketstatBeanTest.java
+++ b/core/src/test/java/org/marketcetera/event/beans/MarketstatBeanTest.java
@@ -365,7 +365,7 @@ public void closeExchange()
bean.getCloseExchange());
}
/**
- * Tests {@link E#getInstrument()} and {@link E#setInstrument(org.marketcetera.trade.Instrument)}.
+ * Tests {@link MarketstatBean#getInstrument()} and {@link MarketstatBean#setInstrument(Instrument)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/event/beans/QuoteBeanTest.java b/core/src/test/java/org/marketcetera/event/beans/QuoteBeanTest.java
index f1c9e6c3dd..4f927be450 100644
--- a/core/src/test/java/org/marketcetera/event/beans/QuoteBeanTest.java
+++ b/core/src/test/java/org/marketcetera/event/beans/QuoteBeanTest.java
@@ -47,7 +47,7 @@ public void copy()
}
/**
* Tests {@link QuoteBean#getQuoteBeanFromEvent(org.marketcetera.event.QuoteEvent, QuoteAction)} and
- * {@link QuoteBean#getQuoteBeanFromEvent(org.marketcetera.event.QuoteEvent, java.util.Date, java.math.BigDecimal, QuoteAction).
+ * {@link QuoteBean#getQuoteBeanFromEvent(org.marketcetera.event.QuoteEvent, Date, BigDecimal, QuoteAction)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/event/impl/LogEventTest.java b/core/src/test/java/org/marketcetera/event/impl/LogEventTest.java
index f3f6aeb456..9d93ea3264 100644
--- a/core/src/test/java/org/marketcetera/event/impl/LogEventTest.java
+++ b/core/src/test/java/org/marketcetera/event/impl/LogEventTest.java
@@ -26,7 +26,7 @@
import org.marketcetera.util.log.I18NMessageNP;
/**
- * Tests {@link LogEventBuilder} and {@link LinkEventImpl}.
+ * Tests {@link LogEventBuilder} and {@link LogEventImpl}.
*
* @author Colin DuPlantis
* @version $Id$
diff --git a/core/src/test/java/org/marketcetera/event/impl/QuoteEventTest.java b/core/src/test/java/org/marketcetera/event/impl/QuoteEventTest.java
index 83de04a298..e35ea6817c 100644
--- a/core/src/test/java/org/marketcetera/event/impl/QuoteEventTest.java
+++ b/core/src/test/java/org/marketcetera/event/impl/QuoteEventTest.java
@@ -410,7 +410,7 @@ public void withContractSize()
verify(builder);
}
/**
- * Tests {@link QuoteEventBuilder>#withInstrument(Instrument)}.
+ * Tests {@link QuoteEventBuilder#withInstrument(Instrument)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -461,7 +461,7 @@ public void withMessageId()
verify(builder);
}
/**
- * Tests {@link QuoteEventBuilder#withMultiplier(int)}.
+ * Tests {@link QuoteEventBuilder#withMultiplier(BigDecimal)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -557,7 +557,7 @@ public void withPrice()
verify(builder);
}
/**
- * Tests {@link QuoteEventBuilder#withQuoteDate(String)}.
+ * Tests {@link QuoteEventBuilder#withQuoteDate(Date)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/event/impl/TradeEventTest.java b/core/src/test/java/org/marketcetera/event/impl/TradeEventTest.java
index dbc911717c..ea83923f22 100644
--- a/core/src/test/java/org/marketcetera/event/impl/TradeEventTest.java
+++ b/core/src/test/java/org/marketcetera/event/impl/TradeEventTest.java
@@ -359,7 +359,7 @@ public void withMessageId()
verify(builder);
}
/**
- * Tests {@link TradeEventBuilder#withMultiplier(int)}.
+ * Tests {@link TradeEventBuilder#withMultiplier(BigDecimal)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -407,7 +407,7 @@ public void withPrice()
verify(builder);
}
/**
- * Tests {@link TradeEventBuilder#withTradeDate(String)}.
+ * Tests {@link TradeEventBuilder#withTradeDate(Date)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/marketdata/AbstractMarketDataFeedTest.java b/core/src/test/java/org/marketcetera/marketdata/AbstractMarketDataFeedTest.java
index 255d22c226..2910659bd2 100644
--- a/core/src/test/java/org/marketcetera/marketdata/AbstractMarketDataFeedTest.java
+++ b/core/src/test/java/org/marketcetera/marketdata/AbstractMarketDataFeedTest.java
@@ -1,11 +1,19 @@
package org.marketcetera.marketdata;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.marketcetera.marketdata.AssetClass.EQUITY;
import static org.marketcetera.marketdata.AssetClass.FUTURE;
import static org.marketcetera.marketdata.AssetClass.OPTION;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Semaphore;
@@ -15,7 +23,13 @@
import org.marketcetera.core.IFeedComponentListener;
import org.marketcetera.core.publisher.ISubscriber;
import org.marketcetera.core.publisher.MockSubscriber;
-import org.marketcetera.event.*;
+import org.marketcetera.event.AggregateEvent;
+import org.marketcetera.event.Event;
+import org.marketcetera.event.EventTestBase;
+import org.marketcetera.event.MockAggregateEvent;
+import org.marketcetera.event.MockEvent;
+import org.marketcetera.event.MockEventTranslator;
+import org.marketcetera.event.QuoteEvent;
import org.marketcetera.marketdata.IFeedComponent.FeedType;
import org.marketcetera.marketdata.MarketDataFeedToken.Status;
import org.marketcetera.module.ExpectedFailure;
@@ -690,7 +704,9 @@ public void testParallelExecution()
feed.getCanceledHandles().toArray()));
}
/**
- * Tests feed's ability to return capabilities.
+ * Tests feed's ability to return capabilities.
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void testCapabilities()
diff --git a/core/src/test/java/org/marketcetera/marketdata/DateUtilsTest.java b/core/src/test/java/org/marketcetera/marketdata/DateUtilsTest.java
index dfbf705fd2..74ede87f0a 100644
--- a/core/src/test/java/org/marketcetera/marketdata/DateUtilsTest.java
+++ b/core/src/test/java/org/marketcetera/marketdata/DateUtilsTest.java
@@ -1,7 +1,14 @@
package org.marketcetera.marketdata;
import static org.junit.Assert.assertEquals;
-import static org.marketcetera.marketdata.DateUtils.*;
+import static org.marketcetera.marketdata.DateUtils.DAYS;
+import static org.marketcetera.marketdata.DateUtils.DAYS_WITH_TZ;
+import static org.marketcetera.marketdata.DateUtils.MILLIS;
+import static org.marketcetera.marketdata.DateUtils.MILLIS_WITH_TZ;
+import static org.marketcetera.marketdata.DateUtils.MINUTES;
+import static org.marketcetera.marketdata.DateUtils.MINUTES_WITH_TZ;
+import static org.marketcetera.marketdata.DateUtils.SECONDS;
+import static org.marketcetera.marketdata.DateUtils.SECONDS_WITH_TZ;
import static org.marketcetera.marketdata.Messages.INVALID_DATE;
import java.text.DateFormat;
@@ -18,7 +25,7 @@
/* $License$ */
/**
- * Tests {@link DateUtil}.
+ * Tests {@link DateUtils}.
*
* @author Colin DuPlantis
* @version $Id$
diff --git a/core/src/test/java/org/marketcetera/marketdata/MarketDataModuleTestBase.java b/core/src/test/java/org/marketcetera/marketdata/MarketDataModuleTestBase.java
index c13e5d342b..858ba5d26a 100644
--- a/core/src/test/java/org/marketcetera/marketdata/MarketDataModuleTestBase.java
+++ b/core/src/test/java/org/marketcetera/marketdata/MarketDataModuleTestBase.java
@@ -146,6 +146,8 @@ protected final AbstractMarketDataModuleMXBean getMXBeanProxy()
protected abstract String getProvider();
/**
* Tests that the feed's capabilities match the expected values.
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void capabilities()
diff --git a/core/src/test/java/org/marketcetera/marketdata/MarketDataRequestTest.java b/core/src/test/java/org/marketcetera/marketdata/MarketDataRequestTest.java
index 471ab507d0..3116d73e38 100644
--- a/core/src/test/java/org/marketcetera/marketdata/MarketDataRequestTest.java
+++ b/core/src/test/java/org/marketcetera/marketdata/MarketDataRequestTest.java
@@ -922,7 +922,7 @@ protected void run()
}
/**
* Tests {@link MarketDataRequestBuilder#withContent(String)}, {@link MarketDataRequestBuilder#withContent(String...)},
- * {@link MarketDataRequestBuilder#withContent(Content...), and {@link MarketDataRequestBuilder#withContent(Collection)}.
+ * {@link MarketDataRequestBuilder#withContent(Content...)} and {@link MarketDataRequestBuilder#withContent(Collection)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeed.java b/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeed.java
index 6e4767ba65..feb0b8569e 100644
--- a/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeed.java
+++ b/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeed.java
@@ -83,8 +83,8 @@ public MockMarketDataFeed()
/**
* Create a new TestMarketDataFeed instance.
*
- * @param inFeedType
- * @throws NoMoreIDsException
+ * @param inFeedType a FeedType value
+ * @throws NoMoreIDsException if the feed cannot be constructed
*/
public MockMarketDataFeed(FeedType inFeedType)
throws NoMoreIDsException
@@ -133,7 +133,7 @@ public void setCapabilities(Set inCapabilities)
/**
* Sets the supported asset classes for this feed.
*
- * @param inAssetClasses a Set<AssetClass> value
+ * @param inAssetClasses a Set<AssetClass> value
*/
public void setAssetClasses(Set inAssetClasses)
{
@@ -277,7 +277,7 @@ public boolean getLoginFails()
/**
* Sets the allowLogin value.
*
- * @param a TestMarketDataFeed value
+ * @param inAllowLogin a boolean value
*/
public void setLoginFails(boolean inAllowLogin)
{
@@ -297,7 +297,7 @@ public boolean isInitFails()
/**
* Sets the initFails value.
*
- * @param a TestMarketDataFeed value
+ * @param inInitFails a boolean value
*/
public void setInitFails(boolean inInitFails)
{
@@ -333,7 +333,7 @@ public boolean getExecutionFails()
/**
* Sets the executionFails value.
*
- * @param a TestMarketDataFeed value
+ * @param inExecutionFails a boolean value
*/
public void setExecutionFails(boolean inExecutionFails)
{
@@ -383,7 +383,7 @@ public boolean isCancelFails()
/**
* Sets the cancelFails value.
*
- * @param a TestMarketDataFeed value
+ * @param inCancelFails a boolean value
*/
public void setCancelFails(boolean inCancelFails)
{
@@ -509,7 +509,7 @@ public void submitData(String inHandle,
/**
* Get the timeout value.
*
- * @return a TestMarketDataFeed value
+ * @return a boolean value
*/
public boolean getShouldTimeout()
{
@@ -518,7 +518,7 @@ public boolean getShouldTimeout()
/**
* Sets the timeout value.
*
- * @param a TestMarketDataFeed value
+ * @param inTimeout a boolean value
*/
public void setShouldTimeout(boolean inTimeout)
{
diff --git a/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeedCredentials.java b/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeedCredentials.java
index d7e266fafa..3a3644645e 100644
--- a/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeedCredentials.java
+++ b/core/src/test/java/org/marketcetera/marketdata/MockMarketDataFeedCredentials.java
@@ -20,8 +20,8 @@ public MockMarketDataFeedCredentials()
/**
* Create a new TestMarketDataFeedCredentials instance.
*
- * @param inURL
- * @throws FeedException
+ * @param inURL a String value
+ * @throws FeedException if the credentials cannot be constructed
*/
public MockMarketDataFeedCredentials(String inURL)
throws FeedException
diff --git a/core/src/test/java/org/marketcetera/messagehistory/TradeReportsHistoryTest.java b/core/src/test/java/org/marketcetera/messagehistory/TradeReportsHistoryTest.java
index e5a5904a53..4c8ddb0ae3 100644
--- a/core/src/test/java/org/marketcetera/messagehistory/TradeReportsHistoryTest.java
+++ b/core/src/test/java/org/marketcetera/messagehistory/TradeReportsHistoryTest.java
@@ -942,7 +942,7 @@ public void testChainReplaces() throws Exception {
* with OrdStatus of PARTIALLY_FILLED, FILLED, or PENDING_CANCEL, so that's
* what we do.
*
- * @throws FieldNotFound
+ * @throws Exception if an unexpected error occurs
*/
public void testMerrillPAXIgnoreLastShares() throws Exception {
Message executionReportA = msgFactory
diff --git a/core/src/test/java/org/marketcetera/metrics/InfoTests.java b/core/src/test/java/org/marketcetera/metrics/InfoTests.java
index 2fc3e2d783..5efd61d897 100644
--- a/core/src/test/java/org/marketcetera/metrics/InfoTests.java
+++ b/core/src/test/java/org/marketcetera/metrics/InfoTests.java
@@ -9,7 +9,7 @@
/* $License$ */
/**
- * Tests {@link CheckpointInfo}, {@link IterationInfo} & {@link PerThreadInfo}.
+ * Tests {@link CheckpointInfo}, {@link IterationInfo} & {@link PerThreadInfo}.
*
* @author anshul@marketcetera.com
* @version $Id$
diff --git a/core/src/test/java/org/marketcetera/metrics/PrintStreamFactoryTest.java b/core/src/test/java/org/marketcetera/metrics/PrintStreamFactoryTest.java
index 76e27d48d8..fd9151026e 100644
--- a/core/src/test/java/org/marketcetera/metrics/PrintStreamFactoryTest.java
+++ b/core/src/test/java/org/marketcetera/metrics/PrintStreamFactoryTest.java
@@ -12,7 +12,7 @@
/* $License$ */
/**
- * Tests {@link PrintStreamFactory} subclasses, {@link FileStreamFactory} &
+ * Tests {@link PrintStreamFactory} subclasses, {@link FileStreamFactory} &
* {@link StdErrFactory}
*
* @author anshul@marketcetera.com
diff --git a/core/src/test/java/org/marketcetera/module/DataFlowTest.java b/core/src/test/java/org/marketcetera/module/DataFlowTest.java
index 72a0329987..0e04409e86 100644
--- a/core/src/test/java/org/marketcetera/module/DataFlowTest.java
+++ b/core/src/test/java/org/marketcetera/module/DataFlowTest.java
@@ -97,7 +97,7 @@ protected void run() throws Exception {
}
/**
- * Tests creation & cancellation of simple data flows through the module
+ * Tests creation & cancellation of simple data flows through the module
* manager API.
*
* @throws Exception if there's an unexpected error.
@@ -172,7 +172,7 @@ public void emitFailStoppedFlow() throws Exception {
}
/**
- * Tests creation & cancellation of simple data flows through the
+ * Tests creation & cancellation of simple data flows through the
* data flow support interface.
*
* @throws Exception if there's an unexpected error.
@@ -270,7 +270,7 @@ protected void run() throws Exception {
/**
* Verifies that attempts to invoke data flow setup/cancel APIs, in
* {@link DataFlowSupport}, from within
- * {@link DataEmitter#requestData(DataRequest, DataEmitterSupport)} &
+ * {@link DataEmitter#requestData(DataRequest, DataEmitterSupport)} &
* {@link DataEmitter#cancel(DataFlowID, RequestID)} fails.
*
* @throws Exception if there were errors.
diff --git a/core/src/test/java/org/marketcetera/module/ExpectedFailure.java b/core/src/test/java/org/marketcetera/module/ExpectedFailure.java
index bfec1e99e1..bc6e8b10fe 100644
--- a/core/src/test/java/org/marketcetera/module/ExpectedFailure.java
+++ b/core/src/test/java/org/marketcetera/module/ExpectedFailure.java
@@ -198,7 +198,7 @@ protected ExpectedFailure(String inMessage, boolean inExactMatch)
/**
* Subclasses should implement this method to execute
* code that is expected to fail with the exception of type
- * T
+ * T
*
* @throws Exception if there's a failure.
*/
@@ -215,7 +215,7 @@ private void doRun() throws Exception {
run();
fail("Didn't fail!");
} catch(Exception t) {
- Class expected = getExceptionClass();
+ Class> expected = getExceptionClass();
assertTrue("Expected<" + expected + ">Actual<"+t.getClass()+">" + t,
expected.isInstance(t));
mException = (T) t;
@@ -236,9 +236,9 @@ private void doRun() throws Exception {
*
* @return the expected exception type.
*/
- private Class getExceptionClass() {
+ private Class> getExceptionClass() {
ParameterizedType pt;
- Class cls = getClass();
+ Class> cls = getClass();
//find the direct sub-class of this class
while(!ExpectedFailure.class.equals(cls.getSuperclass())) {
cls = cls.getSuperclass();
@@ -246,7 +246,7 @@ private Class getExceptionClass() {
pt = (ParameterizedType) cls.getGenericSuperclass();
Type[] t = pt.getActualTypeArguments();
assertEquals(1, t.length);
- return (Class) t[0];
+ return (Class>) t[0];
}
private I18NMessage mExpectedMessage;
private Object[] mExpectedParams;
@@ -259,5 +259,6 @@ private Class getExceptionClass() {
* {@link #assertI18NException(Throwable, I18NMessage, Object[])} or
* {@link #ExpectedFailure(I18NMessage, Object[])}
*/
+ @SuppressWarnings("serial")
public static final Serializable IGNORE = new Serializable(){};
}
diff --git a/core/src/test/java/org/marketcetera/module/LifecycleTest.java b/core/src/test/java/org/marketcetera/module/LifecycleTest.java
index e1418ffb45..34b8d76c95 100644
--- a/core/src/test/java/org/marketcetera/module/LifecycleTest.java
+++ b/core/src/test/java/org/marketcetera/module/LifecycleTest.java
@@ -20,7 +20,7 @@
/* $License$ */
/**
- * Tests Module provider and module lifecycle & information reporting.
+ * Tests Module provider and module lifecycle & information reporting.
*
* @author anshul@marketcetera.com
*/
diff --git a/core/src/test/java/org/marketcetera/module/ModuleConcurrencyTest.java b/core/src/test/java/org/marketcetera/module/ModuleConcurrencyTest.java
index f4931b53c1..b926662395 100644
--- a/core/src/test/java/org/marketcetera/module/ModuleConcurrencyTest.java
+++ b/core/src/test/java/org/marketcetera/module/ModuleConcurrencyTest.java
@@ -1,22 +1,27 @@
package org.marketcetera.module;
-import org.marketcetera.util.misc.ClassVersion;
-import org.marketcetera.util.misc.NamedThreadFactory;
-import org.marketcetera.util.log.I18NMessage0P;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Before;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.concurrent.*;
import java.util.Arrays;
-import java.util.Set;
import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.marketcetera.util.log.I18NMessage0P;
+import org.marketcetera.util.misc.ClassVersion;
+import org.marketcetera.util.misc.NamedThreadFactory;
/* $License$ */
/**
@@ -271,7 +276,7 @@ protected void run() throws Exception {
}
/**
- * Tests locking & module operations when module start takes a long time
+ * Tests locking & module operations when module start takes a long time
* to complete and succeeds.
*
* @throws Exception if there were errors.
@@ -301,7 +306,7 @@ public void moduleBlockedPreStartPass() throws Exception {
getManager().deleteModule(urn);
}
/**
- * Tests locking & module operations when module start takes a long time
+ * Tests locking & module operations when module start takes a long time
* to complete and fails.
*
* @throws Exception if there were errors.
@@ -333,7 +338,7 @@ protected void run() throws Exception {
getManager().deleteModule(urn);
}
/**
- * Tests locking & module operations when module's setFlowSupport
+ * Tests locking & module operations when module's setFlowSupport
* API takes a lot of time. Do note that setFlowSupport is meant
* to be doing anything complicated. This unit test is there to
* verify that the system is robust enough to deal with a rogue
@@ -367,7 +372,7 @@ public void moduleBlockedSetFlowSupport() throws Exception {
}
/**
- * Verifies locking & module operations when stopping module instances.
+ * Verifies locking & module operations when stopping module instances.
*
* @throws Exception if there were errors
*/
@@ -394,7 +399,7 @@ public void moduleBlockedPreStopPass() throws Exception {
}
/**
- * Verifies locking & module operations when stopping module instance fails.
+ * Verifies locking & module operations when stopping module instance fails.
*
* @throws Exception if there were errors
*/
@@ -1224,8 +1229,8 @@ private DataFlowID[] subtract(DataFlowID[] inFrom, DataFlowID[]inValue) {
set.removeAll(Arrays.asList(inValue));
return set.toArray(new DataFlowID[set.size()]);
}
- private ExpectedFailure createFlowFailure(final ModuleURN inURN,
- ModuleState inExpectedState)
+ private ExpectedFailure createFlowFailure(final ModuleURN inURN,
+ ModuleState inExpectedState)
throws Exception {
return new ExpectedFailure(
Messages.DATAFLOW_FAILED_PCPT_MODULE_STATE_INCORRECT,
@@ -1238,8 +1243,8 @@ protected void run() throws Exception {
}
};
}
- private ExpectedFailure createDeleteFailure(final ModuleURN inUrn,
- Object inExpectedState)
+ private ExpectedFailure createDeleteFailure(final ModuleURN inUrn,
+ Object inExpectedState)
throws Exception {
return new ExpectedFailure(
Messages.DELETE_FAILED_MODULE_STATE_INCORRECT, inUrn.toString(),
@@ -1250,8 +1255,8 @@ protected void run() throws Exception {
}
};
}
- private ExpectedFailure createStopFailure(final ModuleURN inUrn,
- Object inExpectedState)
+ private ExpectedFailure createStopFailure(final ModuleURN inUrn,
+ Object inExpectedState)
throws Exception {
return new ExpectedFailure(
Messages.MODULE_NOT_STOPPED_STATE_INCORRECT, inUrn.toString(),
@@ -1261,8 +1266,8 @@ protected void run() throws Exception {
}
};
}
- private ExpectedFailure createStartFailure(final ModuleURN inUrn,
- Object inExpectedState)
+ private ExpectedFailure createStartFailure(final ModuleURN inUrn,
+ Object inExpectedState)
throws Exception {
return new ExpectedFailure(
Messages.MODULE_NOT_STARTED_STATE_INCORRECT, inUrn.toString(),
diff --git a/core/src/test/java/org/marketcetera/module/ProviderLoadTest.java b/core/src/test/java/org/marketcetera/module/ProviderLoadTest.java
index f076c5d0fb..872b2d53d7 100644
--- a/core/src/test/java/org/marketcetera/module/ProviderLoadTest.java
+++ b/core/src/test/java/org/marketcetera/module/ProviderLoadTest.java
@@ -1,14 +1,17 @@
package org.marketcetera.module;
-import org.marketcetera.marketdata.MockMarketDataFeedModuleFactory;
-import org.marketcetera.util.misc.ClassVersion;
-import org.junit.Test;
-import org.junit.After;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
-import java.util.regex.Pattern;
-import java.util.ServiceConfigurationError;
import java.io.IOException;
+import java.util.ServiceConfigurationError;
+import java.util.regex.Pattern;
+
+import org.junit.After;
+import org.junit.Test;
+import org.marketcetera.marketdata.MockMarketDataFeedModuleFactory;
+import org.marketcetera.util.misc.ClassVersion;
/* $License$ */
/**
@@ -23,7 +26,7 @@ public void cleanup() throws Exception {
mManager.stop();
}
/**
- * Tests various failures in {@link ModuleManager#init()} &
+ * Tests various failures in {@link ModuleManager#init()} &
* {@link ModuleManager#refresh()}
* and their expected behavior.
*
diff --git a/core/src/test/java/org/marketcetera/options/ExpirationTypeTest.java b/core/src/test/java/org/marketcetera/options/ExpirationTypeTest.java
index 6d0ba4626a..2abeac43cf 100644
--- a/core/src/test/java/org/marketcetera/options/ExpirationTypeTest.java
+++ b/core/src/test/java/org/marketcetera/options/ExpirationTypeTest.java
@@ -21,7 +21,7 @@ public class ExpirationTypeTest
/**
* Tests {@link ExpirationType#getExpirationTypeForChar(char)}.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void getByChar()
diff --git a/core/src/test/java/org/marketcetera/options/OptionUtilsTest.java b/core/src/test/java/org/marketcetera/options/OptionUtilsTest.java
index 2ea31997fe..c46c9a00f0 100644
--- a/core/src/test/java/org/marketcetera/options/OptionUtilsTest.java
+++ b/core/src/test/java/org/marketcetera/options/OptionUtilsTest.java
@@ -3,7 +3,6 @@
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.marketcetera.trade.OptionType.Call;
import static org.marketcetera.trade.OptionType.Put;
import static org.marketcetera.trade.OptionType.Unknown;
@@ -12,6 +11,7 @@
import java.text.DecimalFormatSymbols;
import java.util.Locale;
+import org.hamcrest.MatcherAssert;
import org.junit.Ignore;
import org.junit.Test;
import org.marketcetera.module.ExpectedFailure;
@@ -30,7 +30,7 @@
public class OptionUtilsTest {
/**
- * Verifies {@link OptionUtils#normalizeEquityOptionExpiry(String)} &
+ * Verifies {@link OptionUtils#normalizeEquityOptionExpiry(String)} &
* {@link OptionUtils#normalizeUSEquityOptionExpiry(String)}.
*
* @throws Exception if there were unexpected errors
@@ -65,8 +65,8 @@ protected void run() throws Exception {
}
private void assertNormalized(String expiry, String expected) {
- assertThat(OptionUtils.normalizeUSEquityOptionExpiry(expiry), is(expected));
- assertThat(OptionUtils.normalizeEquityOptionExpiry(expiry), is(expected));
+ MatcherAssert.assertThat(OptionUtils.normalizeUSEquityOptionExpiry(expiry), is(expected));
+ MatcherAssert.assertThat(OptionUtils.normalizeEquityOptionExpiry(expiry), is(expected));
}
/**
diff --git a/core/src/test/java/org/marketcetera/quickfix/DecimalFieldTest.java b/core/src/test/java/org/marketcetera/quickfix/DecimalFieldTest.java
index c95f31cd25..e91d97a00a 100644
--- a/core/src/test/java/org/marketcetera/quickfix/DecimalFieldTest.java
+++ b/core/src/test/java/org/marketcetera/quickfix/DecimalFieldTest.java
@@ -1,19 +1,18 @@
package org.marketcetera.quickfix;
-import org.marketcetera.core.MarketceteraTestSuite;
+import java.math.BigDecimal;
+
import org.marketcetera.core.ClassVersion;
+import org.marketcetera.core.MarketceteraTestSuite;
import org.marketcetera.trade.Equity;
import junit.framework.Test;
import junit.framework.TestCase;
-
-import java.math.BigDecimal;
-
import quickfix.Message;
+import quickfix.field.OrderQty;
+import quickfix.field.Price;
import quickfix.field.Side;
import quickfix.field.TimeInForce;
-import quickfix.field.Price;
-import quickfix.field.OrderQty;
/**
* Verify that the round-tripping of BigDecimals works with QFJ
@@ -35,7 +34,9 @@ public static Test suite() {
/** Verify that the round-tripping of BigDecimals works with QFJ
* this is testing the fix for bug QFJ-300 (http://www.quickfixj.org/jira/browse/QFJ-300)
- * */
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testQFJ_BigDecimal() throws Exception {
BigDecimal originalPrice = new BigDecimal("10.3000"); //$NON-NLS-1$
assertEquals(4, originalPrice.scale());
diff --git a/core/src/test/java/org/marketcetera/quickfix/FIXMessageFactoryTest.java b/core/src/test/java/org/marketcetera/quickfix/FIXMessageFactoryTest.java
index 0927b87bc1..2f565969bd 100644
--- a/core/src/test/java/org/marketcetera/quickfix/FIXMessageFactoryTest.java
+++ b/core/src/test/java/org/marketcetera/quickfix/FIXMessageFactoryTest.java
@@ -107,6 +107,8 @@ public void testNewBasicOrder() throws FieldNotFound {
/** Verify that if we include a "failing" order as a Text reason in a reject,
* the SOH fields get appropriately escaped
+ *
+ * @throws Exception if an unexpected error occurs
*/
public void testNewOrderCancelReject_escapesSOH() throws Exception {
Message basicOrder = msgFactory.newBasicOrder();
diff --git a/core/src/test/java/org/marketcetera/quickfix/FIXMessageUtilTest.java b/core/src/test/java/org/marketcetera/quickfix/FIXMessageUtilTest.java
index 84e626e76a..c5252a839b 100644
--- a/core/src/test/java/org/marketcetera/quickfix/FIXMessageUtilTest.java
+++ b/core/src/test/java/org/marketcetera/quickfix/FIXMessageUtilTest.java
@@ -10,8 +10,6 @@
import java.util.HashSet;
import java.util.List;
-import junit.framework.Test;
-
import org.marketcetera.core.ClassVersion;
import org.marketcetera.core.CoreException;
import org.marketcetera.core.ExpectedTestFailure;
@@ -21,6 +19,9 @@
import org.marketcetera.trade.Equity;
import org.marketcetera.trade.Instrument;
+import com.google.common.collect.Lists;
+
+import junit.framework.Test;
import quickfix.DataDictionary;
import quickfix.FieldNotFound;
import quickfix.Group;
@@ -66,8 +67,6 @@
import quickfix.field.Text;
import quickfix.field.TimeInForce;
import quickfix.field.TransactTime;
-
-import com.google.common.collect.Lists;
/* $License$ */
/**
* @author Graham Miller
@@ -115,7 +114,11 @@ public void testNewLimitOrder() throws Exception {
assertEquals(timeInForce, aMessage.getChar(TimeInForce.FIELD));
}
- /** want to test the case where price is specified or NULL (market orders) */
+ /**
+ * Want to test the case where price is specified or NULL (market orders).
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testNewExecutionReport() throws Exception {
String clOrderID = "asdf"; //$NON-NLS-1$
String orderID = "bob"; //$NON-NLS-1$
@@ -167,11 +170,20 @@ BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, new Equity("
}
}
- /** Creates a NewOrderSingle */
- public static Message createNOS(String symbol, BigDecimal price, BigDecimal qty, char side, FIXMessageFactory msgFactory)
+ /**
+ * Creates a NewOrderSingle.
+ *
+ * @param inSymbol a String value
+ * @param inPrice a BigDecimal value
+ * @param inQuantity a BigDecimal value
+ * @param inSideChar a char value
+ * @param inMessageFactory a FIXMessageFactory value
+ * @return a quickfix.Message value
+ */
+ public static Message createNOS(String inSymbol, BigDecimal inPrice, BigDecimal inQuantity, char inSideChar, FIXMessageFactory inMessageFactory)
{
- Message newSingle = createNOSHelper(symbol, qty, side, new OrdType(OrdType.LIMIT), msgFactory);
- newSingle.setField(new Price(price));
+ Message newSingle = createNOSHelper(inSymbol, inQuantity, inSideChar, new OrdType(OrdType.LIMIT), inMessageFactory);
+ newSingle.setField(new Price(inPrice));
return newSingle;
}
@@ -190,16 +202,32 @@ public static Message createOptionNOS(String optionRoot,
return newSingle;
}
- /** This actually creats a NewOrderSingle with a *set* OrderID - which isn't how
+ /**
+ * This actually creates a NewOrderSingle with a *set* OrderID - which isn't how
* it comes in through FIX connection originallY
+ *
+ * @param symbol a String value
+ * @param qty a BigDecimal value
+ * @param side a char value
+ * @param msgFactory a FIXMessageFactory value
+ * @return a quickfix.Message value
*/
- public static Message createMarketNOS(String symbol, BigDecimal qty, char side, FIXMessageFactory msgFactory)
+ public static quickfix.Message createMarketNOS(String symbol, BigDecimal qty, char side, FIXMessageFactory msgFactory)
{
return createNOSHelper(symbol, qty, side, new OrdType(OrdType.MARKET), msgFactory);
}
- /** This needs to be modeled off {@link FIXMessageFactory#newOrderHelper} */
- public static Message createNOSHelper(String symbol, BigDecimal qty, char side, OrdType ordType, FIXMessageFactory msgFactory)
+ /**
+ * This needs to be modeled off FIXMessageFactory#newOrderHelper.
+ *
+ * @param symbol a String value
+ * @param qty a BigDecimal value
+ * @param side a char value
+ * @param ordType an OrdType value
+ * @param msgFactory a FIXMessageFactory value
+ * @return a quickfix.Message value
+ */
+ public static quickfix.Message createNOSHelper(String symbol, BigDecimal qty, char side, OrdType ordType, FIXMessageFactory msgFactory)
{
long suffix = System.currentTimeMillis();
Message newSingle = msgFactory.newBasicOrder();
@@ -218,7 +246,25 @@ public static Message createNOSHelper(String symbol, BigDecimal qty, char side,
return newSingle;
}
- /** Verifies that the message is a "virgin" executionReport (no half-fills, etc) for a given symbol/side */
+ /**
+ * Verifies that the message is a "virgin" executionReport (no half-fills, etc) for a given symbol/side.
+ *
+ * @param inExecReport a quickfix.Message value
+ * @param qty a String value
+ * @param symbol a String value
+ * @param side a char value
+ * @param leavesQty a BigDecimal value
+ * @param lastQty a BigDecimal value
+ * @param cumQty a BigDecimal value
+ * @param lastPrice a BigDecimal value
+ * @param avgPrice a BigDecimal value
+ * @param ordStatus a char value
+ * @param execType a char value
+ * @param execTransType a char value
+ * @param msgFactory a FIXMessageFactory value
+ * @param fixDD a FIXDataDictionary value
+ * @throws Exception if the execution report cannot be verified
+ */
public static void verifyExecutionReport(Message inExecReport, String qty, String symbol, char side, BigDecimal leavesQty,
BigDecimal lastQty, BigDecimal cumQty, BigDecimal lastPrice,
BigDecimal avgPrice, char ordStatus, char execType, char execTransType,
@@ -254,7 +300,17 @@ public static void verifyExecutionReport(Message inExecReport, String qty, Strin
}
- /** Useful for verifying execReports for new orders - assumes nothing is filled */
+ /**
+ * Useful for verifying execReports for new orders - assumes nothing is filled.
+ *
+ * @param inExecReport a quickfix.Message value
+ * @param qty a String value
+ * @param symbol a String value
+ * @param side a char value
+ * @param msgFactory a FIXMessageFactory value
+ * @param fixDD a FIXDataDictionary value
+ * @throws Exception if the report cannot be verified
+ */
public static void verifyExecutionReport(Message inExecReport, String qty, String symbol, char side,
FIXMessageFactory msgFactory, FIXDataDictionary fixDD) throws Exception
{
@@ -400,7 +456,7 @@ protected void run()
/** Takes 2 messages A and B (outgoing and existing), and tries to extract required fields
* necessary in A from B
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
public void testFillFieldsFromExistingMessage() throws Exception {
Message buy = createNOS("GAP", new BigDecimal("23.45"), new BigDecimal("2385"), Side.BUY, msgFactory); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -507,10 +563,10 @@ public void testGetCorrelationField() throws Exception {
/**
* Test that trailing zeroes are preserved in decimal fields of QuickFIX messages
- * @throws InvalidMessage
- * @throws FieldNotFound
+ * @throws Exception if an unexpected error occurs
*/
- public void testTrailingZeroesAssumption() throws InvalidMessage, FieldNotFound
+ public void testTrailingZeroesAssumption()
+ throws Exception
{
String noZeroes = "1.111"; //$NON-NLS-1$
String twoZeroes = "1.100"; //$NON-NLS-1$
diff --git a/core/src/test/java/org/marketcetera/quickfix/messagefactory/FIXMessageAugmentor_43Test.java b/core/src/test/java/org/marketcetera/quickfix/messagefactory/FIXMessageAugmentor_43Test.java
index 1166ab39c9..9e601cb08d 100644
--- a/core/src/test/java/org/marketcetera/quickfix/messagefactory/FIXMessageAugmentor_43Test.java
+++ b/core/src/test/java/org/marketcetera/quickfix/messagefactory/FIXMessageAugmentor_43Test.java
@@ -33,7 +33,11 @@ public void testCountTT_applicableTypes() throws Exception {
assertEquals(30, new FIXMessageAugmentor_43().getApplicableMsgTypes().size());
}
- /** Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does. */
+ /**
+ * Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testMarketOnClose() throws Exception {
FIXMessageFactory factory = FIXVersion.FIX43.getMessageFactory();
Message buy = FIXMessageUtilTest.createMarketNOS("TOLI", new BigDecimal("123"), Side.BUY, factory); //$NON-NLS-1$ //$NON-NLS-2$
@@ -54,7 +58,11 @@ public void testMarketOnClose() throws Exception {
assertEquals(TimeInForce.DAY, buy.getChar(TimeInForce.FIELD));
}
- /** Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does. */
+ /**
+ * Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testLimitOnClose() throws Exception {
FIXMessageFactory factory = FIXVersion.FIX43.getMessageFactory();
Message buy = FIXMessageUtilTest.createNOS("TOLI", new BigDecimal("123"), new BigDecimal("100"), Side.BUY, factory); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -75,7 +83,11 @@ public void testLimitOnClose() throws Exception {
assertEquals(TimeInForce.DAY, buy.getChar(TimeInForce.FIELD));
}
- /** Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does. */
+ /**
+ * Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testMarketOnClose_cxr() throws Exception {
FIXMessageFactory factory = FIXVersion.FIX43.getMessageFactory();
Message buy = FIXMessageUtilTest.createMarketNOS("TOLI", new BigDecimal("123"), Side.BUY, factory); //$NON-NLS-1$ //$NON-NLS-2$
@@ -98,7 +110,11 @@ public void testMarketOnClose_cxr() throws Exception {
assertEquals(TimeInForce.DAY, cancelReplace.getChar(TimeInForce.FIELD));
}
- /** Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does. */
+ /**
+ * Verify that we undo whatever changes the {@link FIXMessageAugmentor_40} does.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testLimitOnClose_cxr() throws Exception {
FIXMessageFactory factory = FIXVersion.FIX43.getMessageFactory();
Message buy = FIXMessageUtilTest.createNOS("TOLI", new BigDecimal("123"), new BigDecimal("100"), Side.BUY, factory); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
diff --git a/core/src/test/java/org/marketcetera/trade/OrderCancelTest.java b/core/src/test/java/org/marketcetera/trade/OrderCancelTest.java
index 72d2ba0fb3..14b290c687 100644
--- a/core/src/test/java/org/marketcetera/trade/OrderCancelTest.java
+++ b/core/src/test/java/org/marketcetera/trade/OrderCancelTest.java
@@ -282,7 +282,11 @@ protected void run() throws Exception {
};
}
- /** verify custom fields are preserved, and that nothing else is added from the execution report */
+ /**
+ * Verify custom fields are preserved, and that nothing else is added from the execution report
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void testSecurityExchangePreserved() throws Exception {
Message erMsg = FIXVersion.FIX42.getMessageFactory().newExecutionReport("orderID", "clOrderID", "execID",
diff --git a/core/src/test/java/org/marketcetera/trade/OrderReplaceTest.java b/core/src/test/java/org/marketcetera/trade/OrderReplaceTest.java
index c2ae2dd93f..550a56b335 100644
--- a/core/src/test/java/org/marketcetera/trade/OrderReplaceTest.java
+++ b/core/src/test/java/org/marketcetera/trade/OrderReplaceTest.java
@@ -15,12 +15,32 @@
import org.junit.Test;
import org.marketcetera.event.HasFIXMessage;
import org.marketcetera.module.ExpectedFailure;
-import org.marketcetera.quickfix.*;
+import org.marketcetera.quickfix.CurrentFIXDataDictionary;
+import org.marketcetera.quickfix.FIXDataDictionary;
+import org.marketcetera.quickfix.FIXDataDictionaryManager;
+import org.marketcetera.quickfix.FIXMessageFactory;
+import org.marketcetera.quickfix.FIXVersion;
import org.marketcetera.util.misc.ClassVersion;
import quickfix.FieldNotFound;
import quickfix.Message;
-import quickfix.field.*;
+import quickfix.field.AllocAccount;
+import quickfix.field.AllocQty;
+import quickfix.field.AvgPx;
+import quickfix.field.BeginString;
+import quickfix.field.CumQty;
+import quickfix.field.ExpireTime;
+import quickfix.field.HandlInst;
+import quickfix.field.LeavesQty;
+import quickfix.field.MsgType;
+import quickfix.field.OrdStatus;
+import quickfix.field.OrdType;
+import quickfix.field.OrigClOrdID;
+import quickfix.field.Price;
+import quickfix.field.Product;
+import quickfix.field.SecurityExchange;
+import quickfix.field.SettlType;
+import quickfix.field.SolicitedFlag;
import quickfix.field.converter.BooleanConverter;
import quickfix.field.converter.UtcTimestampConverter;
import quickfix.fix44.OrderCancelReplaceRequest;
@@ -363,7 +383,11 @@ private void checkSetters(OrderReplace inOrder) {
checkNRSetters(inOrder);
checkRelatedOrderSetters(inOrder);
}
- /** verify custom fields are preserved, and that nothing else is added from the execution report */
+ /**
+ * Verify custom fields are preserved, and that nothing else is added from the execution report
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void testSecurityExchangePreserved() throws Exception {
Message erMsg = FIXVersion.FIX42.getMessageFactory().newExecutionReport("orderID", "clOrderID", "execID", //$NON-NLS-1$
@@ -380,11 +404,14 @@ BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, new Equity("
assertEquals("has extra fields: "+ Arrays.toString(replace.getCustomFields().keySet().toArray()), 1, replace.getCustomFields().size());
}
- @Test
- /** Create ER for previous order that has OrderID of 12345
+ /**
+ * Create ER for previous order that has OrderID of 12345
* Set an OrigClOrdID on it of 12222
* Create a replace form this ER, the OrigClOrdID should be 12345, not the "very original" of 12222
+ *
+ * @throws Exception if an unexpected error occurs
*/
+ @Test
public void testCreateOrderReplace() throws Exception {
Message erMsg = FIXVersion.FIX42.getMessageFactory().newExecutionReport("7600", "12345", "execID", //$NON-NLS-1$
OrdStatus.NEW, Side.Buy.getFIXValue(), new BigDecimal("10"), new BigDecimal("100.23"),
diff --git a/core/src/test/java/org/marketcetera/trade/utils/OrderHistoryManagerTest.java b/core/src/test/java/org/marketcetera/trade/utils/OrderHistoryManagerTest.java
index fc9af4c9d7..ab6f2f8cd0 100644
--- a/core/src/test/java/org/marketcetera/trade/utils/OrderHistoryManagerTest.java
+++ b/core/src/test/java/org/marketcetera/trade/utils/OrderHistoryManagerTest.java
@@ -38,6 +38,9 @@
import org.marketcetera.util.log.SLF4JLoggerProxy;
import org.marketcetera.util.test.CollectionAssert;
+import com.google.common.collect.LinkedHashMultimap;
+import com.google.common.collect.Multimap;
+
import quickfix.Message;
import quickfix.field.AvgPx;
import quickfix.field.ClOrdID;
@@ -62,9 +65,6 @@
import quickfix.field.TargetCompID;
import quickfix.field.TransactTime;
-import com.google.common.collect.LinkedHashMultimap;
-import com.google.common.collect.Multimap;
-
/* $License$ */
/**
@@ -553,7 +553,7 @@ public void testOrderChain()
assertTrue(report6OrderChain.isEmpty());
}
/**
- * Tests {@link LiveOrderHistoryManager#getOpenOrders()}.
+ * Tests {@link OrderHistoryManager#getOpenOrders()}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/dare/src/main/java/org/marketcetera/ors/filters/ConditionalFieldRemoverMessageModifier.java b/dare/src/main/java/org/marketcetera/ors/filters/ConditionalFieldRemoverMessageModifier.java
index e84e0fa908..b7da0324a1 100644
--- a/dare/src/main/java/org/marketcetera/ors/filters/ConditionalFieldRemoverMessageModifier.java
+++ b/dare/src/main/java/org/marketcetera/ors/filters/ConditionalFieldRemoverMessageModifier.java
@@ -21,19 +21,15 @@
/**
* Removes fields based on conditions.
- *
*/
@ClassVersion("$Id$")
public class ConditionalFieldRemoverMessageModifier
implements MessageModifier
{
- private int conditionalField;
-
- private List matchCriteria;
-
/**
* Create a new ConditionalFieldRemoverMessageModifier instance.
*
+ * @param skipField a boolean value
*/
public ConditionalFieldRemoverMessageModifier(String skipField)
{
@@ -61,52 +57,49 @@ public boolean modifyMessage(Message inMessage,
FIXMessageAugmentor inAugmentor)
throws CoreException
{
- boolean isModified = false;
+ boolean isModified = false;
boolean matchFlag = false;
-
- if(inMessage.isSetField(conditionalField))
- {
- String matcherValue = null;
- try {
- matcherValue = inMessage.getString(conditionalField);
- } catch (FieldNotFound e) {
- e.printStackTrace();
- }
- for(String value: matchCriteria)
- {
- if(value.equals(matcherValue)){
- matchFlag = true;
- break;
- }
- }
+ if(inMessage.isSetField(conditionalField)) {
+ String matcherValue = null;
+ try {
+ matcherValue = inMessage.getString(conditionalField);
+ } catch (FieldNotFound e) {
+ SLF4JLoggerProxy.warn(this,
+ e);
+ }
+ for(String value: matchCriteria) {
+ if(value.equals(matcherValue)){
+ matchFlag = true;
+ break;
+ }
+ }
}
-
if(matchFlag){
- if(msgType != null &&
- inMessage.isSetField(field)) {
- SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
- "Message contains field {}", //$NON-NLS-1$
- field);
- if(msgType.equals(allMessageIndicator)) {
- SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
- "Message type specifier is 'all messages', removing field"); //$NON-NLS-1$
- inMessage.removeField(field);
- isModified = true;
- } else {
- MsgType thisMessageType = new MsgType();
- try {
- inMessage.getHeader().getField(thisMessageType);
- } catch (FieldNotFound e) {
- throw new CoreException(e);
- }
- if(thisMessageType.valueEquals(msgType)) {
- SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
- "Message type specified matches message, removing field"); //$NON-NLS-1$
- inMessage.removeField(field);
- isModified = true;
- }
- }
- }
+ if(msgType != null &&
+ inMessage.isSetField(field)) {
+ SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
+ "Message contains field {}", //$NON-NLS-1$
+ field);
+ if(msgType.equals(allMessageIndicator)) {
+ SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
+ "Message type specifier is 'all messages', removing field"); //$NON-NLS-1$
+ inMessage.removeField(field);
+ isModified = true;
+ } else {
+ MsgType thisMessageType = new MsgType();
+ try {
+ inMessage.getHeader().getField(thisMessageType);
+ } catch (FieldNotFound e) {
+ throw new CoreException(e);
+ }
+ if(thisMessageType.valueEquals(msgType)) {
+ SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
+ "Message type specified matches message, removing field"); //$NON-NLS-1$
+ inMessage.removeField(field);
+ isModified = true;
+ }
+ }
+ }
}
if(isModified) {
SLF4JLoggerProxy.debug(ConditionalFieldRemoverMessageModifier.class,
@@ -143,16 +136,33 @@ public String toString()
msgType).append("Field", //$NON-NLS-1$
field).toString();
}
-
-
- public void setConditionalField(int conditionalField) {
- this.conditionalField = conditionalField;
- }
- public void setMatchCriteria(List matchCriteria) {
- this.matchCriteria = matchCriteria;
- }
-
- /**
+ /**
+ * Set the conditional field value.
+ *
+ * @param conditionalField an int value
+ */
+ public void setConditionalField(int conditionalField)
+ {
+ this.conditionalField = conditionalField;
+ }
+ /**
+ * Set the match criteria value.
+ *
+ * @param matchCriteria a List<String> value
+ */
+ public void setMatchCriteria(List matchCriteria)
+ {
+ this.matchCriteria = matchCriteria;
+ }
+ /**
+ * conditional field value
+ */
+ private int conditionalField;
+ /**
+ * match criteria value
+ */
+ private List matchCriteria;
+ /**
* FIX message code of the messages to modify
*/
private final String msgType;
diff --git a/dare/src/main/java/org/marketcetera/ors/filters/MessageModifier.java b/dare/src/main/java/org/marketcetera/ors/filters/MessageModifier.java
index df37d76ae1..898e1aa632 100644
--- a/dare/src/main/java/org/marketcetera/ors/filters/MessageModifier.java
+++ b/dare/src/main/java/org/marketcetera/ors/filters/MessageModifier.java
@@ -5,9 +5,6 @@
import org.marketcetera.quickfix.messagefactory.FIXMessageAugmentor;
import org.marketcetera.util.misc.ClassVersion;
-
-import quickfix.Message;
-
/**
* Interface for all custom order modifiers that can be created by
* Marketcetera Platform users, added to the ORS to be executed
@@ -16,20 +13,19 @@
* containing the value of the {@link quickfix.field.Symbol} field.
*/
@ClassVersion("$Id$")
-public interface MessageModifier {
-
+public interface MessageModifier
+{
/**
* Implement the function to make in-line modifications to the incoming message.
*
- *
* @param message the message to be modified
+ * @param historyServices provides report history services
* @param augmentor FIX-version specific augmentor to apply to this message
* @return true if the modifier has modified the message, false otherwise
- * @throws CoreException
+ * @throws CoreException if the message coupld not be modified
*/
- public boolean modifyMessage
- (Message message,
- ReportHistoryServices historyServices,
- FIXMessageAugmentor augmentor)
+ public boolean modifyMessage(quickfix.Message message,
+ ReportHistoryServices historyServices,
+ FIXMessageAugmentor augmentor)
throws CoreException;
}
diff --git a/dare/src/main/java/org/marketcetera/ors/filters/MessageModifierManager.java b/dare/src/main/java/org/marketcetera/ors/filters/MessageModifierManager.java
index ceb8260f9f..fa39a19901 100644
--- a/dare/src/main/java/org/marketcetera/ors/filters/MessageModifierManager.java
+++ b/dare/src/main/java/org/marketcetera/ors/filters/MessageModifierManager.java
@@ -27,14 +27,18 @@ public class MessageModifierManager {
private List messageModifiers;
public void setMessageModifiers(List mods){
- messageModifiers = new LinkedList();
- for (MessageModifier mod : mods) {
- messageModifiers.add(mod);
- }
- messageModifiers.add(new TransactionTimeInsertMessageModifier());
+ messageModifiers = new LinkedList();
+ for (MessageModifier mod : mods) {
+ messageModifiers.add(mod);
+ }
+ messageModifiers.add(new TransactionTimeInsertMessageModifier());
}
-
- /** Apply all the order modifiers to this message */
+ /**
+ * Apply all the order modifiers to this message
+ *
+ * @param info a RequestInfo value
+ * @throws I18NException if an error occurs modifying the message
+ */
public void modifyMessage(RequestInfo info)
throws I18NException
{
diff --git a/dare/src/main/java/org/marketcetera/ors/mbeans/ORSAdminMBean.java b/dare/src/main/java/org/marketcetera/ors/mbeans/ORSAdminMBean.java
index 5c43745a0a..8d0ca481bb 100644
--- a/dare/src/main/java/org/marketcetera/ors/mbeans/ORSAdminMBean.java
+++ b/dare/src/main/java/org/marketcetera/ors/mbeans/ORSAdminMBean.java
@@ -2,22 +2,26 @@
import org.marketcetera.core.ClassVersion;
+@ClassVersion("$Id$")
/**
* MBean interface for ORS operations.
+ *
* @author toli
* @version $Id$
*/
-
-@ClassVersion("$Id$")
-public interface ORSAdminMBean {
-
- /** Sends a {@link quickfix.fix44.UserRequest} message containing the password reset message */
+public interface ORSAdminMBean
+{
+ /**
+ * Sends a {@link quickfix.fix44.UserRequest} message containing the password reset message.
+ *
+ * @param broker a String value
+ * @param oldPassword a String value
+ * @param newPassword a String value
+ */
public void sendPasswordReset(String broker, String oldPassword, String newPassword);
-
/**
* Syncs up the in-memory sessions to reflect the current user
* definitions in the database.
*/
-
public void syncSessions();
}
diff --git a/dare/src/main/java/org/marketcetera/ors/ws/ServiceProvider.java b/dare/src/main/java/org/marketcetera/ors/ws/ServiceProvider.java
index 03c166cf8a..33e1a47f68 100644
--- a/dare/src/main/java/org/marketcetera/ors/ws/ServiceProvider.java
+++ b/dare/src/main/java/org/marketcetera/ors/ws/ServiceProvider.java
@@ -176,7 +176,6 @@ public BrokersStatus getBrokersStatus(String inUsername)
*
* @param inUserId a UserID value
* @return a UserInfo value
- * @throws PersistenceException
*/
public UserInfo getUserInfo(UserID inUserId)
{
diff --git a/dare/src/test/java/org/marketcetera/admin/AdminRpcServiceTest.java b/dare/src/test/java/org/marketcetera/admin/AdminRpcServiceTest.java
index 786a2d2b2f..0d077b1228 100644
--- a/dare/src/test/java/org/marketcetera/admin/AdminRpcServiceTest.java
+++ b/dare/src/test/java/org/marketcetera/admin/AdminRpcServiceTest.java
@@ -12,11 +12,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.marketcetera.admin.AdminClient;
-import org.marketcetera.admin.AdminClientFactory;
-import org.marketcetera.admin.AdminPermissions;
-import org.marketcetera.admin.Permission;
-import org.marketcetera.admin.PermissionFactory;
import org.marketcetera.admin.rpc.AdminRpcService;
import org.marketcetera.fix.ActiveFixSession;
import org.marketcetera.module.ExpectedFailure;
@@ -71,7 +66,7 @@ public void teardown()
}
}
/**
- * Test {@link AdminClient#getPermissionsForUsername(String)}.
+ * Test {@link AdminClient#getPermissionsForCurrentUser()}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -123,7 +118,7 @@ protected void run()
adminClient.readUsers().size());
}
/**
- * Test {@link AdminClient#updateUser(String, org.marketcetera.ors.security.SimpleUser)}.
+ * Test {@link AdminClient#updateUser(String, User)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -152,7 +147,7 @@ protected void run()
assertFalse("updated-description".equals(user.getDescription()));
}
/**
- * Test {@link AdminClient#createUser(SimpleUser, String)}.
+ * Test {@link AdminClient#createUser(User, String)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/dare/src/test/java/org/marketcetera/test/MarketceteraTestBase.java b/dare/src/test/java/org/marketcetera/test/MarketceteraTestBase.java
index 73ef069bfc..e5a2d038ad 100644
--- a/dare/src/test/java/org/marketcetera/test/MarketceteraTestBase.java
+++ b/dare/src/test/java/org/marketcetera/test/MarketceteraTestBase.java
@@ -786,10 +786,10 @@ protected void assertNew(Message inMessage)
/**
* Assert that the given message is a proper status message.
*
- * @param inStatusMessage a Message value
- * @throws Exception
+ * @param inStatusMessage a quickfix.Message value
+ * @throws Exception if the message is not a proper status message
*/
- protected void assertStatus(Message inStatusMessage)
+ protected void assertStatus(quickfix.Message inStatusMessage)
throws Exception
{
DataDictionary dataDictionary = FIXMessageUtil.getDataDictionary(inStatusMessage);
@@ -1210,9 +1210,10 @@ protected BrokerID getBrokerIdFor(SessionID inSessionId)
/**
* Verify that the given message is marked as a possible duplicate.
*
- * @param inMessage a Message value
+ * @param inMessage a quickfix.Message value
+ * @throws Exception if the given message is not marked as a possible duplicate
*/
- protected void verifyPossDup(Message inMessage)
+ protected void verifyPossDup(quickfix.Message inMessage)
throws Exception
{
assertTrue("PossDup(" + quickfix.field.PossDupFlag.FIELD + ") not set on " + inMessage,
@@ -1500,16 +1501,17 @@ protected static Message buildMessage(String inHeaderFields,
/**
* Waits for the next message to be received by the receiver and verifies it is of the given type.
*
+ * @param inSessionId a quickfix.SessionID value
* @param inMsgType a String value
- * @return a Message value
+ * @return a quickfix.Message value
* @throws Exception if an unexpected error occurs
*/
- protected Message waitForAndVerifySenderMessage(SessionID inSessionId,
- String inMsgType)
+ protected quickfix.Message waitForAndVerifySenderMessage(quickfix.SessionID inSessionId,
+ String inMsgType)
throws Exception
{
long start = System.currentTimeMillis();
- Message senderMessage = null;
+ quickfix.Message senderMessage = null;
while(senderMessage == null && System.currentTimeMillis()<(start+waitPeriod)) {
senderMessage = receiver.getNextApplicationMessage(inSessionId);
Thread.sleep(100);
@@ -1613,28 +1615,27 @@ protected static Message generateExecutionReport(Message inOrder,
inFactory);
}
/**
- *
- *
+ * Generate an execution report with the given values.
*
- * @param inOrder
- * @param inPriceQtyInfo
- * @param inClOrdId
- * @param inOrigClOrdId
- * @param inOrderId
- * @param inOrderStatus
- * @param inExecutionType
- * @param inFactory
- * @return
- * @throws Exception
+ * @param inOrder a quickfix.Message value
+ * @param inPriceQtyInfo an OrderData value
+ * @param inOrderId a String value
+ * @param inClOrdId a String value
+ * @param inOrigClOrdId a String value or null
+ * @param inOrderStatus an OrderStatus value
+ * @param inExecutionType an ExecutionType value
+ * @param inFactory a FIXMessageFactory value
+ * @return a quickfix.Message value
+ * @throws Exception if the message could not be generated
*/
- protected static Message generateExecutionReport(Message inOrder,
- OrderData inPriceQtyInfo,
- String inOrderId,
- String inClOrdId,
- String inOrigClOrdId,
- org.marketcetera.trade.OrderStatus inOrderStatus,
- ExecutionType inExecutionType,
- FIXMessageFactory inFactory)
+ protected static quickfix.Message generateExecutionReport(quickfix.Message inOrder,
+ OrderData inPriceQtyInfo,
+ String inOrderId,
+ String inClOrdId,
+ String inOrigClOrdId,
+ org.marketcetera.trade.OrderStatus inOrderStatus,
+ ExecutionType inExecutionType,
+ FIXMessageFactory inFactory)
throws Exception
{
boolean commaNeeded = false;
@@ -1707,6 +1708,13 @@ protected static Message generateOrderCancelReject(Message inMessage,
MsgType.ORDER_CANCEL_REJECT,
inFactory);
}
+ /**
+ * Tracks an order and its subsequent executions.
+ *
+ * @author Colin DuPlantis
+ * @version $Id$
+ * @since $Release$
+ */
public class CalculatedOrderData
{
/**
@@ -1721,13 +1729,12 @@ public void add(BigDecimal inPrice,
tuples.add(new PriceQtyTuple(inPrice,inQty));
}
/**
- *
- *
+ * Add an Execution Report to the calculated order data.
*
- * @param inExecution
- * @throws Exception
+ * @param inExecution a quickfix.Message value
+ * @throws Exception if the execution could not be processed
*/
- public void addExecution(Message inExecution)
+ public void addExecution(quickfix.Message inExecution)
throws Exception
{
if(inExecution.isSetField(quickfix.field.LastPx.FIELD) && inExecution.isSetField(quickfix.field.LastQty.FIELD)) {
@@ -1842,12 +1849,13 @@ public void setOrderQuantity(BigDecimal inOrderQuantity)
/**
* Generate an order status request for the given order sent from the given session.
*
- * @param inOrderMessage a Message value
- * @param inSessionId a SessionID value
- * @return a Message value
+ * @param inOrderMessage a quickfix.Message value
+ * @param inSessionId a quickfix.SessionID value
+ * @return a quickfix.Message value
+ * @throws Exception if the order status request could not be generated
*/
- public Message generateOrderStatusRequest(Message inOrderMessage,
- SessionID inSessionId)
+ public quickfix.Message generateOrderStatusRequest(quickfix.Message inOrderMessage,
+ quickfix.SessionID inSessionId)
throws Exception
{
FIXVersion version = FIXVersion.getFIXVersion(inOrderMessage);
@@ -2081,14 +2089,13 @@ public Message generateAndSendOrderCanceReject(Message inMessage,
return report;
}
/**
- *
- *
+ * Generate and send a replaced ack for the given message.
*
- * @param inMessage
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @return a quickfix.Message value
+ * @throws Exception if the ack could not be generated or sent
*/
- public Message generateAndSendReplaceAck(Message inMessage)
+ public quickfix.Message generateAndSendReplaceAck(quickfix.Message inMessage)
throws Exception
{
return generateAndSendReport(inMessage,
@@ -2096,18 +2103,17 @@ public Message generateAndSendReplaceAck(Message inMessage)
ExecutionType.Replace);
}
/**
- *
+ * Generate and send an execution report based on the given message.
*
- *
- * @param inMessage
- * @param inOrderStatus
- * @param inExecutionType
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @param inOrderStatus an OrderStatus value
+ * @param inExecutionType an ExecutionType value
+ * @return a quickfix.Message value
+ * @throws Exception if the report could not be generated or sent
*/
- public Message generateAndSendReport(Message inMessage,
- OrderStatus inOrderStatus,
- ExecutionType inExecutionType)
+ public quickfix.Message generateAndSendReport(quickfix.Message inMessage,
+ OrderStatus inOrderStatus,
+ ExecutionType inExecutionType)
throws Exception
{
FIXVersion version = FIXVersion.getFIXVersion(receiverSessionId.getBeginString());
@@ -2129,16 +2135,13 @@ public Message generateAndSendReport(Message inMessage,
return report;
}
/**
- *
- *
+ * Generate and send an ack for the given message.
*
- * @param inMessage
- * @param inOrderStatus
- * @param inExecutionType
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @return a quickfix.Message value
+ * @throws Exception if the message cannot be generated or sent
*/
- public Message generateAndSendAck(Message inMessage)
+ public quickfix.Message generateAndSendAck(quickfix.Message inMessage)
throws Exception
{
return generateAndSendReport(inMessage,
@@ -2146,16 +2149,13 @@ public Message generateAndSendAck(Message inMessage)
ExecutionType.New);
}
/**
- *
- *
+ * Generate and send a canceled ack based on the given message.
*
- * @param inMessage
- * @param inOrderStatus
- * @param inExecutionType
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @return a quickfix.Message value
+ * @throws Exception if the message could not be generated or sent
*/
- public Message generateAndSendCancelAck(Message inMessage)
+ public quickfix.Message generateAndSendCancelAck(quickfix.Message inMessage)
throws Exception
{
return generateAndSendReport(inMessage,
@@ -2163,23 +2163,22 @@ public Message generateAndSendCancelAck(Message inMessage)
ExecutionType.Canceled);
}
/**
- *
- *
+ * Generate and send a replace message based on the given attributes.
*
- * @param inMessage
- * @param inOrderPrice
- * @param inOrderQuantity
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @param inOrderPrice a BigDecimal value
+ * @param inOrderQuantity a BigDecimal value
+ * @return a quickfix.Message value
+ * @throws Exception if the message could not be generated or sent
*/
- public Message generateAndSendReplace(Message inMessage,
- BigDecimal inOrderPrice,
- BigDecimal inOrderQuantity)
+ public quickfix.Message generateAndSendReplace(quickfix.Message inMessage,
+ BigDecimal inOrderPrice,
+ BigDecimal inOrderQuantity)
throws Exception
{
FIXVersion version = FIXVersion.getFIXVersion(senderSessionId.getBeginString());
FIXMessageFactory factory = version.getMessageFactory();
- Message replace = factory.createMessage(quickfix.field.MsgType.ORDER_CANCEL_REPLACE_REQUEST);
+ quickfix.Message replace = factory.createMessage(quickfix.field.MsgType.ORDER_CANCEL_REPLACE_REQUEST);
FIXMessageUtil.copyFields(replace,
inMessage);
replace.setField(new quickfix.field.OrigClOrdID(inMessage.getString(quickfix.field.ClOrdID.FIELD)));
@@ -2196,18 +2195,18 @@ public Message generateAndSendReplace(Message inMessage,
return replace;
}
/**
+ * Generate and send a cancel based on the given message.
*
- *
- * @param inMessage
- * @return
- * @throws Exception
+ * @param inMessage a quickfix.Message value
+ * @return a quickfix.Message value
+ * @throws Exception if the cancel could not be generated or sent
*/
- public Message generateAndSendCancel(Message inMessage)
+ public quickfix.Message generateAndSendCancel(quickfix.Message inMessage)
throws Exception
{
FIXVersion version = FIXVersion.getFIXVersion(senderSessionId.getBeginString());
FIXMessageFactory factory = version.getMessageFactory();
- Message cancel = factory.createMessage(quickfix.field.MsgType.ORDER_CANCEL_REQUEST);
+ quickfix.Message cancel = factory.createMessage(quickfix.field.MsgType.ORDER_CANCEL_REQUEST);
FIXMessageUtil.copyFields(cancel,
inMessage);
cancel.setField(new quickfix.field.OrigClOrdID(inMessage.getString(quickfix.field.ClOrdID.FIELD)));
@@ -2216,49 +2215,49 @@ public Message generateAndSendCancel(Message inMessage)
cancel.removeField(quickfix.field.OrdType.FIELD);
cancel.removeField(quickfix.field.Price.FIELD);
orderMessages.add(cancel);
- Session.sendToTarget(cancel,
- senderSessionId);
+ quickfix.Session.sendToTarget(cancel,
+ senderSessionId);
return cancel;
}
/**
- *
+ * Generate an order for the given instrument.
*
- * @param inInstrument
- * @return
- * @throws Exception
+ * @param inInstrument an Instrument value
+ * @return a quickfix.Message value
+ * @throws Exception if the order could not be generated
*/
- public Message generateOrder(Instrument inInstrument)
+ public quickfix.Message generateOrder(Instrument inInstrument)
throws Exception
{
- return super.generateOrder(inInstrument,
- senderSessionId);
+ return generateOrder(inInstrument,
+ senderSessionId);
}
/**
* Generate an order using the given instrument.
*
* @param inInstrument an Instrument value
- * @return a Message value
+ * @return a quickfix.Message value
* @throws Exception if an unexpected error occurs
*/
- public Message generateAndSendOrder(Instrument inInstrument)
+ public quickfix.Message generateAndSendOrder(Instrument inInstrument)
throws Exception
{
- Message order = generateOrder(inInstrument);
+ quickfix.Message order = generateOrder(inInstrument);
sendOrder(order);
return order;
}
/**
* Send the given order to the sender session.
*
- * @param inOrder a Message value
+ * @param inOrder a quickfix.Message value
* @return a boolean value indicating if the order was queued and sent or not
* @throws Exception if an unexpected error occurs
*/
- public boolean sendOrder(Message inOrder)
+ public boolean sendOrder(quickfix.Message inOrder)
throws Exception
{
- return Session.sendToTarget(inOrder,
- senderSessionId);
+ return quickfix.Session.sendToTarget(inOrder,
+ senderSessionId);
}
/**
*
@@ -2300,24 +2299,42 @@ public Message waitForSenderMessage(String inMsgType)
inMsgType);
}
/**
+ * Waits for and verifies the next sender message against the given expected message.
*
- *
- * @param inSenderMessage
- * @return a Message value
- * @throws Exception
+ * @param inExpectedMessage a quickfix.Message value
+ * @return a quickfix.Message value
+ * @throws Exception if the message is not verified in a reasonable period of time
*/
- public Message waitForAndVerifySenderMessage(Message inSenderMessage)
+ public quickfix.Message waitForAndVerifySenderMessage(quickfix.Message inExpectedMessage)
throws Exception
{
return MarketceteraTestBase.this.waitForAndVerifySenderMessage(initiatorSessionId,
- inSenderMessage.getHeader().getString(MsgType.FIELD));
+ inExpectedMessage.getHeader().getString(MsgType.FIELD));
}
+ /**
+ * index of this acceptor session
+ */
private final int acceptorSessionIndex;
+ /**
+ * index of this initiator session
+ */
private final int initiatorSessionIndex;
- private final SessionID senderSessionId;
- private final SessionID receiverSessionId;
- private final SessionID acceptorSessionId;
- private final SessionID initiatorSessionId;
+ /**
+ * sender session id value
+ */
+ private final quickfix.SessionID senderSessionId;
+ /**
+ * received session id value
+ */
+ private final quickfix.SessionID receiverSessionId;
+ /**
+ * acceptor session id value
+ */
+ private final quickfix.SessionID acceptorSessionId;
+ /**
+ * initiator session id value
+ */
+ private final quickfix.SessionID initiatorSessionId;
}
/**
* listens for reports
diff --git a/dare/src/test/java/org/marketcetera/test/TestDirectoryManager.java b/dare/src/test/java/org/marketcetera/test/TestDirectoryManager.java
index 937fcc2ac0..62ff5be8bd 100644
--- a/dare/src/test/java/org/marketcetera/test/TestDirectoryManager.java
+++ b/dare/src/test/java/org/marketcetera/test/TestDirectoryManager.java
@@ -22,7 +22,7 @@ public class TestDirectoryManager
/**
* Get the testDirectories value.
*
- * @return a List value
+ * @return a List<String> value
*/
public List getTestDirectories()
{
@@ -31,7 +31,7 @@ public List getTestDirectories()
/**
* Sets the testDirectories value.
*
- * @param inTestDirectories a List value
+ * @param inTestDirectories a List<String> value
*/
public void setTestDirectories(List inTestDirectories)
{
@@ -40,7 +40,7 @@ public void setTestDirectories(List inTestDirectories)
/**
* Get the deleteDirectories value.
*
- * @return a List value
+ * @return a List<String> value
*/
public List getDeleteDirectories()
{
@@ -49,7 +49,7 @@ public List getDeleteDirectories()
/**
* Sets the deleteDirectories value.
*
- * @param inDeleteDirectories a List value
+ * @param inDeleteDirectories a List<String> value
*/
public void setDeleteDirectories(List inDeleteDirectories)
{
diff --git a/fix/fix-acceptor/src/main/java/org/marketcetera/fix/acceptor/DynamicAcceptorSessionProvider.java b/fix/fix-acceptor/src/main/java/org/marketcetera/fix/acceptor/DynamicAcceptorSessionProvider.java
index 015dc62b8f..c956843fb0 100644
--- a/fix/fix-acceptor/src/main/java/org/marketcetera/fix/acceptor/DynamicAcceptorSessionProvider.java
+++ b/fix/fix-acceptor/src/main/java/org/marketcetera/fix/acceptor/DynamicAcceptorSessionProvider.java
@@ -38,6 +38,7 @@ public class DynamicAcceptorSessionProvider
* @param inApplication an Application value
* @param inSessionService a SessionService value
* @param inFixSettingsProviderFactory a FixSettingsProviderFactory value
+ * @param inClusterData a ClusterData value
*/
public DynamicAcceptorSessionProvider(Application inApplication,
SessionService inSessionService,
diff --git a/fix/fix-core/src/main/java/org/marketcetera/fix/dao/PersistentFixMessage.java b/fix/fix-core/src/main/java/org/marketcetera/fix/dao/PersistentFixMessage.java
index e7722b393f..d54ae3e970 100644
--- a/fix/fix-core/src/main/java/org/marketcetera/fix/dao/PersistentFixMessage.java
+++ b/fix/fix-core/src/main/java/org/marketcetera/fix/dao/PersistentFixMessage.java
@@ -8,9 +8,6 @@
import org.marketcetera.fix.FixMessage;
import org.marketcetera.persist.EntityBase;
-
-import quickfix.Message;
-
/* $License$ */
/**
@@ -35,7 +32,7 @@ public PersistentFixMessage()
/**
* Create a new PersistentFixMessage instance.
*
- * @param inFixMessage
+ * @param inFixMessage a FixMessage value
*/
public PersistentFixMessage(FixMessage inFixMessage)
{
@@ -44,9 +41,9 @@ public PersistentFixMessage(FixMessage inFixMessage)
/**
* Create a new PersistentFixMessage instance.
*
- * @param inMessage a Message value
+ * @param inMessage a quickfix.Message value
*/
- public PersistentFixMessage(Message inMessage)
+ public PersistentFixMessage(quickfix.Message inMessage)
{
message = inMessage.toString();
}
@@ -70,7 +67,7 @@ public void setMessage(String inMessage)
* @see com.marketcetera.ors.history.FixMessage#setMessage(quickfix.Message)
*/
@Override
- public void setMessage(Message inMessage)
+ public void setMessage(quickfix.Message inMessage)
{
message = inMessage.toString();
}
diff --git a/fork/commons-csv/pom.xml b/fork/commons-csv/pom.xml
index f23c32fac3..7fcac6fb42 100644
--- a/fork/commons-csv/pom.xml
+++ b/fork/commons-csv/pom.xml
@@ -104,14 +104,14 @@
-
+
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/CSVParser.java b/fork/commons-csv/src/java/org/apache/commons/csv/CSVParser.java
index 258fa7d17f..88c54c95c5 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/CSVParser.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/CSVParser.java
@@ -17,9 +17,9 @@
package org.apache.commons.csv;
import java.io.IOException;
-import java.io.Reader;
-import java.io.InputStreamReader;
import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
import java.util.ArrayList;
@@ -75,7 +75,7 @@ public class CSVParser {
// the following objects are shared to reduce garbage
/** A record buffer for getLine(). Grows as necessary and is reused. */
- private final ArrayList record = new ArrayList();
+ private final ArrayList record = new ArrayList<>();
private final Token reusableToken = new Token();
private final CharBuffer wsBuf = new CharBuffer();
private final CharBuffer code = new CharBuffer(4);
@@ -184,7 +184,7 @@ public CSVParser(Reader input, CSVStrategy strategy) {
* @throws IOException on parse error or input read-failure
*/
public String[][] getAllValues() throws IOException {
- ArrayList records = new ArrayList();
+ ArrayList records = new ArrayList<>();
String[] values;
String[][] ret = null;
while ((values = getLine()) != null) {
@@ -288,6 +288,9 @@ public int getLineNumber() {
/**
* Convenience method for nextToken(null).
+ *
+ * @return a Token value
+ * @throws IOException if an error occurs generating the next token
*/
protected Token nextToken() throws IOException {
return nextToken(new Token());
@@ -563,6 +566,7 @@ private int readEscape(int c) throws IOException {
/**
* Sets the specified CSV Strategy
*
+ * @param strategy a CSVStrategy value
* @return current instance of CSVParser to allow chained method calls
* @deprecated the strategy should be set in the constructor {@link #CSVParser(Reader,CSVStrategy)}.
*/
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/CSVPrinter.java b/fork/commons-csv/src/java/org/apache/commons/csv/CSVPrinter.java
index a57d03aef8..644f50150f 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/CSVPrinter.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/CSVPrinter.java
@@ -69,6 +69,7 @@ public CSVPrinter(Writer out) {
/**
* Sets the specified CSV Strategy
*
+ * @param strategy a CSVStrategy value
* @return current instance of CSVParser to allow chained method calls
*/
public CSVPrinter setStrategy(CSVStrategy strategy) {
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/CSVStrategy.java b/fork/commons-csv/src/java/org/apache/commons/csv/CSVStrategy.java
index 1b04d68b68..b22bb388da 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/CSVStrategy.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/CSVStrategy.java
@@ -24,7 +24,7 @@
* Represents the strategy for a CSV.
*/
public class CSVStrategy implements Cloneable, Serializable {
-
+ private static final long serialVersionUID = -451433279415143890L;
private char delimiter;
private char encapsulator;
private char commentStart;
@@ -59,8 +59,10 @@ public CSVStrategy(char delimiter, char encapsulator, char commentStart) {
* @param delimiter a Char used for value separation
* @param encapsulator a Char used as value encapsulation marker
* @param commentStart a Char used for comment identification
+ * @param escape a Char used to escape other chars
* @param ignoreLeadingWhitespace TRUE when leading whitespaces should be
* ignored
+ * @param ignoreTrailingWhitespace TRUE when trailing whitespaces should be ignored
* @param interpretUnicodeEscapes TRUE when unicode escapes should be
* interpreted
* @param ignoreEmptyLines TRUE when the parser should skip emtpy lines
@@ -84,8 +86,17 @@ public CSVStrategy(
setUnicodeEscapeInterpretation(interpretUnicodeEscapes);
setIgnoreEmptyLines(ignoreEmptyLines);
}
-
- /** @deprecated */
+ /**
+ * Create a new CSVStrategy instance.
+ *
+ * @param delimiter a char value
+ * @param encapsulator a char value
+ * @param commentStart a char value
+ * @param ignoreLeadingWhitespace a boolean value
+ * @param interpretUnicodeEscapes a boolean value
+ * @param ignoreEmptyLines a boolean value
+ * @deprecated use {@link CSVStrategy#CSVStrategy(char, char, char, char, boolean, boolean, boolean, boolean) instead}
+ */
public CSVStrategy(
char delimiter,
char encapsulator,
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/CharBuffer.java b/fork/commons-csv/src/java/org/apache/commons/csv/CharBuffer.java
index c44b2641ff..1dadee8399 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/CharBuffer.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/CharBuffer.java
@@ -46,6 +46,8 @@ public CharBuffer() {
/**
* Creates a new CharBuffer with an initial capacity
* of length characters.
+ *
+ * @param length an int value
*/
public CharBuffer(final int length) {
if (length == 0) {
@@ -171,7 +173,7 @@ public void trimTrailingWhitespace() {
* modifying it.
* This method allows to avoid copying if the caller knows the exact capacity
* before.
- * @return
+ * @return a char[] value
*/
public char[] getCharacters() {
if (c.length == length) {
@@ -182,9 +184,12 @@ public char[] getCharacters() {
return chars;
}
- /**
- * Returns the character at the specified position.
- */
+ /**
+ * Returns the character at the specified position.
+ *
+ * @param pos an int value
+ * @return a char value
+ */
public char charAt(int pos) {
return c[pos];
}
@@ -192,7 +197,8 @@ public char charAt(int pos) {
/**
* Converts the contents of the buffer into a StringBuffer.
* This method involves copying the new data once!
- * @return
+ *
+ * @return a StringBuffer value
*/
public StringBuffer toStringBuffer() {
StringBuffer sb = new StringBuffer(length);
@@ -203,7 +209,8 @@ public StringBuffer toStringBuffer() {
/**
* Converts the contents of the buffer into a StringBuffer.
* This method involves copying the new data once!
- * @return
+ *
+ * @return a String value
*/
public String toString() {
return new String(c, 0, length);
@@ -211,7 +218,8 @@ public String toString() {
/**
* Copies the data into a new array of at least capacity size.
- * @param capacity
+ *
+ * @param capacity an int value
*/
public void provideCapacity(final int capacity) {
if (c.length >= capacity) {
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfig.java b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfig.java
index c1611e0b16..8d2ae3f146 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfig.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfig.java
@@ -278,7 +278,7 @@ public boolean isEndTrimmed() {
/**
* Specify if the end of the line needs to be trimmed. Defaults to false.
- * @param endTrimmed
+ * @param endTrimmed a boolean value
*/
public void setEndTrimmed(boolean endTrimmed) {
this.endTrimmed = endTrimmed;
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfigGuesser.java b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfigGuesser.java
index 00c590baa3..99379c18d8 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfigGuesser.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVConfigGuesser.java
@@ -38,9 +38,8 @@ public class CSVConfigGuesser {
private boolean hasFieldHeader = false;
/** The found config */
protected CSVConfig config;
-
/**
- *
+ * Create a new CSVConfigGuesser instance.
*/
public CSVConfigGuesser() {
this.config = new CSVConfig();
@@ -115,7 +114,7 @@ protected void analyseLines(String[] lines) {
/**
* Guess if this file is fixedwidth.
* Just basing the fact on all lines being of the same length
- * @param lines
+ * @param lines a String[] value
*/
protected void guessFixedWidth(String[] lines) {
int lastLength = 0;
diff --git a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVField.java b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVField.java
index a2f8ee43de..9adade7b2e 100644
--- a/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVField.java
+++ b/fork/commons-csv/src/java/org/apache/commons/csv/writer/CSVField.java
@@ -20,6 +20,7 @@
/**
+ * Represents a single CSV field.
*
* @version $Id$
*/
@@ -31,7 +32,7 @@ public class CSVField {
private boolean overrideFill;
/**
- *
+ * Create a new CSVField instance.
*/
public CSVField() {
}
@@ -103,7 +104,7 @@ public void setFill(int fill) {
/**
* Does this field override fill ?
*
- * @return
+ * @return a boolean value
*/
public boolean overrideFill() {
return overrideFill;
diff --git a/fork/commons-i18n/src/test/org/apache/commons/i18n/MessageProviderTestBase.java b/fork/commons-i18n/src/test/org/apache/commons/i18n/MessageProviderTestBase.java
index 19698cedd2..6ce99e2289 100644
--- a/fork/commons-i18n/src/test/org/apache/commons/i18n/MessageProviderTestBase.java
+++ b/fork/commons-i18n/src/test/org/apache/commons/i18n/MessageProviderTestBase.java
@@ -27,8 +27,8 @@
* If creating new implementations, consider subclassing this class to test the behaviour of that implementation.
* The tests assume the provided MessageProvider
* contains the following entries:
- *
- *
+ *
+ *
*
*
Language/Locale
*
ID
@@ -70,7 +70,7 @@
*
This entry is not translated to any other languages
*
*
- *
+ *
* Specifically, the ID nonExistentId and the entry nonExistentEntry of ID
* helloWorld must NOT be existent.
*/
@@ -102,7 +102,7 @@ public void tearDown() throws Exception {
/**
* Test functionality of getText() method, which should be common for all implementations of the
* MessageProvider interface.
- * @param messageProvider
+ * @param messageProvider a MessageProvider value
*/
protected void testGetText(MessageProvider messageProvider) {
// Explicit default locale
@@ -195,7 +195,7 @@ protected void testGetEntries(MessageProvider messageProvider, boolean hasNonTra
}
private static void assertEnglishEntries(MessageProvider messageProvider, Locale locale, boolean hasNonTranslatedEntry) {
- Map entries = messageProvider.getEntries("helloWorld", locale);
+ Map,?> entries = messageProvider.getEntries("helloWorld", locale);
if(hasNonTranslatedEntry) {
assertEquals("Locale = " + locale + ", No of entries", 3, entries.size());
assertEquals("Locale = " + locale, "This entry is not translated to any other languages",
@@ -208,7 +208,7 @@ private static void assertEnglishEntries(MessageProvider messageProvider, Locale
}
private static void assertGermanEntries(MessageProvider messageProvider, Locale locale) {
- Map entries = messageProvider.getEntries("helloWorld", locale);
+ Map,?> entries = messageProvider.getEntries("helloWorld", locale);
// TODO: Consider whether all MessageProviders must behave the same way
if(entries.size() == 3) // If non-translated entries included
diff --git a/fork/commons-i18n/src/test/org/apache/commons/i18n/MockProviderTestBase.java b/fork/commons-i18n/src/test/org/apache/commons/i18n/MockProviderTestBase.java
index ca2424f1d7..479f215676 100644
--- a/fork/commons-i18n/src/test/org/apache/commons/i18n/MockProviderTestBase.java
+++ b/fork/commons-i18n/src/test/org/apache/commons/i18n/MockProviderTestBase.java
@@ -17,12 +17,12 @@
*/
package org.apache.commons.i18n;
-import junit.framework.TestCase;
-
+import java.text.MessageFormat;
+import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
-import java.util.HashMap;
-import java.text.MessageFormat;
+
+import junit.framework.TestCase;
/**
* The MockProviderTestBase class serves as a base class for test cases using a mock
@@ -43,9 +43,10 @@ public void tearDown() {
protected void addMockProvider() {
addMockProvider("mock");
}
-
/**
* Add mock provider to MessageManager.
+ *
+ * @param providerId a String value
*/
protected void addMockProvider(final String providerId) {
// Mock message provider that returns a string made up of the arguments passed to it.
@@ -54,8 +55,8 @@ public String getText(String id, String entry, Locale locale) throws MessageNotF
return MockProviderTestBase.getMockString(providerId, id, entry, locale);
}
- public Map getEntries(String id, Locale locale) throws MessageNotFoundException {
- Map output = new HashMap();
+ public Map getEntries(String id, Locale locale) throws MessageNotFoundException {
+ Map output = new HashMap<>();
output.put("entry1", MockProviderTestBase.getMockString(providerId,id,"entry1",locale));
output.put("entry2", MockProviderTestBase.getMockString(providerId,id,"entry2",locale));
return output;
@@ -74,7 +75,7 @@ public String getText(String id, String entry, Locale locale) throws MessageNotF
return null;
}
- public Map getEntries(String id, Locale locale) throws MessageNotFoundException {
+ public Map getEntries(String id, Locale locale) throws MessageNotFoundException {
throw new MessageNotFoundException("Mock exception from getEntries()");
}
});
@@ -98,10 +99,10 @@ public static String getMockString(String id, String entry, Locale locale) throw
}
public static String getFormattedMockString(String providerId, String id, String entry, String[] arguments, Locale locale) {
- return MessageFormat.format(getMockString(providerId, id, entry, locale), arguments);
+ return MessageFormat.format(getMockString(providerId, id, entry, locale), (Object[])arguments);
}
public static String getFormattedMockString(String id, String entry, String[] arguments, Locale locale) {
- return MessageFormat.format(getMockString(id, entry, locale), arguments);
+ return MessageFormat.format(getMockString(id, entry, locale), (Object[])arguments);
}
}
diff --git a/fork/commons-i18n/src/test/org/apache/commons/i18n/XMLMessageProviderTest.java b/fork/commons-i18n/src/test/org/apache/commons/i18n/XMLMessageProviderTest.java
index 9d488e5682..b24d70dccf 100644
--- a/fork/commons-i18n/src/test/org/apache/commons/i18n/XMLMessageProviderTest.java
+++ b/fork/commons-i18n/src/test/org/apache/commons/i18n/XMLMessageProviderTest.java
@@ -108,6 +108,8 @@ public void testGetEntries() {
/**
* Constructor for MessageManagerTest.
+ *
+ * @param testName a String value
*/
public XMLMessageProviderTest(String testName) {
super(testName);
diff --git a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/EsperModuleTest.java b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/EsperModuleTest.java
index faa9151d1d..330b26637c 100644
--- a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/EsperModuleTest.java
+++ b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/EsperModuleTest.java
@@ -58,7 +58,7 @@ protected Class> getIncorrectQueryException() {
/**
* We have the following data flow:
- * CopierModule --> CEP --> Sink
+ * CopierModule --> CEP --> Sink
* Feed 3 events into copier (which just re-emits it), and then test that it goes through to the Sink via Esper
*
* @throws Exception if there were unexpected errors.
@@ -92,8 +92,10 @@ public void testBasicFlow() throws Exception {
sManager.cancel(flowID);
}
- /** Create a data flow where you subscribe to 2 types of events, but only the last one
- * should result in statements being received
+ /**
+ * Create a data flow where you subscribe to 2 types of events, but only the last one should result in statements being received.
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout=120000)
public void testOnlyLastStatementGetsSubscriber() throws Exception {
@@ -115,9 +117,12 @@ public void testOnlyLastStatementGetsSubscriber() throws Exception {
sManager.cancel(flowID);
}
- /** Create one data flow, send events, make sure they come through
+ /**
+ * Create one data flow, send events, make sure they come through
* Then cancel it, create similar data flow, send same events, but make sure
- * only the laste subscriptions get hits
+ * only the last subscriptions get hits
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout=120000)
public void testEsperCancel() throws Exception {
@@ -202,7 +207,11 @@ protected void execute() throws Throwable {
}.run();
}
- /** Verify that when you send a query of N steps, where a non-first step is invalid, all N statements are cleaned up */
+ /**
+ * Verify that when you send a query of N steps, where a non-first step is invalid, all N statements are cleaned up.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testAllStatementsCleanedUpIfOneHasError() throws Exception {
// first create a valid statement
@@ -232,10 +241,11 @@ protected void execute() throws Throwable {
assertEquals("invalid # of statements"+ Arrays.toString(esperBean.getStatementNames()), 1, esperBean.getStatementNames().length);
sManager.cancel(flow);
}
-
-
- /** do a pattern query and make sure we get something reasonable back
- p:every ask(symbol="IBM") where timer:within(10 seconds)
+ /**
+ * do a pattern query and make sure we get something reasonable back
+ * p:every ask(symbol="IBM") where timer:within(10 seconds)
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout=120000)
public void testPattern() throws Exception {
@@ -256,8 +266,11 @@ public void testPattern() throws Exception {
assertTrue("Didn't wait longer than 10 secs: "+(timeEnd-timeStart), timeEnd - timeStart > 10*1000);
sManager.cancel(flow);
}
-
- /** Create an explicit pattern (instead of using p:query that results in createPattern call) */
+ /**
+ * Create an explicit pattern (instead of using p:query that results in createPattern call)
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void testPattern_explicit() throws Exception {
diff --git a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/ExternalTimeTest.java b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/ExternalTimeTest.java
index fcb4cfb4cf..8c9bb85fb3 100644
--- a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/ExternalTimeTest.java
+++ b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/ExternalTimeTest.java
@@ -62,6 +62,7 @@ public void after() throws Exception {
* t+year+1day: 2 events (3rd and 4th)
* t+year+15days: 0 events (window reset), followed by 1 event (new window established)
*
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout = 2*60*1000)
public void testExternalTime() throws Exception {
diff --git a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/SelfRepostingEventsTest.java b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/SelfRepostingEventsTest.java
index c8362963e7..6999810cd5 100644
--- a/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/SelfRepostingEventsTest.java
+++ b/modules/cep/esper/src/test/java/org/marketcetera/modules/cep/esper/SelfRepostingEventsTest.java
@@ -47,6 +47,8 @@ public void after() throws Exception {
* Setup a data flow where 1st esper instance feeds data into the same Esper instance multiple times
* So feed it a custom class, then grab an individual getter method on that until we get something in the end
* and verify that comes through correctly.
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout = 2*60*1000)
public void testSelfRepostingEvents() throws Exception {
diff --git a/modules/cep/system/src/test/java/org/marketcetera/modules/cep/system/CEPTestBase.java b/modules/cep/system/src/test/java/org/marketcetera/modules/cep/system/CEPTestBase.java
index 9cee5d0337..9042028a8a 100644
--- a/modules/cep/system/src/test/java/org/marketcetera/modules/cep/system/CEPTestBase.java
+++ b/modules/cep/system/src/test/java/org/marketcetera/modules/cep/system/CEPTestBase.java
@@ -152,8 +152,11 @@ protected void execute() throws Throwable {
}
}.run();
}
-
- /** See what happens when you send in a non-string request parameter - should error out */
+ /**
+ * See what happens when you send in a non-string request parameter - should error out.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testNonStringRequestParameter() throws Exception {
new ExpectedTestFailure(UnsupportedRequestParameterType.class,
@@ -170,11 +173,17 @@ protected void execute() throws Throwable {
}
}.run();
}
-
- /** Subclasses should specify the error class that's thrown in case of incorrect syntax for query */
+ /**
+ * Subclasses should specify the error class that's thrown in case of incorrect syntax for query
+ *
+ * @return a Class<?> value
+ */
protected abstract Class> getIncorrectQueryException();
-
- /** unit test that verifies failure for incorrect query syntax and invalid type name */
+ /**
+ * unit test that verifies failure for incorrect query syntax and invalid type name.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testIncorrectQuerySyntax() throws Exception {
final String query = "man, is this syntax incorrect or what??";
@@ -191,11 +200,17 @@ protected void execute() throws Throwable {
}
}.run();
}
-
- /** Subclasses should implement a test that verifies the right exception is thrown in case of invalid type name in select */
+ /**
+ * Subclasses should implement a test that verifies the right exception is thrown in case of invalid type name in select.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public abstract void testUnknownAlias() throws Exception;
-
- /** Verify that a request with valid java class name can be created */
+ /**
+ * Verify that a request with valid java class name can be created.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testValidJavaClass() throws Exception {
final DataFlowID flow1 = sManager.createDataFlow(new DataRequest[] {
@@ -209,8 +224,11 @@ public void testValidJavaClass() throws Exception {
sManager.cancel(flow1);
}
-
- // send in an unmapped java object, like Integer for instance and verify that it gets filtered correctly.
+ /**
+ * Send in an unmapped java object, like Integer for instance and verify that it gets filtered correctly.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testUnmappedJavaObject() throws Exception {
final DataFlowID flow1 = sManager.createDataFlow(new DataRequest[] {
@@ -225,13 +243,16 @@ public void testUnmappedJavaObject() throws Exception {
assertEquals(37, sSink.getNextData());
sManager.cancel(flow1);
}
-
- /** Setup two data flows
+ /**
+ * Setup two data flows
+ *
* Send some events through first one
* Cancel it
* verify that statements are gone, and then when you send similar events only 2nd data flow gets it
* Then cancel the 2nd flow, and do a 3rd one that gets totally different events
* verify that only 3rd-flow events are coming through, and not ones from 2nd or 1st flow
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test(timeout=120000)
public void testCancel() throws Exception {
@@ -303,42 +324,64 @@ protected void execute() throws Throwable {
}
}.run();
}
-
- /** Test multiple data flows with same queries but different sinks. Make sure that
-
- /** Run all the varous event types through */
+ /**
+ * Test ask events.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testAsk() throws Exception {
flowTestHelperWrapper(CEPDataTypes.ASK, AskEvent.class.getName(), (Object[])new Event[] {ask1, ask2});
}
-
+ /**
+ * Test bid events.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
public void testBid() throws Exception {
flowTestHelperWrapper(CEPDataTypes.BID, BidEvent.class.getName(), (Object[])new Event[] {bid1, bid2});
}
-
+ /**
+ * Test trade events.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testTrade() throws Exception {
flowTestHelperWrapper(CEPDataTypes.TRADE, TradeEvent.class.getName(), (Object[])new Event[] {trade1, trade2});
}
-
+ /**
+ * Test execution reports.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testExecutionReport() throws Exception {
flowTestHelperWrapper(CEPDataTypes.REPORT, ExecutionReport.class.getName(), er1, er2);
}
-
- // validation inspects Text field
+ /**
+ * Test order cancel rejects.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testOrderCancelReject() throws Exception {
flowTestHelperWrapper(CEPDataTypes.CANCEL_REJECT, OrderCancelReject.class.getName(), ocr1, ocr2);
}
-
- // on orders we look at destinations
+ /**
+ * Test order singles.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testOrderSingle() throws Exception {
flowTestHelperWrapper(CEPDataTypes.ORDER_SINGLE, OrderSingle.class.getName(), os1, os2);
}
-
- // on orders we look at dest id
+ /**
+ * Test order cancels.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test(timeout=120000)
public void testOrderCancel() throws Exception {
flowTestHelperWrapper(CEPDataTypes.ORDER_CANCEL, OrderCancel.class.getName(), oc1, oc2);
@@ -389,18 +432,30 @@ public void testMarketstatEvent() throws Exception {
flowTestHelperWrapper(CEPDataTypes.MARKET_STAT,
MarketstatEvent.class.getName(), mStat1, mStat2);
}
-
-
+ /**
+ * Wraps calls to {@link #flowTestHelper(String, Object[])}.
+ *
+ * @param expectedAlias a String value
+ * @param expectedClass a String value
+ * @param expectedEvents a String... value
+ * @throws Exception if the flow test helper call fails
+ */
protected void flowTestHelperWrapper(String expectedAlias,
String expectedClass,
- Object... expectedEvents) throws Exception {
+ Object... expectedEvents)
+ throws Exception
+ {
flowTestHelper(expectedAlias, expectedEvents);
flowTestHelper(expectedClass, expectedEvents);
}
-
-
- /** Helper to run multiple data types through the flow. We will be matching on 'symbol', or something
- * similar in the particular event type if that's available
+ /**
+ * Helper to run multiple data types through the flow.
+ *
+ *
We will be matching on 'symbol', or something similar in the particular event type if that's available
+ *
+ * @param type a String value
+ * @param expectedEvents an Object[] value
+ * @throws Exception if the flow test helper fails
*/
protected void flowTestHelper(String type, Object[] expectedEvents) throws Exception {
// verify module not found before data flow is started
diff --git a/modules/marketdata/csv/pom.xml b/modules/marketdata/csv/pom.xml
index 3225afc9b0..660114ec0c 100644
--- a/modules/marketdata/csv/pom.xml
+++ b/modules/marketdata/csv/pom.xml
@@ -73,8 +73,8 @@
3.2.0
- http://commons.apache.org/sandbox/csv/apidocs/
- http://repo.marketcetera.org/javadoc/1.5.0/platform/
+ https://javadoc.io/doc/org.apache.commons/commons-csv/latest/index.html
+ https://repo.marketcetera.org/javadoc/3.2.1/platform
diff --git a/modules/marketdata/marketcetera/src/main/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeed.java b/modules/marketdata/marketcetera/src/main/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeed.java
index a4abf57abf..757ab01fbb 100644
--- a/modules/marketdata/marketcetera/src/main/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeed.java
+++ b/modules/marketdata/marketcetera/src/main/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeed.java
@@ -432,8 +432,8 @@ private MarketceteraFeed(String inProviderName)
*
* @param inProviderName a String value
* @return a MarketceteraFeed value
- * @throws CoreException
- * @throws URISyntaxException
+ * @throws CoreException if the instance cannot be retrieved
+ * @throws URISyntaxException if the provider name cannot be parsed
*/
public static MarketceteraFeed getInstance(String inProviderName)
throws URISyntaxException, CoreException
diff --git a/modules/marketdata/marketcetera/src/test/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeedCredentialsTest.java b/modules/marketdata/marketcetera/src/test/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeedCredentialsTest.java
index 34cc11d786..171d33b401 100644
--- a/modules/marketdata/marketcetera/src/test/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeedCredentialsTest.java
+++ b/modules/marketdata/marketcetera/src/test/java/org/marketcetera/marketdata/marketcetera/MarketceteraFeedCredentialsTest.java
@@ -10,7 +10,7 @@
/* $License$ */
/**
- * Tests {@link MarketceteteraFeedCredentials}.
+ * Tests {@link MarketceteraFeedCredentials}.
*
* @author Colin DuPlantis
* @version $Id$
diff --git a/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/ConnectionException.java b/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/ConnectionException.java
index bb94edd8c8..3d719769de 100644
--- a/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/ConnectionException.java
+++ b/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/ConnectionException.java
@@ -6,7 +6,7 @@
/* $License$ */
/**
- *
+ * Indicates an error occurred trying to connect to a remote source.
*
* @author Colin DuPlantis
* @version $Id$
@@ -24,8 +24,8 @@ public ConnectionException()
/**
* Create a new ConnectionException instance.
*
- * @param inHostname
- * @param inPort
+ * @param inHostname a String value
+ * @param inPort an int value
*/
public ConnectionException(String inHostname,
int inPort)
@@ -84,7 +84,7 @@ public void setHostname(String inHostname)
/**
* Get the port value.
*
- * @return a int value
+ * @return an int value
*/
public int getPort()
{
@@ -93,18 +93,18 @@ public int getPort()
/**
* Sets the port value.
*
- * @param inPort a int value
+ * @param inPort an int value
*/
public void setPort(int inPort)
{
port = inPort;
}
/**
- *
+ * hostname value
*/
private String hostname;
/**
- *
+ * port value
*/
private int port;
private static final long serialVersionUID = 8121822556635716771L;
diff --git a/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/MarketDataService.java b/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/MarketDataService.java
index beda10fc22..96e4865135 100644
--- a/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/MarketDataService.java
+++ b/modules/marketdata/marketdata-core/src/main/java/org/marketcetera/marketdata/core/webservice/MarketDataService.java
@@ -90,7 +90,7 @@ long getLastUpdate(@WebParam(name="context")ClientContext inContext,
* @param inContext a ClientContext value
* @param inRequestIds a List<Long> value
* @return a Map<Long,LinkedList<Event>> value
- * @throws RemoteException
+ * @throws RemoteException if an error occurs getting the events
*/
Map> getAllEvents(@WebParam(name="context")ClientContext inContext,
@WebParam(name="id")List inRequestIds)
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/rpc/MarketDataRpcClientServerTest.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/rpc/MarketDataRpcClientServerTest.java
index 3eb361de12..1cad5b3466 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/rpc/MarketDataRpcClientServerTest.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/rpc/MarketDataRpcClientServerTest.java
@@ -20,6 +20,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.marketcetera.client.rpc.RpcClientImpl;
import org.marketcetera.core.notifications.ServerStatusListener;
import org.marketcetera.event.Event;
import org.marketcetera.event.EventTestBase;
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MarketDataServiceImplTest.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MarketDataServiceImplTest.java
index d7967e20a4..6d38d70236 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MarketDataServiceImplTest.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MarketDataServiceImplTest.java
@@ -28,6 +28,7 @@
import org.marketcetera.marketdata.MarketDataRequest;
import org.marketcetera.marketdata.MarketDataRequestBuilder;
import org.marketcetera.marketdata.bogus.BogusFeedModuleFactory;
+import org.marketcetera.marketdata.core.webservice.MarketDataService;
import org.marketcetera.marketdata.core.webservice.MarketDataServiceClient;
import org.marketcetera.marketdata.core.webservice.MarketDataServiceClientFactory;
import org.marketcetera.module.ModuleManager;
@@ -110,7 +111,7 @@ public void setApplicationContext(ApplicationContext inContext)
context = inContext;
}
/**
- * Tests the transmission of all event types via {@link MarketDataService#getEvents(org.marketcetera.util.ws.stateful.ClientContext, long).
+ * Tests the transmission of all event types via {@link MarketDataService#getEvents(org.marketcetera.util.ws.stateful.ClientContext, long)}.
*
* @throws Exception if an unexpected error occurs
*/
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MockServer.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MockServer.java
index 0d6f2aa0bb..a7cb4b333f 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MockServer.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/core/webservice/impl/MockServer.java
@@ -14,7 +14,7 @@
/* $License$ */
/**
- *
+ * Provides a test market data server implementation.
*
* @author Colin DuPlantis
* @version $Id$
@@ -132,7 +132,7 @@ public void setContextClassProvider(ContextClassProvider inContextClassProvider)
/**
* Get the sessionManager value.
*
- * @return a SessionManager value
+ * @return a SessionManager<MockSession> value
*/
public SessionManager getSessionManager()
{
@@ -141,7 +141,7 @@ public SessionManager getSessionManager()
/**
* Sets the sessionManager value.
*
- * @param inSessionManager a SessionManager value
+ * @param inSessionManager a SessionManager<MockSession> value
*/
public void setSessionManager(SessionManager inSessionManager)
{
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModule.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModule.java
index 7ac0313f71..5698fc2e6e 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModule.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModule.java
@@ -9,7 +9,7 @@
* Provides a module implementation for {@link TestFeed}.
*
* Module Features
- *
+ *
*
Factory:
{@link TestFeedModuleFactory}
*
See {@link AbstractMarketDataModule parent} for module features.
*
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModuleFactory.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModuleFactory.java
index 5ad68c1100..ba9927125e 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModuleFactory.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/module/TestFeedModuleFactory.java
@@ -11,14 +11,14 @@
* ModuleFactory implementation for the TestFeed market data provider.
*
* The factory has the following characteristics.
- *
+ *
*
Provider URN:
metc:mdata:feeder
*
Cardinality:
Singleton
*
Instance URN:
metc:mdata:bogus:feeder
*
Auto-Instantiated:
Yes
*
Auto-Started:
Yes
*
Instantiation Arguments:
None
- *
Module Type:
{@link FeederModule}
+ *
Module Type:
{@link TestFeedModule}
*
*
* @author Colin DuPlantis
diff --git a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/provider/MockMarketDataProvider.java b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/provider/MockMarketDataProvider.java
index 4a8534e3c8..15178a9fa4 100644
--- a/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/provider/MockMarketDataProvider.java
+++ b/modules/marketdata/marketdata-core/src/test/java/org/marketcetera/marketdata/provider/MockMarketDataProvider.java
@@ -134,7 +134,7 @@ public void setExceptionOnCancel(RuntimeException inExceptionOnCancel)
/**
* Sets the capabilities value.
*
- * @param a Set<Capability> value
+ * @param inCapabilities a Set<Capability> value
*/
public void setCapabilities(Set inCapabilities)
{
@@ -143,7 +143,7 @@ public void setCapabilities(Set inCapabilities)
/**
* Sets the feedType value.
*
- * @param a FeedType value
+ * @param inFeedType a FeedType value
*/
public void setFeedType(FeedType inFeedType)
{
diff --git a/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/EmitterModuleTest.java b/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/EmitterModuleTest.java
index 9604d48088..a1cb440433 100644
--- a/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/EmitterModuleTest.java
+++ b/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/EmitterModuleTest.java
@@ -48,7 +48,7 @@
/* $License$ */
/**
- * Tests {@link EmitterModule} & its integration with
+ * Tests {@link EmitterModule} & its integration with
* {@link org.marketcetera.modules.remote.receiver.ReceiverModule}.
* This test also verifies
* {@link org.marketcetera.modules.remote.receiver.ReceiverModule}
diff --git a/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/RemoteEmitterTestBase.java b/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/RemoteEmitterTestBase.java
index 4affe235b1..a1d0889dbf 100644
--- a/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/RemoteEmitterTestBase.java
+++ b/modules/remote/emitter/src/test/java/org/marketcetera/modules/remote/emitter/RemoteEmitterTestBase.java
@@ -63,7 +63,7 @@ public static void setupClientAndServer() throws Exception {
}
/**
- * Closes the client connection & shuts down the mock server.
+ * Closes the client connection & shuts down the mock server.
*
* @throws Exception if there were errors
*/
diff --git a/modules/remote/receiver/src/test/java/org/marketcetera/modules/remote/receiver/ClientLoginModuleTest.java b/modules/remote/receiver/src/test/java/org/marketcetera/modules/remote/receiver/ClientLoginModuleTest.java
index fd0c487e79..ca7a7f953d 100644
--- a/modules/remote/receiver/src/test/java/org/marketcetera/modules/remote/receiver/ClientLoginModuleTest.java
+++ b/modules/remote/receiver/src/test/java/org/marketcetera/modules/remote/receiver/ClientLoginModuleTest.java
@@ -47,7 +47,7 @@
public class ClientLoginModuleTest extends TestCaseBase {
/**
- * Test login success & failures.
+ * Test login success & failures.
* @throws Exception if there was failure
*/
@Test
diff --git a/modules/strategy/src/test/java/org/marketcetera/strategy/AbstractRunningStrategyTest.java b/modules/strategy/src/test/java/org/marketcetera/strategy/AbstractRunningStrategyTest.java
index 368fea7095..046ac480f4 100644
--- a/modules/strategy/src/test/java/org/marketcetera/strategy/AbstractRunningStrategyTest.java
+++ b/modules/strategy/src/test/java/org/marketcetera/strategy/AbstractRunningStrategyTest.java
@@ -119,12 +119,11 @@ public void before()
}
/**
* Run after each test.
- *
- * @throws Exception if an unexpected error occurs
*/
@After
- public void after() {
- strategy.stop();
+ public void after()
+ {
+ strategy.stop();
}
/**
* Tests {@link AbstractRunningStrategy#send(Object)}.
@@ -549,15 +548,17 @@ public void testGetOrderStatus()
}
/**
* Tests that a strategy fails to start when {@link Client#addBrokerStatusListener(BrokerStatusListener)} fails.
- * @throws Exception
+ *
+ * @throws Exception if an unexpected error occurs
*/
@Test
- public void testStrategyFailsToStart() throws Exception {
-
- new ExpectedFailure(){
+ public void testStrategyFailsToStart()
+ throws Exception
+ {
+ new ExpectedFailure(){
protected void run() throws Exception {
- MockClient.addBrokerStatusListenerFails = true;
- AbstractRunningStrategy strategy = new MockRunningStrategy();
+ MockClient.addBrokerStatusListenerFails = true;
+ AbstractRunningStrategy strategy = new MockRunningStrategy();
strategy.start();
}
};
@@ -569,44 +570,44 @@ protected void run() throws Exception {
*/
@Test
public void testOnReceiveBrokerStatus() throws Exception {
- //Create broker status and send it to the client listeners
- BrokerStatus status = createRandomBrokerStatus();
- sendBrokerStatus(status);
+ //Create broker status and send it to the client listeners
+ BrokerStatus status = createRandomBrokerStatus();
+ sendBrokerStatus(status);
- //Verify the statregy got it.
- assertTrue(strategy.brokerStatuses.contains(status));
-
+ //Verify the statregy got it.
+ assertTrue(strategy.brokerStatuses.contains(status));
+
//Verify strategy logs a warning message when broker status event process fails
strategy.onReceiveBrokerStatusFails = true;
sendBrokerStatus(status);
verifyLoggedEvents(new String[] { BROKER_STATUS_PROCESS_FAILED.getText(String.valueOf(strategy), String.valueOf(status)) });
- //Now remove the strategy from client's broker status listeners.
+ //Now remove the strategy from client's broker status listeners.
removeBrokerStatusListener(strategy);
- strategy.brokerStatuses.clear();
+ strategy.brokerStatuses.clear();
- //Send another status
- sendBrokerStatus(createRandomBrokerStatus());
+ //Send another status
+ sendBrokerStatus(createRandomBrokerStatus());
- //Verify that the strategy didn't get it
- assertTrue(strategy.brokerStatuses.size() == 0);
+ //Verify that the strategy didn't get it
+ assertTrue(strategy.brokerStatuses.size() == 0);
}
private BrokerStatus createRandomBrokerStatus() {
- return new BrokerStatus("status-" + System.nanoTime(),new BrokerID("id-" + System.nanoTime()),true);
+ return new BrokerStatus("status-" + System.nanoTime(),new BrokerID("id-" + System.nanoTime()),true);
}
private void sendBrokerStatus (BrokerStatus brokerStatus) throws ClientInitException {
- Client client = ClientManager.getInstance();
-
- //Verify client is instance of MockClient (needed to send broker status to listeners manually)
- assertTrue(client instanceof MockClient);
-
- ((MockClient)client).sendToListeners(brokerStatus);
+ Client client = ClientManager.getInstance();
+
+ //Verify client is instance of MockClient (needed to send broker status to listeners manually)
+ assertTrue(client instanceof MockClient);
+
+ ((MockClient)client).sendToListeners(brokerStatus);
}
private void removeBrokerStatusListener (BrokerStatusListener brokerStatusListener) throws ClientInitException {
- ClientManager.getInstance().removeBrokerStatusListener(brokerStatusListener);
+ ClientManager.getInstance().removeBrokerStatusListener(brokerStatusListener);
}
/**
@@ -619,7 +620,7 @@ private void reset()
{
servicesProvider.reset();
strategy.initializeReportHistoryManager();
- strategy.brokerStatuses.clear();
+ strategy.brokerStatuses.clear();
}
/**
* Verifies that the actual objects sent match the given expected objects.
@@ -1146,10 +1147,10 @@ public void onCancelReject(OrderCancelReject inCancelReject)
@Override
public void onReceiveBrokerStatus(BrokerStatus inStatus)
{
- if(onReceiveBrokerStatusFails) {
- throw new RuntimeException("This is a expected Exception");
- }
-
+ if(onReceiveBrokerStatusFails) {
+ throw new RuntimeException("This is a expected Exception");
+ }
+
brokerStatuses.add(inStatus);
}
/* (non-Javadoc)
diff --git a/modules/strategy/src/test/java/org/marketcetera/strategy/LanguageTestBase.java b/modules/strategy/src/test/java/org/marketcetera/strategy/LanguageTestBase.java
index 85b9174902..25bc2065cc 100644
--- a/modules/strategy/src/test/java/org/marketcetera/strategy/LanguageTestBase.java
+++ b/modules/strategy/src/test/java/org/marketcetera/strategy/LanguageTestBase.java
@@ -1269,7 +1269,7 @@ public void sendMessages()
/**
* Takes a single strategy and starts and stops it many times.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@PerformanceTest
public void startStop()
@@ -1293,7 +1293,7 @@ public void startStop()
/**
* Starts and stops many different strategies.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@PerformanceTest
public void manyStrategiesStartStop()
@@ -2896,7 +2896,7 @@ public void optionRoots()
/**
* Tests that two strategies with the same class name can co-exist.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void strategiesOfSameClass()
diff --git a/modules/strategy/src/test/java/org/marketcetera/strategy/StrategyTestBase.java b/modules/strategy/src/test/java/org/marketcetera/strategy/StrategyTestBase.java
index d863a3fc8e..99ed1fb997 100644
--- a/modules/strategy/src/test/java/org/marketcetera/strategy/StrategyTestBase.java
+++ b/modules/strategy/src/test/java/org/marketcetera/strategy/StrategyTestBase.java
@@ -211,7 +211,7 @@ public static class MockRecorderModule
/**
* Create a new MockRecorderModule instance.
*
- * @param inURN
+ * @param inURN a ModuleURN value
*/
protected MockRecorderModule(ModuleURN inURN)
{
@@ -543,7 +543,7 @@ public static void setDataToSendToDefaults()
/**
* Create a new MockRecorderModule instance.
*
- * @param inURN
+ * @param inURN a ModuleURN value
*/
protected StrategyDataEmissionModule(ModuleURN inURN)
{
@@ -1315,7 +1315,7 @@ public static final BrokersStatus generateBrokersStatus()
* a value that changes over time by sorting them by the interval
* date. To determine the value of a function represented by a series
* of intervals, find the intersection of the desired date (D) and the interval
- * where: D > interval1.getDate() && D < interval2.getDate().
+ * where: D > interval1.getDate() && D < interval2.getDate().
*
* @author Colin DuPlantis
* @version $Id$
@@ -1583,6 +1583,7 @@ public static final Map generatePositions(List
* @param inException a Throwable value containing the expected exception or null for none
* @param inExpectedMessage an I18NMessage value containing the expected message
* @param inExpectedParameters a Serializable[] value containing the expected parameters
+ * @throws Exception if the event cannot be verified
*/
public static void verifyEvent(LogEvent inActualEvent,
LogEventLevel inExpectedLevel,
@@ -1617,6 +1618,8 @@ public static void verifyEvent(LogEvent inActualEvent,
}
/**
* Run at the beginning of execution of all tests.
+ *
+ * @throws Exception if the event cannot be verified
*/
@BeforeClass
public static void once()
@@ -1835,8 +1838,8 @@ protected final void startStrategy(ModuleURN inStrategyURN)
/**
* Stops the given strategy and cancels all active data flows.
*
- * @param inStrategyURN a
- * @throws Exception
+ * @param inStrategyURN a ModuleURN value
+ * @throws Exception if the strategy cannot be stopped properly
*/
protected final void stopStrategy(ModuleURN inStrategyURN)
throws Exception
@@ -1944,30 +1947,31 @@ protected static List generateFixExecutionReports(OrderSingle inOrder)
* @param inOrderStatus a char value corresponding to an {@link OrdStatus} value
* @param inQuantity a BigDecimal value
* @param inLastQuantity a BigDecimal value
- * @return a Message value
+ * @param inFIXVersion a FIXVersion value
+ * @return a quickfix.Message value
* @throws Exception if an error occurs
*/
- protected static Message generateFixExecutionReport(OrderSingle inOrder,
- char inOrderStatus,
- BigDecimal inQuantity,
- BigDecimal inLastQuantity,
- FIXVersion inFIXVersion)
+ protected static quickfix.Message generateFixExecutionReport(OrderSingle inOrder,
+ char inOrderStatus,
+ BigDecimal inQuantity,
+ BigDecimal inLastQuantity,
+ FIXVersion inFIXVersion)
throws Exception
{
- Message exeReport = inFIXVersion.getMessageFactory().newExecutionReport(inOrder.getOrderID().toString(),
- inOrder.getOrderID().toString(),
- "execID",
- inOrderStatus,
- Side.BUY,
- inQuantity,
- inOrder.getPrice(),
- inLastQuantity,
- inOrder.getPrice(),
- inOrder.getQuantity(),
- inOrder.getPrice(),
- inOrder.getInstrument(),
- inOrder.getAccount(),
- inOrder.getText());
+ quickfix.Message exeReport = inFIXVersion.getMessageFactory().newExecutionReport(inOrder.getOrderID().toString(),
+ inOrder.getOrderID().toString(),
+ "execID",
+ inOrderStatus,
+ Side.BUY,
+ inQuantity,
+ inOrder.getPrice(),
+ inLastQuantity,
+ inOrder.getPrice(),
+ inOrder.getQuantity(),
+ inOrder.getPrice(),
+ inOrder.getInstrument(),
+ inOrder.getAccount(),
+ inOrder.getText());
exeReport.setField(new TransactTime(extractTransactTimeFromRunningStrategy()));
return exeReport;
}
diff --git a/modules/strategy/src/test/java/org/marketcetera/strategy/util/OptionChainTest.java b/modules/strategy/src/test/java/org/marketcetera/strategy/util/OptionChainTest.java
index 934c932ef5..08665258fe 100644
--- a/modules/strategy/src/test/java/org/marketcetera/strategy/util/OptionChainTest.java
+++ b/modules/strategy/src/test/java/org/marketcetera/strategy/util/OptionChainTest.java
@@ -57,7 +57,7 @@ public class OptionChainTest
/**
* Tests {@link OptionChain#OptionChain(org.marketcetera.trade.Instrument)}.
*
- * @throws Exception
+ * @throws Exception if an unexpected error occurs
*/
@Test
public void optionChainConstructor()
diff --git a/orderloader/src/main/java/org/marketcetera/orderloader/OrderLoaderMain.java b/orderloader/src/main/java/org/marketcetera/orderloader/OrderLoaderMain.java
index b539a63eb8..94c1c6ae14 100644
--- a/orderloader/src/main/java/org/marketcetera/orderloader/OrderLoaderMain.java
+++ b/orderloader/src/main/java/org/marketcetera/orderloader/OrderLoaderMain.java
@@ -1,6 +1,22 @@
package org.marketcetera.orderloader;
-import static org.marketcetera.orderloader.Messages.*;
+import static org.marketcetera.orderloader.Messages.ARG_BROKER_DESCRIPTION;
+import static org.marketcetera.orderloader.Messages.ARG_BROKER_VALUE;
+import static org.marketcetera.orderloader.Messages.ARG_MODE_DESCRIPTION;
+import static org.marketcetera.orderloader.Messages.ARG_MODE_VALUE;
+import static org.marketcetera.orderloader.Messages.ARG_PASSWORD_DESCRIPTION;
+import static org.marketcetera.orderloader.Messages.ARG_PASSWORD_VALUE;
+import static org.marketcetera.orderloader.Messages.ARG_USERNAME_DESCRIPTION;
+import static org.marketcetera.orderloader.Messages.ARG_USERNAME_VALUE;
+import static org.marketcetera.orderloader.Messages.ERROR_MISSING_FILE;
+import static org.marketcetera.orderloader.Messages.ERROR_TOO_MANY_ARGUMENTS;
+import static org.marketcetera.orderloader.Messages.ERROR_USAGE;
+import static org.marketcetera.orderloader.Messages.FAILED_ORDER;
+import static org.marketcetera.orderloader.Messages.FAILED_ORDERS;
+import static org.marketcetera.orderloader.Messages.LINE_SUMMARY;
+import static org.marketcetera.orderloader.Messages.LOG_APP_COPYRIGHT;
+import static org.marketcetera.orderloader.Messages.LOG_APP_VERSION_BUILD;
+import static org.marketcetera.orderloader.Messages.ORDER_SUMMARY;
import java.io.File;
import java.io.PrintStream;
@@ -9,7 +25,11 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.commons.cli.*;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Options;
import org.marketcetera.client.ClientParameters;
import org.marketcetera.core.ApplicationContainer;
import org.marketcetera.core.ApplicationVersion;
@@ -175,10 +195,9 @@ protected void exit()
ApplicationContainer.stopInstanceWaiting();
}
/**
- *
+ * Get the application start arguments.
*
- *
- * @return
+ * @return a String[] value
*/
protected String[] getArgs()
{
@@ -296,8 +315,8 @@ private void run(String[] inArgs)
printMessage(LOG_APP_VERSION_BUILD.getText(ApplicationVersion.getVersion(),
ApplicationVersion.getBuildNumber()));
try {
- execute(new GnuParser().parse(options(),
- inArgs));
+ execute(new DefaultParser().parse(options(),
+ inArgs));
} catch (Exception e) {
printError(e);
usage();
@@ -388,44 +407,47 @@ private void usage()
*/
private String mFilename;
/**
- *
+ * indicates the mode
*/
private static final String OPT_MODE = "m"; //$NON-NLS-1$
/**
- *
+ * indicates the broker
*/
private static final String OPT_BROKER = "b"; //$NON-NLS-1$
/**
- *
+ * indicates the username
*/
private static final String OPT_USERNAME = "u"; //$NON-NLS-1$
/**
- *
+ * indicates th password
*/
private static final String OPT_PASSWORD = "p"; //$NON-NLS-1$
/**
* indicates if the order loader is running or not
*/
private final AtomicBoolean running = new AtomicBoolean(false);
+ /**
+ * client username value
+ */
private String clientUsername;
/**
- *
+ * client password value
*/
private char[] clientPassword;
/**
- *
+ * client URL value
*/
private String clientURL;
/**
- *
+ * client web-services host value
*/
private String clientWsHost;
/**
- *
+ * client order id prefix value
*/
private String clientIdPrefix;
/**
- *
+ * client web-services port value
*/
private String clientWsPort;
}
diff --git a/orderloader/src/test/java/org/marketcetera/orderloader/MainTest.java b/orderloader/src/test/java/org/marketcetera/orderloader/MainTest.java
index 25bff4e105..831da66ffb 100644
--- a/orderloader/src/test/java/org/marketcetera/orderloader/MainTest.java
+++ b/orderloader/src/test/java/org/marketcetera/orderloader/MainTest.java
@@ -275,10 +275,9 @@ protected OrderProcessor createProcessor(ClientParameters inParameters)
return mOrderProcessor;
}
/**
- *
- *
+ * Get the client parameters.
*
- * @return
+ * @return a ClientParameters value
*/
public ClientParameters getClientParameters()
{
@@ -294,20 +293,18 @@ protected void displaySummary(OrderLoader inLoader)
loader = inLoader;
}
/**
- *
+ * Set the fail-on-create processor value.
*
- *
- * @param inFailCreateProcessor
+ * @param inFailCreateProcessor a boolean value
*/
public void setFailCreateProcessor(boolean inFailCreateProcessor)
{
mFailCreateProcessor = inFailCreateProcessor;
}
/**
- *
- *
+ * Get the order processor value.
*
- * @return
+ * @return a MockOrderProcessor value
*/
public MockOrderProcessor getOrderProcessor()
{
diff --git a/orderloader/src/test/java/org/marketcetera/orderloader/OrderParserTest.java b/orderloader/src/test/java/org/marketcetera/orderloader/OrderParserTest.java
index f92be732b3..ba75bc166a 100644
--- a/orderloader/src/test/java/org/marketcetera/orderloader/OrderParserTest.java
+++ b/orderloader/src/test/java/org/marketcetera/orderloader/OrderParserTest.java
@@ -26,7 +26,7 @@
/* $License$ */
/**
- * Tests {@link OrderParser} & {@link RowProcessor}
+ * Tests {@link OrderParser} & {@link RowProcessor}
*
* @author anshul@marketcetera.com
* @version $Id$
diff --git a/orderloader/src/test/java/org/marketcetera/orderloader/fix/FIXProcessorTest.java b/orderloader/src/test/java/org/marketcetera/orderloader/fix/FIXProcessorTest.java
index 9404c93e77..a1481f2e55 100644
--- a/orderloader/src/test/java/org/marketcetera/orderloader/fix/FIXProcessorTest.java
+++ b/orderloader/src/test/java/org/marketcetera/orderloader/fix/FIXProcessorTest.java
@@ -355,8 +355,11 @@ public void nonAscii()
assertEquals("123-ASDF-234",
message.getString(Account.FIELD));
}
-
- /** Verify that HandlInst, if set, overwrites the default one in the NOS message factory */
+ /**
+ * Verify that HandlInst, if set, overwrites the default one in the NOS message factory.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void handlInstField() throws Exception
{
@@ -412,8 +415,11 @@ public void withCustomField() throws Exception
assertEquals("12345", message.getString(9999) );
assertEquals("123-ASDF-234", message.getString(Account.FIELD) );
}
-
- /** Test using both header and trailer and message custom fields */
+ /**
+ * Test using both header and trailer and message custom fields.
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void withMixedCustomFields() throws Exception {
RowProcessor processor = create();
@@ -433,7 +439,11 @@ public void withMixedCustomFields() throws Exception {
assertEquals("sig", message.getTrailer().getString(Signature.FIELD));
}
- /** Try sending a message with key not in dictionary */
+ /**
+ * Try sending a message with key not in dictionary
+ *
+ * @throws Exception if an unexpected error occurs
+ */
@Test
public void fieldNotInDictionary() throws Exception {
RowProcessor processor = create();
diff --git a/pom.xml b/pom.xml
index c661e62a18..026a09cae7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -350,7 +350,7 @@
org.tensorflowtensorflow
-
+
1.13.1
@@ -1109,6 +1109,12 @@
false
+
+ -Xmaxerrs
+ 65536
+ -Xmaxwarns
+ 65536
+
@@ -1124,6 +1130,21 @@
+
+ org.apache.maven.plugins
+ maven-site-plugin
+ 3.9.1
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ 3.1.1
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.1.1
+ maven-source-plugin
@@ -1335,12 +1356,10 @@
org.apache.maven.pluginsmaven-site-plugin
- 3.9.1org.apache.maven.pluginsmaven-project-info-reports-plugin
- 3.1.1
diff --git a/saclient/src/main/java/org/marketcetera/saclient/CreateStrategyParameters.java b/saclient/src/main/java/org/marketcetera/saclient/CreateStrategyParameters.java
index d559a803e3..b2d1fcd56e 100644
--- a/saclient/src/main/java/org/marketcetera/saclient/CreateStrategyParameters.java
+++ b/saclient/src/main/java/org/marketcetera/saclient/CreateStrategyParameters.java
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
+import java.nio.charset.Charset;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -38,15 +39,15 @@ public final class CreateStrategyParameters
* @param inParameters the strategy parameters as a list of ':' separated,
* name=value pairs. Can be null.
* @param inRouteOrdersToServer if the strategy should route its orders to the server.
- * @throws IOException
+ * @throws IOException if the strategy parameters cannot be created
* @throws NullPointerException if any of the non-null field values are null.
*/
public CreateStrategyParameters(String inInstanceName,
- String inStrategyName,
- String inLanguage,
- File inStrategySource,
- String inParameters,
- boolean inRouteOrdersToServer)
+ String inStrategyName,
+ String inLanguage,
+ File inStrategySource,
+ String inParameters,
+ boolean inRouteOrdersToServer)
throws IOException
{
if(inStrategyName == null) {
@@ -65,7 +66,8 @@ public CreateStrategyParameters(String inInstanceName,
mInstanceName = inInstanceName;
mStrategyName = inStrategyName;
mLanguage = inLanguage;
- mStrategySource = IOUtils.toString(new FileInputStream(inStrategySource));
+ mStrategySource = IOUtils.toString(new FileInputStream(inStrategySource),
+ Charset.defaultCharset());
mParameters = inParameters;
mRouteOrdersToServer = inRouteOrdersToServer;
}
@@ -110,7 +112,8 @@ public String getLanguage() {
public InputStream getStrategySource()
throws IOException
{
- return IOUtils.toInputStream(mStrategySource);
+ return IOUtils.toInputStream(mStrategySource,
+ Charset.defaultCharset());
}
/**
diff --git a/saclient/src/main/java/org/marketcetera/saclient/rpc/XmlValue.java b/saclient/src/main/java/org/marketcetera/saclient/rpc/XmlValue.java
index 5fcdf7f615..6886963d07 100644
--- a/saclient/src/main/java/org/marketcetera/saclient/rpc/XmlValue.java
+++ b/saclient/src/main/java/org/marketcetera/saclient/rpc/XmlValue.java
@@ -24,7 +24,7 @@ public class XmlValue
/**
* Create a new XmlValue instance.
*
- * @param inValue
+ * @param inValue an Object value
*/
public XmlValue(Object inValue)
{
diff --git a/saclient/src/test/java/org/marketcetera/saclient/SAClientWSTest.java b/saclient/src/test/java/org/marketcetera/saclient/SAClientWSTest.java
index 4c0f035d61..20cbf34e1b 100644
--- a/saclient/src/test/java/org/marketcetera/saclient/SAClientWSTest.java
+++ b/saclient/src/test/java/org/marketcetera/saclient/SAClientWSTest.java
@@ -1,12 +1,23 @@
package org.marketcetera.saclient;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
-import java.util.*;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
@@ -19,7 +30,11 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.marketcetera.module.*;
+import org.marketcetera.module.ExpectedFailure;
+import org.marketcetera.module.ModuleInfo;
+import org.marketcetera.module.ModuleState;
+import org.marketcetera.module.ModuleTestBase;
+import org.marketcetera.module.ModuleURN;
import org.marketcetera.util.except.I18NException;
import org.marketcetera.util.file.CopyCharsUtils;
import org.marketcetera.util.log.I18NMessage0P;
@@ -30,7 +45,7 @@
/* $License$ */
/**
* Tests {@link SAClient} web services.
- *
+ *
* For each web service, verifies that the parameters to each web service
* are correctly received and that the return values are correctly received.
* And if the web service failed that the exception is correctly received.
@@ -142,7 +157,8 @@ public void createStrategy() throws Exception {
File f = File.createTempFile("strat", ".tst");
f.deleteOnExit();
CopyCharsUtils.copy("Test Strategy Contents".toCharArray(), f.getAbsolutePath());
- int fileLength = FileUtils.readFileToString(f).length();
+ int fileLength = FileUtils.readFileToString(f,
+ Charset.defaultCharset()).length();
final CreateStrategyParameters input = new CreateStrategyParameters(
"instance", "strategy", "java", f, "key=value", false);
final ModuleURN output = new ModuleURN("test:prov:me:A");
@@ -184,7 +200,8 @@ public void getStrategyCreateParameters() throws Exception {
File f = File.createTempFile("strat", ".tst");
f.deleteOnExit();
CopyCharsUtils.copy("Test Strategy Contents".toCharArray(), f.getAbsolutePath());
- int fileLength = FileUtils.readFileToString(f).length();
+ int fileLength = FileUtils.readFileToString(f,
+ Charset.defaultCharset()).length();
final CreateStrategyParameters output = new CreateStrategyParameters(
"instance", "strategy", "java", f, "key=value", false);
testAPI(new WSTester() {
@@ -574,7 +591,7 @@ public String getAttribute1()
/**
* Sets the attribute1 value.
*
- * @param a String value
+ * @param inAttribute1 a String value
*/
public void setAttribute1(String inAttribute1)
{
@@ -592,7 +609,7 @@ public long getAttribute2()
/**
* Sets the attribute2 value.
*
- * @param a long value
+ * @param inAttribute2 a long value
*/
public void setAttribute2(long inAttribute2)
{
@@ -610,7 +627,7 @@ public Date getAttribute3()
/**
* Sets the attribute3 value.
*
- * @param a Date value
+ * @param inAttribute3 a Date value
*/
public void setAttribute3(Date inAttribute3)
{
diff --git a/saclient/src/test/java/org/marketcetera/saclient/rpc/RpcSAClientImplTest.java b/saclient/src/test/java/org/marketcetera/saclient/rpc/RpcSAClientImplTest.java
index 0c790fd319..40ab88a72d 100644
--- a/saclient/src/test/java/org/marketcetera/saclient/rpc/RpcSAClientImplTest.java
+++ b/saclient/src/test/java/org/marketcetera/saclient/rpc/RpcSAClientImplTest.java
@@ -10,6 +10,7 @@
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.ServerSocket;
+import java.nio.charset.Charset;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -146,7 +147,7 @@ public void testGetProviders()
serviceAdapter.getProvidersCount().get());
}
/**
- * Tests {@link RpcSAClientImpl#getInstances()}.
+ * Tests {@link RpcSAClientImpl#getInstances(ModuleURN)}.
*
* @throws Exception if an unexpected error occurs
*/
@@ -376,7 +377,8 @@ private File generateStrategySource()
"txt");
tmpFile.deleteOnExit();
FileUtils.writeStringToFile(tmpFile,
- "Lorum ipsum");
+ "Lorum ipsum",
+ Charset.defaultCharset());
return tmpFile;
}
/**
diff --git a/strategyagent/src/test/java/org/marketcetera/strategyagent/JarClassLoaderTest.java b/strategyagent/src/test/java/org/marketcetera/strategyagent/JarClassLoaderTest.java
index c7a103a9ae..395e2f3a44 100644
--- a/strategyagent/src/test/java/org/marketcetera/strategyagent/JarClassLoaderTest.java
+++ b/strategyagent/src/test/java/org/marketcetera/strategyagent/JarClassLoaderTest.java
@@ -21,7 +21,6 @@
import org.junit.Test;
import org.marketcetera.core.Pair;
import org.marketcetera.module.ExpectedFailure;
-import org.marketcetera.util.except.I18NException;
import org.marketcetera.util.file.Deleter;
/* $License$ */
@@ -40,7 +39,7 @@ public class JarClassLoaderTest
*
* bug report for details on this issue.
*
- * @throws I18NException if there were errors.
+ * @throws Exception if there were errors.
*/
@BeforeClass
public static void cleanup() throws Exception {
diff --git a/util/src/main/java/org/marketcetera/util/rpc/RpcServerServices.java b/util/src/main/java/org/marketcetera/util/rpc/RpcServerServices.java
index a92a75fb8b..97d8f1a443 100644
--- a/util/src/main/java/org/marketcetera/util/rpc/RpcServerServices.java
+++ b/util/src/main/java/org/marketcetera/util/rpc/RpcServerServices.java
@@ -50,6 +50,7 @@ String marshal(Object inObject)
/**
* Unmarshals the given XML stream.
*
+ * @param the type of the object to un-marshal
* @param inData a String value
* @return a Clazz value
* @throws JAXBException if an error occurs unmarshalling the stream
diff --git a/util/src/main/java/org/marketcetera/util/ws/stateful/RemoteCall.java b/util/src/main/java/org/marketcetera/util/ws/stateful/RemoteCall.java
index 18081567cf..66a362c226 100644
--- a/util/src/main/java/org/marketcetera/util/ws/stateful/RemoteCall.java
+++ b/util/src/main/java/org/marketcetera/util/ws/stateful/RemoteCall.java
@@ -97,6 +97,7 @@ public SessionManager getSessionManager()
* Returns the default session ID filter for the given session
* manager.
*
+ * @param a T value
* @param sessionManager The session manager.
*
* @return The filter.
diff --git a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessClient.java b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessClient.java
index fcbe9505be..1c23ab08c6 100644
--- a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessClient.java
+++ b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessClient.java
@@ -152,6 +152,7 @@ public StatelessClientContext getContext()
*
* @param a T extends StatelessServiceBase value
* @param inInterface The interface class.
+ * @return a T value
*/
@SuppressWarnings("unchecked")
diff --git a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessRemoteCall.java b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessRemoteCall.java
index 2fc993a310..e66eda670c 100644
--- a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessRemoteCall.java
+++ b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessRemoteCall.java
@@ -183,6 +183,7 @@ public TagFilter getClientIdFilter()
*
* @param context The context.
* @param t The throwable.
+ * @return a RemoteException value
*/
protected RemoteException wrapFailure
diff --git a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessServer.java b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessServer.java
index a72c55dd05..7adb1969a3 100644
--- a/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessServer.java
+++ b/util/src/main/java/org/marketcetera/util/ws/stateless/StatelessServer.java
@@ -64,6 +64,7 @@ public StatelessServer()
* implementation, and returns a handle that can be used to stop
* the interface.
*
+ * @param a T extends StatelessServiceBase value
* @param impl The implementation.
* @param iface The interface class.
*
diff --git a/util/src/main/java/org/marketcetera/util/ws/tags/TagFilter.java b/util/src/main/java/org/marketcetera/util/ws/tags/TagFilter.java
index 1e601a2ca2..85f297f65b 100644
--- a/util/src/main/java/org/marketcetera/util/ws/tags/TagFilter.java
+++ b/util/src/main/java/org/marketcetera/util/ws/tags/TagFilter.java
@@ -20,9 +20,9 @@ public interface TagFilter
/**
* Asserts that the given tag is acceptable to the receiver.
*
+ * @param tag a Tag value
* @throws I18NException Thrown if the tag is not acceptable.
*/
-
void assertMatch
(Tag tag)
throws I18NException;