extends AbstractFsStore {
}
} finally {
lock.unlock();
- lock.release();
}
}
diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java
deleted file mode 100644
index 7e597f9e7c..0000000000
--- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/spatial/RecordUtil.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.edex.ogc.common.spatial;
-
-import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.geometry.jts.ReferencedEnvelope;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-
-import com.raytheon.uf.common.dataplugin.PluginDataObject;
-import com.raytheon.uf.common.dataplugin.persist.IPersistable;
-import com.raytheon.uf.common.datastorage.IDataStore;
-import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
-import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
-import com.raytheon.uf.common.datastorage.records.IDataRecord;
-import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
-import com.raytheon.uf.common.geospatial.ISpatialEnabled;
-import com.raytheon.uf.common.geospatial.ISpatialObject;
-import com.raytheon.uf.common.geospatial.MapUtil;
-import com.raytheon.uf.common.spatial.reprojection.DataReprojector;
-import com.raytheon.uf.common.spatial.reprojection.ReferencedDataRecord;
-import com.raytheon.uf.edex.database.plugin.PluginDao;
-import com.vividsolutions.jts.geom.Coordinate;
-import com.vividsolutions.jts.geom.Envelope;
-import com.vividsolutions.jts.geom.Geometry;
-import com.vividsolutions.jts.geom.Polygon;
-
-/**
- * Utility methods for reprojecting data records. Removing code only used by ogc
- * services from {@link PluginDao} to here
- *
- *
- *
- * SOFTWARE HISTORY
- *
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Feb 26, 2013 1638 mschenke Code moved from PluginDao to clean up dependencies
- *
- *
- *
- * @author unknown
- * @version 1.0
- */
-
-public class RecordUtil {
-
- /**
- * @param record
- * @param crs
- * target crs for projected data
- * @param envelope
- * bounding box in target crs
- * @return null if envelope is disjoint with data bounds
- * @throws Exception
- */
- public static ReferencedDataRecord getProjected(PluginDao dao,
- PluginDataObject record, CoordinateReferenceSystem crs,
- Envelope envelope) throws Exception {
- ReferencedEnvelope targetEnv = new ReferencedEnvelope(
- envelope.getMinX(), envelope.getMaxX(), envelope.getMinY(),
- envelope.getMaxY(), crs);
- return getProjected(dao, record, targetEnv);
- }
-
- public static double getHDF5Value(PluginDao dao, PluginDataObject pdo,
- CoordinateReferenceSystem crs, Coordinate coord,
- double defaultReturn) throws Exception {
- // TODO a cache would probably be good here
- double rval = defaultReturn;
- if (pdo instanceof ISpatialEnabled) {
- IDataStore store = dao.getDataStore((IPersistable) pdo);
- ISpatialObject spat = getSpatialObject(pdo);
- DataReprojector reprojector = getDataReprojector(store);
- ReferencedEnvelope nativeEnv = getNativeEnvelope(spat);
- IDataRecord data = reprojector.getProjectedPoints(pdo.getDataURI(),
- spat, nativeEnv, crs, new Coordinate[] { coord });
- Double res = extractSingle(data);
- if (res != null) {
- rval = res;
- }
- }
- return rval;
- }
-
- /**
- * @param record
- * @param crs
- * target crs for projected data
- * @param envelope
- * bounding box in target crs
- * @return null if envelope is disjoint with data bounds
- * @throws Exception
- */
- public static GridCoverage2D getProjectedCoverage(PluginDao dao,
- PluginDataObject record, CoordinateReferenceSystem crs,
- Envelope envelope) throws Exception {
- ReferencedEnvelope targetEnv = new ReferencedEnvelope(
- envelope.getMinX(), envelope.getMaxX(), envelope.getMinY(),
- envelope.getMaxY(), crs);
- return getProjectedCoverage(dao, record, targetEnv);
- }
-
- /**
- * @param record
- * @param targetEnvelope
- * bounding box in target crs
- * @return null if envelope is disjoint with data bounds
- * @throws Exception
- */
- public static ReferencedDataRecord getProjected(PluginDao dao,
- PluginDataObject record, ReferencedEnvelope targetEnvelope)
- throws Exception {
- IDataStore store = dao.getDataStore((IPersistable) record);
- ISpatialObject spatial = getSpatialObject(record);
- DataReprojector reprojector = getDataReprojector(store);
- ReferencedEnvelope nativeEnvelope = getNativeEnvelope(spatial);
- return reprojector.getReprojected(record.getDataURI(), spatial,
- nativeEnvelope, targetEnvelope);
- }
-
- /**
- * @param record
- * @param targetEnvelope
- * bounding box in target crs
- * @return null if envelope is disjoint with data bounds
- * @throws Exception
- */
- public static GridCoverage2D getProjectedCoverage(PluginDao dao,
- PluginDataObject record, ReferencedEnvelope envelope)
- throws Exception {
- IDataStore store = dao.getDataStore((IPersistable) record);
- ISpatialObject spatial = getSpatialObject(record);
- DataReprojector reprojector = getDataReprojector(store);
- ReferencedEnvelope nativeEnvelope = getNativeEnvelope(spatial);
- return reprojector.getReprojectedCoverage(record.getDataURI(), spatial,
- nativeEnvelope, envelope);
- }
-
- public static DataReprojector getDataReprojector(IDataStore dataStore) {
- return new DataReprojector(dataStore);
- }
-
- public static ReferencedEnvelope getNativeEnvelope(ISpatialObject spatial)
- throws FactoryException {
- CoordinateReferenceSystem crs = spatial.getCrs();
- Geometry geom = spatial.getGeometry();
- return MapUtil.getBoundingEnvelope(crs, (Polygon) geom);
- }
-
- public static Double extractSingle(IDataRecord record) {
- Double rval = null;
- if (record == null) {
- return rval;
- }
- if (record instanceof ByteDataRecord) {
- byte[] data = ((ByteDataRecord) record).getByteData();
- rval = (double) data[0];
- } else if (record instanceof FloatDataRecord) {
- float[] data = ((FloatDataRecord) record).getFloatData();
- rval = (double) data[0];
- } else if (record instanceof IntegerDataRecord) {
- int[] data = ((IntegerDataRecord) record).getIntData();
- rval = (double) data[0];
- }
- return rval;
- }
-
- public static ISpatialObject getSpatialObject(PluginDataObject record)
- throws Exception {
- if (record instanceof ISpatialEnabled) {
- return ((ISpatialEnabled) record).getSpatialObject();
- } else {
- throw new Exception(record.getClass() + " is not spatially enabled");
- }
- }
-
-}
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-request.xml b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-request.xml
index eab8b24d84..411d4428a0 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-request.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-request.xml
@@ -15,7 +15,7 @@
java.lang.Throwable
-
+
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
index bac6c8310d..f122663cd7 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
@@ -14,4 +14,4 @@ ebxml-email.enabled=false
ebxml-notification-batch-size=50
# Configuration of thread pool used to handle web service requests
ebxml-webserver-min-threads=2
-ebxml-webserver-max-threads=10
\ No newline at end of file
+ebxml-webserver-max-threads=5
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java
index e4f2bfa498..c31ede2abd 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java
@@ -21,7 +21,9 @@ package com.raytheon.uf.edex.registry.ebxml.services.query;
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.datatype.DatatypeConfigurationException;
@@ -51,6 +53,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 10/8/2013 1682 bphillip Initial implementation
+ * 11/7/2013 1678 bphillip Added formatArrayString
*
*
* @author bphillip
@@ -70,6 +73,12 @@ public class RegistryQueryUtil {
private static final Pattern REPLACE_LIKE_CHARS_PATTERN = Pattern
.compile("\\?");
+ /**
+ * Pattern used to format the string representation of arrays
+ */
+ private static final Pattern ARRAY_STRING_PATTERN = Pattern
+ .compile("(\\[)(.*)(\\])");
+
/**
* Replaces the registry character wilcard (?) with the database wildcard
* (_)
@@ -224,4 +233,20 @@ public class RegistryQueryUtil {
}
}
+
+ /**
+ * Formats the string representation of an array as a comma separated list
+ *
+ * @param arrayString
+ * The array string to format
+ * @return The formatted string
+ */
+ public static String formatArrayString(Object[] arr) {
+ String arrayString = Arrays.toString(arr);
+ Matcher matcher = ARRAY_STRING_PATTERN.matcher(arrayString);
+ if (matcher.find()) {
+ return matcher.group(2);
+ }
+ return arrayString;
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html
index f061c21e30..7f1252ae1e 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html
@@ -1,3 +1,37 @@
+
+
+
@@ -68,7 +102,7 @@
My Registry is Subscribed To:
-
+Retrieving Registry List...
@@ -76,7 +110,7 @@
Registries Subscribing to My Registry:
-
+Retrieving Registry List...
@@ -87,7 +121,7 @@
Object Types Currently Replicated:
-
+Retrieving Object List...
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
index b6c188b673..701d08abe5 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
@@ -56,6 +56,8 @@ Date Ticket# Engineer Description
Query Interface
+ Define Query
+
Subscription Backup
Federation Status
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/registryUtil.js b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/registryUtil.js
index d18e21c681..41ec5d9945 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/registryUtil.js
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/registryUtil.js
@@ -1,4 +1,34 @@
-
+/*
+This software was developed and / or modified by Raytheon Company,
+pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+
+U.S. EXPORT CONTROLLED TECHNICAL DATA
+This software product contains export-restricted data whose
+export/transfer/disclosure is restricted by U.S. law. Dissemination
+to non-U.S. persons whether in the United States or abroad requires
+an export license or other authorization.
+
+Contractor Name: Raytheon Company
+Contractor Address: 6825 Pine Street, Suite 340
+ Mail Stop B8
+ Omaha, NE 68106
+ 402.291.0100
+
+See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+further licensing information.
+
+Navigation pane containing links
+
+SOFTWARE HISTORY
+
+Date Ticket# Engineer Description
+------------ ---------- ----------- --------------------------
+10/15/2013 1682 bphillip Initial implementation
+
+
+@author bphillip
+@version 1
+*/
function callRestService(url,arg){
var url = "http://"+window.location.host+"/"+url
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/DefineQuery.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/DefineQuery.html
new file mode 100644
index 0000000000..be98a2cfc8
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/DefineQuery.html
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+ Registry Query Definition Manager
+
+
+
+
+Remove Custom Query Definition
+
+
+
+
+
+Define New Query Definition
+Query Definition
+
+
+
+Query Parameter Definition
+
+
+
+Defined Parameters
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/com.raytheon.uf.edex.text.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.text.feature/feature.xml
index 49bff7ab36..10df591fb1 100644
--- a/edexOsgi/com.raytheon.uf.edex.text.feature/feature.xml
+++ b/edexOsgi/com.raytheon.uf.edex.text.feature/feature.xml
@@ -19,6 +19,7 @@
+
0) {
+ if ((svalues != null) && (svalues.size() > 0)) {
genContour();
- if (!isCntrsCreated)
+ if (!isCntrsCreated) {
return;
+ }
} else {
logger.debug("Re-load contour line values took: " + (t2 - t1));
}
@@ -461,8 +463,9 @@ public class ContourSupport {
Envelope imageEnv = ref.transform(
imageGridGeometry.getCoordinateReferenceSystem(), true);
- if (imageEnv == null)
+ if (imageEnv == null) {
return null;
+ }
// transform image envelope to image grid cells
double[] image = new double[] { imageEnv.getMinX(),
@@ -497,7 +500,8 @@ public class ContourSupport {
int actualLength = 0;
for (double[] dl : valsArr) {
- if (dl[0] > minx && dl[0] < maxx && dl[1] > miny && dl[1] < maxy) {
+ if ((dl[0] > minx) && (dl[0] < maxx) && (dl[1] > miny)
+ && (dl[1] < maxy)) {
visiblePts[actualLength][0] = dl[0];
visiblePts[actualLength][1] = dl[1];
actualLength++;
@@ -524,8 +528,9 @@ public class ContourSupport {
// remove points on longitude 360 degree. to avoid long cross lines
if (isWorld180) {
for (Coordinate pt : coords) {
- if (pt.x == maxGridX)
+ if (pt.x == maxGridX) {
size--;
+ }
}
}
@@ -533,7 +538,7 @@ public class ContourSupport {
long nx = records.getSizes()[0] - 1;
for (int i = 0, jj = 0; i < coords.length; i++, jj++) {
- if (isWorld180 && coords[i].x == maxGridX) {
+ if (isWorld180 && (coords[i].x == maxGridX)) {
jj--;
continue;
}
@@ -552,9 +557,10 @@ public class ContourSupport {
}
if (worldWrap) {
- if (tmp[0] > (nx - 1) && out[jj][0] < 0) {
+ if ((tmp[0] > (nx - 1)) && (out[jj][0] < 0)) {
out[jj][0] = mapScreenWidth;
- } else if (tmp[0] < 1 && out[jj][0] > mapScreenWidth * 0.9) {
+ } else if ((tmp[0] < 1)
+ && (out[jj][0] > (mapScreenWidth * 0.9))) {
out[jj][0] = 0;
}
}
@@ -585,8 +591,8 @@ public class ContourSupport {
return null;
}
- if (out[i][0] < zeroLonOnScreen
- || (tmp[0] == maxGridX && out[i][0] == zeroLonOnScreen)) {
+ if ((out[i][0] < zeroLonOnScreen)
+ || ((tmp[0] == maxGridX) && (out[i][0] == zeroLonOnScreen))) {
out[i][0] += mapScreenWidth;
}
@@ -617,8 +623,8 @@ public class ContourSupport {
return null;
}
- if (tmpout[0] < zeroLonOnScreen
- || (tmp[0] == maxGridX && tmpout[0] == zeroLonOnScreen)) {
+ if ((tmpout[0] < zeroLonOnScreen)
+ || ((tmp[0] == maxGridX) && (tmpout[0] == zeroLonOnScreen))) {
tmpout[0] += mapScreenWidth;
}
@@ -653,8 +659,8 @@ public class ContourSupport {
// System.out.println("WWWWWWW " + tmp[0]+" " + tmpout[0] +
// " " + out[i][0]);
- if (out[i][0] > zeroLonOnScreen
- || (tmp[0] == 0 && out[i][0] == zeroLonOnScreen)) {
+ if ((out[i][0] > zeroLonOnScreen)
+ || ((tmp[0] == 0) && (out[i][0] == zeroLonOnScreen))) {
// System.out.println("Shift " + tmp[0]+" " + out[i][0]);
out[i][0] -= mapScreenWidth;
}
@@ -686,8 +692,8 @@ public class ContourSupport {
return null;
}
- if (tmpout[0] > zeroLonOnScreen
- || (tmp[0] == 0 && tmpout[0] == zeroLonOnScreen)) {
+ if ((tmpout[0] > zeroLonOnScreen)
+ || ((tmp[0] == 0) && (tmpout[0] == zeroLonOnScreen))) {
tmpout[0] -= mapScreenWidth;
}
@@ -712,8 +718,9 @@ public class ContourSupport {
// remove points on 360. to avoid long cross lines
if (isWorld180) {
for (Coordinate pt : coords) {
- if (pt.x == maxGridX)
+ if (pt.x == maxGridX) {
size--;
+ }
}
}
@@ -721,7 +728,7 @@ public class ContourSupport {
double[] tmpout = new double[3];
for (int i = 0, jj = 0; i < coords.length; i++, jj++) {
- if (isWorld180 && coords[i].x == maxGridX) {
+ if (isWorld180 && (coords[i].x == maxGridX)) {
jj--;
continue;
}
@@ -739,9 +746,10 @@ public class ContourSupport {
return null;
}
if (worldWrap) {
- if (tmp[0] > (nx - 1) && tmpout[0] < 0) {
+ if ((tmp[0] > (nx - 1)) && (tmpout[0] < 0)) {
tmpout[0] = extent.getMaxX();
- } else if (tmp[0] < 1 && tmpout[0] > extent.getMaxX() * 0.9) {
+ } else if ((tmp[0] < 1)
+ && (tmpout[0] > (extent.getMaxX() * 0.9))) {
tmpout[0] = 0;
}
}
@@ -759,8 +767,9 @@ public class ContourSupport {
private static Geometry polyToLine(Polygon poly) {
GeometryFactory gf = new GeometryFactory();
- if (poly.getNumInteriorRing() == 0)
+ if (poly.getNumInteriorRing() == 0) {
return poly;
+ }
poly.normalize();
LineString outerPoly = poly.getExteriorRing();
@@ -826,7 +835,7 @@ public class ContourSupport {
// Geometry testGeom;
Coordinate[] coords = outerPoly.getCoordinates();
- for (int i = 0; i < coords.length - 1; i++) {
+ for (int i = 0; i < (coords.length - 1); i++) {
Coordinate intx = null;
if (((y <= coords[i].y) && (y >= coords[i + 1].y))
|| ((y >= coords[i].y) && (y <= coords[i + 1].y))) {
@@ -840,8 +849,9 @@ public class ContourSupport {
// }
if (intx != null) {
- if (max.compareTo(intx) == -1)
+ if (max.compareTo(intx) == -1) {
max = intx;
+ }
}
// testGeom = seg.intersection(temp);
@@ -865,8 +875,9 @@ public class ContourSupport {
double centralMeridian = group.parameter(
AbstractProvider.CENTRAL_MERIDIAN.getName().getCode())
.doubleValue();
- if (centralMeridian > 180)
+ if (centralMeridian > 180) {
centralMeridian -= 360;
+ }
return centralMeridian;
}
return -999;
@@ -914,17 +925,18 @@ public class ContourSupport {
contourGroup.grid = null;
if (contourGp != null) {
- if (contourGp.cvalues != null && contourGp.cvalues.size() > 0) {
+ if ((contourGp.cvalues != null) && (contourGp.cvalues.size() > 0)) {
contourGroup.cvalues.addAll(contourGp.cvalues);
}
- if (contourGp.fvalues != null && contourGp.fvalues.size() > 0) {
+ if ((contourGp.fvalues != null) && (contourGp.fvalues.size() > 0)) {
contourGroup.fvalues.addAll(contourGp.fvalues);
}
- if (contourGp.data != null && contourGp.data.size() > 0) {
+ if ((contourGp.data != null) && (contourGp.data.size() > 0)) {
contourGroup.data.putAll(contourGp.data);
}
- if (contourGp.grid != null)
+ if (contourGp.grid != null) {
contourGroup.grid = contourGp.grid;
+ }
}
contourGroup.lastUsedPixelExtent = (PixelExtent) extent.clone();
@@ -975,14 +987,17 @@ public class ContourSupport {
private void initZoomIndex() {
zoomLevelIndex = level + 1;// (int)(zoom / 2) + 1; // To be adjusted
- if (zoomLevelIndex < 1)
+ if (zoomLevelIndex < 1) {
zoomLevelIndex = 1;
+ }
int maxZoomLevel = 5;
String cint = attr.getCint();
- if (cint != null)
+ if (cint != null) {
maxZoomLevel = cint.trim().split(">").length;
- if (zoomLevelIndex > maxZoomLevel)
+ }
+ if (zoomLevelIndex > maxZoomLevel) {
zoomLevelIndex = maxZoomLevel;
+ }
}
private List calcCintValue() {
@@ -997,7 +1012,7 @@ public class ContourSupport {
// System.out.println ("******cgen.getMinValue():" + cgen.getMinValue()
// + " cgen.getMaxValue():"+cgen.getMaxValue());
// }
- if (contourGroup.cvalues.size() == 0 && cvalues != null) {
+ if ((contourGroup.cvalues.size() == 0) && (cvalues != null)) {
contourGroup.cvalues.addAll(cvalues);
} else if (contourGroup.cvalues.size() > 0) {
if (cvalues != null) {
@@ -1022,7 +1037,7 @@ public class ContourSupport {
fvalues = contourGroup.cvalues;
}
}
- if (contourGroup.fvalues.size() == 0 && fvalues != null) {
+ if ((contourGroup.fvalues.size() == 0) && (fvalues != null)) {
contourGroup.fvalues.addAll(fvalues);
} else if (contourGroup.fvalues.size() > 0) {
if (fvalues != null) {
@@ -1038,13 +1053,15 @@ public class ContourSupport {
}
private void combineCintAndFillValues() {
- if (cvalues != null && cvalues.size() > 0)
+ if ((cvalues != null) && (cvalues.size() > 0)) {
svalues = new HashSet(cvalues);
- if (fvalues != null && fvalues.size() > 0) {
- if (svalues == null)
+ }
+ if ((fvalues != null) && (fvalues.size() > 0)) {
+ if (svalues == null) {
svalues = new HashSet(fvalues);
- else
+ } else {
svalues.addAll(fvalues);
+ }
}
}
@@ -1053,7 +1070,7 @@ public class ContourSupport {
long total_labeling_time = 0;
long t2 = System.currentTimeMillis();
if (type.trim().toUpperCase().contains("C")
- && contourGroup.cvalues.size() > 0) {
+ && (contourGroup.cvalues.size() > 0)) {
int labelFreq = 1;
String[] tempLineStrs = attr.getLine().split("/");
List labelValues = null;
@@ -1087,15 +1104,17 @@ public class ContourSupport {
}
}
} else {
- if (labelFreq == 0)
+ if (labelFreq == 0) {
toLabel = false;
- else
- toLabel = (n % labelFreq == 0) ? true : false;
+ } else {
+ toLabel = ((n % labelFreq) == 0) ? true : false;
+ }
}
Geometry g = contourGroup.data.get(cval.toString());
- if (g == null)
+ if (g == null) {
continue;
+ }
for (int i = 0; i < g.getNumGeometries(); i++) {
Geometry gn = g.getGeometryN(i);
@@ -1108,18 +1127,21 @@ public class ContourSupport {
screen = toScreenRightOfZero(gn.getCoordinates(),
rastPosToWorldGrid, minX, minY);
- if (screen != null)
+ if (screen != null) {
contourGroup.negValueShape.addLineSegment(screen);
+ }
screenx = toScreenLeftOfZero(gn.getCoordinates(),
rastPosToWorldGrid, minX, minY);
- if (screenx != null)
+ if (screenx != null) {
contourGroup.negValueShape.addLineSegment(screenx);
+ }
} else {
screen = toScreen(gn.getCoordinates(),
rastPosToWorldGrid, minX, minY);
- if (screen != null)
+ if (screen != null) {
contourGroup.negValueShape.addLineSegment(screen);
+ }
}
/*
@@ -1133,9 +1155,10 @@ public class ContourSupport {
long tl0 = System.currentTimeMillis();
// prepareLabel(contourGroup, zoom, fval,
// labelPoints, screen);
- if (screen != null)
+ if (screen != null) {
createContourLabel(extent, contourGroup, fval,
screen);
+ }
if (screenx != null) {
createContourLabel(extent, contourGroup, fval,
screenx);
@@ -1151,11 +1174,13 @@ public class ContourSupport {
long t3 = System.currentTimeMillis();
logger.debug("===Creating label wireframes for (" + name + ") took: "
+ total_labeling_time);
- if (ncgribLogger.enableCntrLogs())
+ if (ncgribLogger.enableCntrLogs()) {
logger.info("===Creating contour line wireframes for (" + name
+ ")took: " + (t3 - t2));
- // System.out.println("Creating contour line wireframes took: " + (t3 -
- // t2 - total_labeling_time));
+ // System.out.println("Creating contour line wireframes took: " +
+ // (t3 -
+ // t2 - total_labeling_time));
+ }
}
private void createColorFills() {
@@ -1164,7 +1189,7 @@ public class ContourSupport {
// Prepare the colorbar
if (type.trim().toUpperCase().contains("F")
- && (attr.getClrbar() != null || !"0".equals(attr.getClrbar()))) {
+ && ((attr.getClrbar() != null) || !"0".equals(attr.getClrbar()))) {
ColorBar tempColorBar = generateColorBarInfo();
if (tempColorBar != null) {
contourGroup.colorBarForGriddedFill = new ColorBar(tempColorBar);
@@ -1174,18 +1199,19 @@ public class ContourSupport {
}
if (type.trim().toUpperCase().contains("F")
- && contourGroup.fvalues.size() > 0) {
+ && (contourGroup.fvalues.size() > 0)) {
try {
// Prepare colors for color fills
List fillColorsIndex = new ArrayList();
- if (fline == null || fline.trim().length() < 1) {
- for (int i = 0; i < contourGroup.fvalues.size() + 2; i++) {
- if (i <= 30)
+ if ((fline == null) || (fline.trim().length() < 1)) {
+ for (int i = 0; i < (contourGroup.fvalues.size() + 2); i++) {
+ if (i <= 30) {
fillColorsIndex.add(i + 1);
- else
+ } else {
fillColorsIndex.add(30);
+ }
}
} else {
FLine flineInfo = new FLine(fline.trim());
@@ -1194,11 +1220,11 @@ public class ContourSupport {
/*
* Apply last color if not enough input color.
*/
- if (contourGroup.fvalues != null
- && fillColorsIndex.size() < (contourGroup.fvalues
- .size() + 1)) {
- for (int i = fillColorsIndex.size(); i < contourGroup.fvalues
- .size() + 2; i++) {
+ if ((contourGroup.fvalues != null)
+ && (fillColorsIndex.size() < (contourGroup.fvalues
+ .size() + 1))) {
+ for (int i = fillColorsIndex.size(); i < (contourGroup.fvalues
+ .size() + 2); i++) {
fillColorsIndex.add(i);
}
}
@@ -1212,17 +1238,19 @@ public class ContourSupport {
for (Double cval : contourGroup.fvalues) {
float fval = (float) (cval * 1.0f);
Geometry g = contourGroup.data.get(cval.toString());
- if (g == null)
+ if (g == null) {
continue;
+ }
fgen.addContours(fval, g);
}
t11 = System.currentTimeMillis();
logger.debug(" add Contour took:" + (t11 - t12));
// Add color fill to contourGroup
for (int n = 0; n <= contourGroup.fvalues.size(); n++) {
- if (fillColorsIndex.get(n) <= 0
- || fillColorsIndex.get(n) >= 32)
+ if ((fillColorsIndex.get(n) <= 0)
+ || (fillColorsIndex.get(n) >= 32)) {
continue;
+ }
RGB color = GempakColor
.convertToRGB(fillColorsIndex.get(n));
@@ -1244,33 +1272,37 @@ public class ContourSupport {
}
for (int j = 0; j < fillPolys.getNumGeometries(); j++) {
Geometry g = fillPolys.getGeometryN(j);
- if (g instanceof Polygon)
+ if (g instanceof Polygon) {
g = polyToLine((Polygon) g);
+ }
if (worldWrap) {
LineString ls = toScreenLSRightOfZero(
g.getCoordinates(), rastPosToWorldGrid,
minX, minY);
- if (ls != null)
+ if (ls != null) {
contourGroup.fillShapes
.addPolygonPixelSpace(
new LineString[] { ls },
color);
+ }
ls = toScreenLSLeftOfZero(g.getCoordinates(),
rastPosToWorldGrid, minX, minY);
- if (ls != null)
+ if (ls != null) {
contourGroup.fillShapes
.addPolygonPixelSpace(
new LineString[] { ls },
color);
+ }
} else {
LineString ls = toScreenLS(g.getCoordinates(),
rastPosToWorldGrid, minX, minY);
- if (ls != null)
+ if (ls != null) {
contourGroup.fillShapes
.addPolygonPixelSpace(
new LineString[] { ls },
color);
+ }
}
// if ( isWorld0 ) {
@@ -1297,9 +1329,10 @@ public class ContourSupport {
}
}
long t4 = System.currentTimeMillis();
- if (ncgribLogger.enableCntrLogs())
+ if (ncgribLogger.enableCntrLogs()) {
logger.info("===Creating color fills for (" + name + ") took : "
+ (t4 - t3));
+ }
}
private void createStreamLines() {
@@ -1337,7 +1370,7 @@ public class ContourSupport {
if (globalData) {
for (int j = 0; j < szY; j++) {
- for (int i = 0; i < szX + 1; i++) {
+ for (int i = 0; i < (szX + 1); i++) {
if ((i + minX) == 360) {
continue;
}
@@ -1368,7 +1401,7 @@ public class ContourSupport {
// Use ported legacy code to determine contour interval
// contourGroup.lastDensity = currentDensity;
- double spadiv = 1 * contourGroup.lastDensity * 500 / 25;
+ double spadiv = (1 * contourGroup.lastDensity * 500) / 25;
double minSpacing = 1.0 / spadiv;
double maxSpacing = 3.0 / spadiv;
@@ -1393,8 +1426,9 @@ public class ContourSupport {
* Fix arrow size by M. Li
*/
float arrowSize = (float) (0.4f / Math.sqrt(zoom));
- if (arrowSize > 0.4)
+ if (arrowSize > 0.4) {
arrowSize = 0.4f;
+ }
StrmPakConfig config = new StrmPakConfig(arrowSize, minspc, maxspc,
-1000000f, -999998f);
@@ -1423,11 +1457,12 @@ public class ContourSupport {
}
else {
- f = maxX + 1 - point.getX();
+ f = (maxX + 1) - point.getX();
}
- if (f > 180)
+ if (f > 180) {
f = f - 360;
+ }
rastPosToWorldGrid.transform(
new double[] { f, point.getY() + minY }, 0,
@@ -1450,14 +1485,16 @@ public class ContourSupport {
screen = toScreenRightOfZero(
pts.toArray(new Coordinate[pts.size()]),
rastPosToWorldGrid, minX, minY);
- if (screen != null)
+ if (screen != null) {
contourGroup.posValueShape.addLineSegment(screen);
+ }
screenx = toScreenLeftOfZero(
pts.toArray(new Coordinate[pts.size()]),
rastPosToWorldGrid, minX, minY);
- if (screenx != null)
+ if (screenx != null) {
contourGroup.posValueShape.addLineSegment(screenx);
+ }
} else {
double[][] valsArr = vals.toArray(new double[vals
.size()][2]);
@@ -1482,14 +1519,16 @@ public class ContourSupport {
screen = toScreenRightOfZero(
pts.toArray(new Coordinate[pts.size()]),
rastPosToWorldGrid, minX, minY);
- if (screen != null)
+ if (screen != null) {
contourGroup.posValueShape.addLineSegment(screen);
+ }
screenx = toScreenLeftOfZero(
pts.toArray(new Coordinate[pts.size()]),
rastPosToWorldGrid, minX, minY);
- if (screenx != null)
+ if (screenx != null) {
contourGroup.posValueShape.addLineSegment(screenx);
+ }
}
vals.clear();
}
@@ -1503,7 +1542,7 @@ public class ContourSupport {
private ColorBar generateColorBarInfo() {
- if (attr.getClrbar() != null && !attr.getClrbar().isEmpty()) {
+ if ((attr.getClrbar() != null) && !attr.getClrbar().isEmpty()) {
contourGroup.clrbar = new CLRBAR(attr.getClrbar());
ColorBarAttributesBuilder cBarAttrBuilder = contourGroup.clrbar
.getcBarAttributesBuilder();
@@ -1517,8 +1556,9 @@ public class ContourSupport {
FINT theFillIntervals = new FINT(fint.trim());
FLine fillColorString = new FLine(fline.trim());
if (!theFillIntervals.isFINTStringParsed()
- || !fillColorString.isFLineStringParsed())
+ || !fillColorString.isFLineStringParsed()) {
return null;
+ }
List fillIntvls = theFillIntervals
.getUniqueSortedFillValuesFromAllZoomLevels();
List fillColors = fillColorString.getFillColorList();
@@ -1527,14 +1567,14 @@ public class ContourSupport {
int numFillIntervals = fillIntvls.size();
fillIntvls.add(numFillIntervals, Double.POSITIVE_INFINITY);
int numDecimals = 0;
- for (int index = 0; index <= numFillIntervals - 1; index++) {
+ for (int index = 0; index <= (numFillIntervals - 1); index++) {
colorBar.addColorBarInterval(fillIntvls.get(index)
.floatValue(), fillIntvls.get(index + 1)
.floatValue(), GempakColor.convertToRGB(fillColors
.get(index)));
String tmp[] = fillIntvls.get(index).toString()
.split("\\.");
- if (tmp.length > 1 && tmp[1].length() > numDecimals
+ if ((tmp.length > 1) && (tmp[1].length() > numDecimals)
&& !"0".equals(tmp[1])) {
numDecimals = tmp[1].length();
}
@@ -1577,9 +1617,10 @@ public class ContourSupport {
}
long t2 = System.currentTimeMillis();
- if (ncgribLogger.enableCntrLogs())
+ if (ncgribLogger.enableCntrLogs()) {
logger.info("===ContourGenerator.generateContours() for (" + name
+ ") took: " + (t2 - t1a));
+ }
// System.out.println("Contour Computation took: " + (t2-t1c));
@@ -1606,8 +1647,9 @@ public class ContourSupport {
}
public ContourGroup getContours() {
- if (!isCntrsCreated)
+ if (!isCntrsCreated) {
return null;
+ }
return contourGroup;
}
@@ -1645,11 +1687,13 @@ public class ContourSupport {
double minLon = (out0[0] >= 0) ? out0[0] : out0[0] + 360;
double maxLon = (out1[0] >= 0) ? out1[0] : out1[0] + 360;
- if (minLon == 0 && maxLon == 360)
+ if ((minLon == 0) && (maxLon == 360)) {
globalData = true;
+ }
- if (maxLon >= 360)
+ if (maxLon >= 360) {
maxLon = 359;
+ }
double right = centralMeridian + 180;
if (maxLon > minLon) {
diff --git a/rpms/awips2.core/Installer.httpd-pypies/SOURCES/httpd-pypies.logrotate b/rpms/awips2.core/Installer.httpd-pypies/SOURCES/httpd-pypies.logrotate
deleted file mode 100644
index ab3f28b269..0000000000
--- a/rpms/awips2.core/Installer.httpd-pypies/SOURCES/httpd-pypies.logrotate
+++ /dev/null
@@ -1,8 +0,0 @@
-/awips2/httpd_pypies/var/log/httpd/*log {
- missingok
- notifempty
- sharedscripts
- postrotate
- /sbin/service httpd-pypies reload > /dev/null 2>/dev/null || true
- endscript
-}
diff --git a/rpms/build/i386/build.sh_old b/rpms/build/i386/build.sh_old
deleted file mode 100644
index 37dbb8eaa6..0000000000
--- a/rpms/build/i386/build.sh_old
+++ /dev/null
@@ -1,423 +0,0 @@
-#!/bin/bash
-
-function buildRPM()
-{
- # Arguments:
- # ${1} == the name of the rpm.
- lookupRPM "${1}"
- if [ $? -ne 0 ]; then
- echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
- exit 1
- fi
-
- /usr/bin/rpmbuild -ba \
- --define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
- --define '_baseline_workspace %(echo ${WORKSPACE})' \
- --define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
- --define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \
- --define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \
- --define '_component_version %(echo ${AWIPSII_VERSION})' \
- --define '_component_release %(echo ${AWIPSII_RELEASE})' \
- --define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \
- --define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
- --define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
- --buildroot ${AWIPSII_BUILD_ROOT} \
- ${RPM_SPECIFICATION}/component.spec
- if [ $? -ne 0 ]; then
- echo "ERROR: Failed to build RPM ${1}."
- exit 1
- fi
-
- return 0
-}
-
-# This script will build all of the 32-bit rpms.
-# Ensure that we are on a machine with the correct architecture.
-
-architecture=`uname -i`
-if [ ! "${architecture}" = "i386" ]; then
- echo "ERROR: This build can only be performed on a 32-bit Operating System."
- exit 1
-fi
-
-# Determine which directory we are running from.
-path_to_script=`readlink -f $0`
-dir=$(dirname $path_to_script)
-
-common_dir=`cd ${dir}/../common; pwd;`
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to find the common functions directory."
- exit 1
-fi
-# source the common functions.
-source ${common_dir}/lookupRPM.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/usage.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/rpms.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/systemInfo.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to retrieve the system information."
- exit 1
-fi
-
-# prepare the build environment.
-source ${dir}/buildEnvironment.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to prepare the build environment."
- exit 1
-fi
-
-export LIGHTNING=true
-# Determine if the optional '-nobinlightning' argument has been specified.
-if [ "${2}" = "-nobinlightning" ]; then
- LIGHTNING=false
-fi
-
-if [ "${1}" = "-python-qpid" ]; then
- buildRPM "awips2"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- #buildRPM "awips2-ant"
- #unpackHttpdPypies
- if [ $? -ne 0 ]; then
- exit 1
- fi
- #buildRPM "awips2-httpd-pypies"
- #buildRPM "awips2-java"
- #buildRPM "awips2-ldm"
- #buildRPM "awips2-tools"
- buildRPM "awips2-python-shapely"
-
- exit 0
-fi
-
-if [ "${1}" = "-postgres" ]; then
- buildRPM "awips2-postgres"
- buildRPM "awips2-database-server-configuration"
- buildRPM "awips2-database-standalone-configuration"
- buildRPM "awips2-database"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-pgadmin3"
-
- exit 0
-fi
-
-if [ "${1}" = "-delta" ]; then
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- buildRPM "awips2"
- buildRPM "Installer.ncep-database"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "awips2-python"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-qpid"
-
- buildRPM "awips2-adapt-native"
- buildRPM "awips2-aviation-shared"
- buildRPM "awips2-cli"
- buildRPM "awips2-database"
- buildRPM "awips2-database-server-configuration"
- buildRPM "awips2-database-standalone-configuration"
- buildRPM "awips2-data.hdf5-gfe.climo"
- buildRPM "awips2-hydroapps-shared"
- buildRPM "awips2-localapps-environment"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-notification"
- buildRPM "awips2-pypies"
- buildRPM "awips2-data.hdf5-topo"
- buildRPM "awips2-data.gfe"
- buildRPM "awips2-rcm"
- buildRPM "awips2-edex-environment"
- buildLocalizationRPMs
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-full" ]; then
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "Installer.ncep-database"
- buildRPM "awips2-alertviz"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
-
- buildRPM "awips2"
- buildRPM "awips2-adapt-native"
- buildRPM "awips2-aviation-shared"
- buildRPM "awips2-cli"
- buildRPM "awips2-database"
- buildRPM "awips2-database-server-configuration"
- buildRPM "awips2-database-standalone-configuration"
- buildRPM "awips2-data.hdf5-gfe.climo"
- buildRPM "awips2-data.gfe"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "awips2-hydroapps-shared"
- buildRPM "awips2-localapps-environment"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-notification"
- buildRPM "awips2-pypies"
- buildRPM "awips2-data.hdf5-topo"
- buildRPM "awips2-rcm"
- buildLocalizationRPMs
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- buildRPM "awips2-ant"
- unpackHttpdPypies
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-httpd-pypies"
- buildRPM "awips2-java"
- #buildRPM "awips2-ldm"
- buildRPM "awips2-postgres"
- buildRPM "awips2-pgadmin3"
- buildRPM "awips2-tools"
- buildRPM "awips2-edex-environment"
- buildRPM "awips2-openfire"
- buildRPM "awips2-httpd-collaboration"
- buildRPM "awips2-python-shapely"
-
- exit 0
-fi
-
-if [ "${1}" = "-ade" ]; then
- buildRPM "awips2-eclipse"
- buildRPM "awips2-java"
- buildRPM "awips2-ant"
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
- buildRPM "awips2-python-shapely"
- buildQPID -ade
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- # Package the ade.
- # Create the containing directory.
- ade_directory="awips2-ade-${AWIPSII_VERSION}-${AWIPSII_RELEASE}"
- if [ -d ${WORKSPACE}/${ade_directory} ]; then
- rm -rf ${WORKSPACE}/${ade_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
- fi
- mkdir -p ${WORKSPACE}/${ade_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- # Copy the rpms to the directory.
- cp -v ${AWIPSII_TOP_DIR}/RPMS/i386/* \
- ${AWIPSII_TOP_DIR}/RPMS/noarch/* \
- ${WORKSPACE}/${ade_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- awips2_ade_directory="${WORKSPACE}/rpms/awips2.ade"
- # Copy the install and uninstall script to the directory.
- cp -v ${awips2_ade_directory}/tar.ade/scripts/*.sh \
- ${WORKSPACE}/${ade_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- # Tar the directory.
- pushd . > /dev/null 2>&1
- cd ${WORKSPACE}
- tar -cvf ${ade_directory}.tar ${ade_directory}
- popd > /dev/null 2>&1
- RC=$?
- if [ ${RC} -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-viz" ]; then
- buildRPM "awips2"
- buildRPM "awips2-rcm"
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
-
- exit 0
-fi
-
-if [ "${1}" = "-edex" ]; then
- buildRPM "awips2"
- buildRPM "awips2-cli"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "Installer.ncep-database"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-qpid" ]; then
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-ldm" ]; then
- buildRPM "awips2-ldm"
-
- exit 0
-fi
-
-if [ "${1}" = "-package" ]; then
- repository_directory="awips2-repository-${AWIPSII_VERSION}-${AWIPSII_RELEASE}"
- if [ -d ${WORKSPACE}/${repository_directory} ]; then
- rm -rf ${WORKSPACE}/${repository_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
- fi
- mkdir -p ${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- cp -r ${AWIPSII_TOP_DIR}/RPMS/* \
- ${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- rpms_directory="${WORKSPACE}/rpms"
- comps_xml="${rpms_directory}/common/yum/arch.x86/comps.xml"
- cp -v ${comps_xml} ${WORKSPACE}/${repository_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- pushd . > /dev/null
- cd ${WORKSPACE}
- tar -cvf ${repository_directory}.tar ${repository_directory}
- RC=$?
- popd > /dev/null
- if [ ${RC} -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-
-usage
-exit 0
diff --git a/rpms/build/x86_64/build.sh.orig b/rpms/build/x86_64/build.sh.orig
deleted file mode 100644
index a2ee31d613..0000000000
--- a/rpms/build/x86_64/build.sh.orig
+++ /dev/null
@@ -1,406 +0,0 @@
-#!/bin/bash
-
-function buildRPM()
-{
- # Arguments:
- # ${1} == the name of the rpm.
- lookupRPM "${1}"
- if [ $? -ne 0 ]; then
- echo "ERROR: '${1}' is not a recognized AWIPS II RPM."
- exit 1
- fi
-
- /usr/bin/rpmbuild -ba \
- --define '_topdir %(echo ${AWIPSII_TOP_DIR})' \
- --define '_baseline_workspace %(echo ${WORKSPACE})' \
- --define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
- --define '_awipscm_share %(echo ${AWIPSCM_SHARE})' \
- --define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \
- --define '_component_version %(echo ${AWIPSII_VERSION})' \
- --define '_component_release %(echo ${AWIPSII_RELEASE})' \
- --define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \
- --define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \
- --define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \
- --buildroot ${AWIPSII_BUILD_ROOT} \
- ${RPM_SPECIFICATION}/component.spec
- if [ $? -ne 0 ]; then
- echo "ERROR: Failed to build RPM ${1}."
- exit 1
- fi
-
- return 0
-}
-
-# This script will build all of the 64-bit rpms.
-# Ensure that we are on a machine with the correct architecture.
-
-architecture=`uname -i`
-if [ ! "${architecture}" = "x86_64" ]; then
- echo "ERROR: This build can only be performed on a 64-bit Operating System."
- exit 1
-fi
-
-# Determine which directory we are running from.
-path_to_script=`readlink -f $0`
-dir=$(dirname $path_to_script)
-
-common_dir=`cd ${dir}/../common; pwd;`
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to find the common functions directory."
- exit 1
-fi
-# source the common functions.
-source ${common_dir}/lookupRPM.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/usage.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/rpms.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to source the common functions."
- exit 1
-fi
-source ${common_dir}/systemInfo.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to retrieve the system information."
- exit 1
-fi
-
-# prepare the build environment.
-source ${dir}/buildEnvironment.sh
-if [ $? -ne 0 ]; then
- echo "ERROR: Unable to prepare the build environment."
- exit 1
-fi
-
-export LIGHTNING=true
-# Determine if the optional '-nobinlightning' argument has been specified.
-if [ "${2}" = "-nobinlightning" ]; then
- LIGHTNING=false
-fi
-
-if [ "${1}" = "-64bit" ]; then
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
- buildJava
- buildRPM "awips2"
- buildRPM "awips2-python-shapely"
- buildRPM "awips2-notification"
-
- exit 0
-fi
-
-if [ "${1}" = "-rh6" ]; then
- buildRPM "awips2-notification"
- buildRPM "awips2-common-base"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-hydroapps-shared"
- buildJava
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-pycairo"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-shapely"
- buildRPM "awips2-ant"
- buildRPM "awips2-tools"
- buildRPM "awips2-postgres"
- buildRPM "awips2-pgadmin3"
- unpackHttpdPypies
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-httpd-pypies"
- buildRPM "awips2-httpd-collaboration"
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-ldm"
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 0
- fi
- buildRPM "awips2-alertviz"
- buildRPM "awips2-database-server-configuration"
- buildRPM "awips2-database-standalone-configuration"
- buildRPM "awips2-database"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-ncep-database"
- buildRPM "awips2-adapt-native"
- buildRPM "awips2-aviation-shared"
- buildRPM "awips2-cli"
- buildRPM "awips2-edex-environment"
- buildRPM "awips2-data.gfe"
- buildRPM "awips2-data.hdf5-gfe.climo"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "awips2-groovy"
- buildRPM "awips2-localapps-environment"
- buildLocalizationRPMs
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-pypies"
- buildRPM "awips2-rcm"
- buildRPM "awips2-data.hdf5-topo"
- buildRPM "awips2"
- buildOpenfire
-
- exit 0
-fi
-
-if [ "${1}" = "-postgres" ]; then
- buildRPM "awips2-postgres"
- buildRPM "awips2-database-server-configuration"
- buildRPM "awips2-database-standalone-configuration"
- buildRPM "awips2-database"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-ncep-database"
- buildRPM "awips2-pgadmin3"
-
- exit 0
-fi
-
-if [ "${1}" = "-delta" ]; then
- buildRPM "awips2-common-base"
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-cli"
- buildRPM "awips2-data.hdf5-gfe.climo"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "awips2-localapps-environment"
- buildRPM "awips2-data.hdf5-topo"
- buildRPM "awips2-data.gfe"
- buildRPM "awips2"
- buildLocalizationRPMs
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-edex-environment"
- buildRPM "awips2-notification"
-
- exit 0
-fi
-
-if [ "${1}" = "-full" ]; then
- # buildRPM "awips2-common-base"
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
- buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- # buildRPM "awips2-python-qpid"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
- buildRPM "awips2-cli"
- buildRPM "awips2-data.hdf5-gfe.climo"
- buildRPM "awips2-gfesuite-client"
- buildRPM "awips2-gfesuite-server"
- buildRPM "awips2-localapps-environment"
- buildRPM "awips2-data.hdf5-topo"
- buildRPM "awips2-data.gfe"
- buildRPM "awips2"
- unpackHttpdPypies
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-httpd-pypies"
- buildJava
- buildRPM "awips2-groovy"
- buildLocalizationRPMs
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-edex-environment"
- buildRPM "awips2-notification"
- buildRPM "awips2-python-shapely"
- buildRPM "awips2-postgres"
- buildRPM "awips2-database"
- buildRPM "awips2-maps-database"
- buildRPM "awips2-ncep-database"
- buildRPM "awips2-pgadmin3"
- buildRPM "awips2-ldm"
- exit 0
-fi
-
-if [ "${1}" = "-ade" ]; then
- echo "INFO: AWIPS II currently does not support a 64-bit version of the ADE."
- exit 0
- buildRPM "awips2-eclipse"
-
- exit 0
-fi
-
-if [ "${1}" = "-viz" ]; then
- buildRPM "awips2"
- buildRPM "awips2-common-base"
- buildRPM "awips2-tools"
- buildRPM "awips2-cli"
- buildCAVE
- if [ $? -ne 0 ]; then
- exit 1
- fi
- buildRPM "awips2-alertviz"
-
- exit 0
-fi
-
-if [ "${1}" = "-edex" ]; then
- buildRPM "awips2-common-base"
- buildEDEX
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-custom" ]; then
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-qpid" ]; then
- buildRPM "awips2-python-qpid"
- buildQPID
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-if [ "${1}" = "-ldm" ]; then
- buildRPM "awips2-ldm"
-
- exit 0
-fi
-
-if [ "${1}" = "-package" ]; then
- repository_directory="awips2-repository-${AWIPSII_VERSION}-${AWIPSII_RELEASE}"
- if [ -d ${WORKSPACE}/${repository_directory} ]; then
- rm -rf ${WORKSPACE}/${repository_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
- fi
- mkdir -p ${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- cp -r ${AWIPSII_TOP_DIR}/RPMS/* \
- ${WORKSPACE}/${repository_directory}/${AWIPSII_VERSION}-${AWIPSII_RELEASE}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- rpms_directory="${WORKSPACE}/rpms"
- comps_xml="${rpms_directory}/common/yum/arch.x86_64/comps.xml"
- cp -v ${comps_xml} ${WORKSPACE}/${repository_directory}
- if [ $? -ne 0 ]; then
- exit 1
- fi
-
- pushd . > /dev/null
- cd ${WORKSPACE}
- tar -cvf ${repository_directory}.tar ${repository_directory}
- RC=$?
- popd > /dev/null
- if [ ${RC} -ne 0 ]; then
- exit 1
- fi
-
- exit 0
-fi
-
-usage
-exit 0
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializerTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializerTest.java
index 8aeb5f9537..1564665401 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializerTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializerTest.java
@@ -23,14 +23,12 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import org.junit.Before;
import org.junit.Test;
import com.google.common.collect.Sets;
import com.raytheon.uf.common.datadelivery.registry.DataType;
import com.raytheon.uf.common.datadelivery.registry.SiteSubscriptionFixture;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
-import com.raytheon.uf.edex.core.props.EnvAttributePropertyInjector;
import com.raytheon.uf.edex.datadelivery.bandwidth.IBandwidthManager;
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit;
import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
@@ -48,7 +46,9 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
* Apr 18, 2013 1914 djohnson Fix broken test.
* Jun 25, 2013 2106 djohnson init() now takes a {@link RetrievalManager}.
* Sep 06, 2013 2344 bgonzale Added property injection of valid test value.
- * Oct 21, 2013 2292 mpduff Implement multiple data types.
+ * Oct 21, 2013 2292 mpduff Implement multiple data types.
+ * Nov 04, 2013 2506 bgonzale Added site parameter to HibernateBandwidthInitializer
+ * constructor.
*
*
*
@@ -57,13 +57,6 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
*/
public class HibernateBandwidthInitializerTest {
- @Before
- public void setup() {
- System.setProperty("edex.home", "../edexOsgi/build.edex/esb/");
- EnvAttributePropertyInjector.injectAttributeProperty("SITENAME",
- "sitename", "OAX");
- }
-
@Test
public void testSchedulesAllSubscriptionReturnedFromIFindSubscriptions()
throws Exception {
@@ -79,7 +72,7 @@ public class HibernateBandwidthInitializerTest {
IBandwidthDbInit dbInit = mock(IBandwidthDbInit.class);
final HibernateBandwidthInitializer initializer = new HibernateBandwidthInitializer(
- strategy);
+ strategy, "OAX");
initializer
.init(bandwidthManager, dbInit, mock(RetrievalManager.class));
initializer.executeAfterRegistryInit();
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
index af406879ea..5921978180 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
@@ -24,22 +24,29 @@ import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
+import java.util.Random;
import java.util.concurrent.ConcurrentLinkedQueue;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.Matchers;
import com.raytheon.uf.common.localization.PathManagerFactoryTest;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.TestUtil;
import com.raytheon.uf.common.util.file.FilenameFilters;
+import com.raytheon.uf.edex.datadelivery.retrieval.db.IRetrievalDao;
import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
+import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecordPK;
/**
* Test {@link DeserializeRetrievedDataFromIngest}.
@@ -57,6 +64,9 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
* Mar 19, 2013 1794 djohnson Read from a queue rather than the file system.
* Aug 09, 2013 1822 bgonzale Added parameters to processRetrievedPluginDataObjects.
* Oct 01, 2013 2267 bgonzale Pass request parameter instead of components of request.
+ * Nov 04, 2013 2506 bgonzale Fixed IRetreivalDao mock initialization.
+ * Test deserialization of data with leading and trailing
+ * content on the xml.
*
*
*
@@ -72,11 +82,21 @@ public class DeserializeRetrievedDataFromIngestTest {
private final DeserializeRetrievedDataFromIngest service = new DeserializeRetrievedDataFromIngest(
retrievalQueue);
+ private final IRetrievalDao mockDao = mock(IRetrievalDao.class);
+
@BeforeClass
public static void classSetUp() {
PathManagerFactoryTest.initLocalization();
}
+ @Before
+ public void setup() {
+ when(mockDao.getById((RetrievalRequestRecordPK) Matchers.anyObject()))
+ .thenReturn(
+ RetrievalRequestRecordFixture.INSTANCE.getInstance(0,
+ new Random(0)));
+ }
+
@Test
public void deserializesRetrievedDataFromTheQueue()
throws Exception {
@@ -110,6 +130,19 @@ public class DeserializeRetrievedDataFromIngestTest {
assertNull(restored);
}
+ @Test
+ public void attemptIngestWhenDataHasLeadingAndTrailingContent()
+ throws Exception {
+
+ addSimulatedSBNRetrievalToQueue();
+
+ final RetrievalResponseXml restored = service.findRetrievals();
+
+ // check for the payload
+ assertThat(restored.getRetrievalAttributePluginDataObjects().get(0)
+ .getRetrievalResponse(), is(notNullValue()));
+ }
+
private void addRetrievalToQueue() throws SerializationException,
IOException {
RetrievalResponseXml retrievalPluginDataObjects = RetrievalPluginDataObjectsFixture.INSTANCE
@@ -120,12 +153,51 @@ public class DeserializeRetrievedDataFromIngestTest {
request.setInsertTime(new Date());
new SerializeRetrievedDataToDirectory(directory,
- new AlwaysSameWmoHeader("SMYG10 LYBM 280000"))
- .processRetrievedPluginDataObjects(request,
- retrievalPluginDataObjects);
+ new AlwaysSameWmoHeader("SMYG10 LYBM 280000"), mockDao)
+ .processRetrievedPluginDataObjects(retrievalPluginDataObjects);
final List files = FileUtil.listFiles(directory,
FilenameFilters.ACCEPT_FILES, false);
retrievalQueue.add(FileUtil.file2String(files.get(0)));
}
+
+ private void addSimulatedSBNRetrievalToQueue()
+ throws SerializationException,
+ IOException {
+ RetrievalResponseXml retrievalPluginDataObjects = RetrievalPluginDataObjectsFixture.INSTANCE
+ .get();
+ RetrievalRequestRecord request = new RetrievalRequestRecord();
+ request.setProvider("");
+ request.setPlugin("");
+ request.setInsertTime(new Date());
+
+ new SerializeRetrievedDataToDirectory(directory,
+ new WmoHeaderWithLeadingAndTrailingContent("SMYG10 LYBM 280000"),
+ mockDao)
+ .processRetrievedPluginDataObjects(retrievalPluginDataObjects);
+
+ final List files = FileUtil.listFiles(directory,
+ FilenameFilters.ACCEPT_FILES, false);
+ retrievalQueue.add(FileUtil.file2String(files.get(0)));
+ }
+
+ private static class WmoHeaderWithLeadingAndTrailingContent extends
+ AlwaysSameWmoHeader {
+
+ public WmoHeaderWithLeadingAndTrailingContent(String wmoHeader) {
+ super(wmoHeader);
+ }
+
+ @Override
+ public String applyWmoHeader(String dataProvider, String dataFormat,
+ String sourceType, Date date, String data) {
+ String SBN_noise_prefix = "001\r\r\n747\r\r\n";
+ String SBN_noise_suffix = "\n\r\r\n 003";
+ String output = super.applyWmoHeader(dataProvider, dataFormat,
+ sourceType,
+ date, data);
+ return SBN_noise_prefix + output + SBN_noise_suffix;
+ }
+
+ }
}
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java
index 9477f9ce16..c7b72d1bdc 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java
@@ -88,6 +88,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.interfaces.IRetrievalResponse
* Apr 29, 2013 1910 djohnson Unregister from EventBus after each test.
* Aug 09, 2013 1822 bgonzale Added parameters to processRetrievedPluginDataObjects.
* Oct 01, 2013 2267 bgonzale Pass request parameter instead of components of request.
+ * Nov 04, 2013 2506 bgonzale removed IRetrievalDao parameter.
*
*
*
@@ -108,10 +109,11 @@ public class RetrievalTaskTest {
/**
* {@inheritDoc}
+ *
+ * @return RetrievalRequestRecord
*/
@Override
- public void processRetrievedPluginDataObjects(
- RetrievalRequestRecord request,
+ public RetrievalRequestRecord processRetrievedPluginDataObjects(
RetrievalResponseXml retrievalPluginDataObjects)
throws SerializationException, TranslationException {
final List retrievalAttributePluginDataObjects = retrievalPluginDataObjects
@@ -143,6 +145,7 @@ public class RetrievalTaskTest {
pluginDataObjects.addAll(Arrays.asList(pdos));
}
}
+ return requestRecord;
}
}
@@ -242,15 +245,16 @@ public class RetrievalTaskTest {
final File testDirectory = TestUtil
.setupTestClassDir(RetrievalTaskTest.class);
IRetrievalPluginDataObjectsProcessor serializeToDirectory = new SerializeRetrievedDataToDirectory(
- testDirectory, new AlwaysSameWmoHeader("SMYG10 LYBM 280000"));
+ testDirectory, new AlwaysSameWmoHeader("SMYG10 LYBM 280000"),
+ dao);
RetrievalTask downloadTask = new RetrievalTask(Network.OPSNET,
retrievalDataFinder, serializeToDirectory,
- mock(IRetrievalResponseCompleter.class), dao);
+ mock(IRetrievalResponseCompleter.class));
RetrievalTask readDownloadsTask = new RetrievalTask(Network.OPSNET,
new DeserializeRetrievedDataFromIngest(retrievalQueue),
retrievedDataProcessor, new RetrievalResponseCompleter(
- mock(SubscriptionNotifyTask.class), dao), dao);
+ mock(SubscriptionNotifyTask.class), dao));
downloadTask.run();
@@ -298,7 +302,7 @@ public class RetrievalTaskTest {
mock(SubscriptionNotifyTask.class), dao);
new RetrievalTask(Network.OPSNET, retrievalDataFinder,
- retrievedDataProcessor, retrievalCompleter, dao).run();
+ retrievedDataProcessor, retrievalCompleter).run();
}
/**
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SerializeRetrievedDataToDirectoryTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SerializeRetrievedDataToDirectoryTest.java
index a594ca4a98..9282f3615e 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SerializeRetrievedDataToDirectoryTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SerializeRetrievedDataToDirectoryTest.java
@@ -21,17 +21,24 @@ package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
import static com.raytheon.uf.common.util.Matchers.hasNumberOfFiles;
import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import java.io.File;
import java.util.Date;
+import java.util.Random;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.Matchers;
import com.raytheon.uf.common.localization.PathManagerFactoryTest;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.util.TestUtil;
+import com.raytheon.uf.edex.datadelivery.retrieval.db.IRetrievalDao;
import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
+import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecordPK;
/**
* Test {@link SerializeRetrievedDataToDirectory}.
@@ -48,6 +55,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
* Aug 09, 2013 1822 bgonzale Added parameters to processRetrievedPluginDataObjects.
* Oct 01, 2013 2267 bgonzale Pass request parameter instead of components of request.
* Add test for wfs retrieval.
+ * Nov 04, 2013 2506 bgonzale removed IRetrievalDao and request parameters.
*
*
*
@@ -59,14 +67,24 @@ public class SerializeRetrievedDataToDirectoryTest {
private final File directory = TestUtil
.setupTestClassDir(SerializeRetrievedDataToDirectoryTest.class);
+ private final IRetrievalDao mockDao = mock(IRetrievalDao.class);
+
private final SerializeRetrievedDataToDirectory service = new SerializeRetrievedDataToDirectory(
- directory, new AlwaysSameWmoHeader("SMYG10 LYBM 280000"));
+ directory, new AlwaysSameWmoHeader("SMYG10 LYBM 280000"), mockDao);
@BeforeClass
public static void classSetUp() {
PathManagerFactoryTest.initLocalization();
}
+ @Before
+ public void setup() {
+ when(mockDao.getById((RetrievalRequestRecordPK) Matchers.anyObject()))
+ .thenReturn(
+ RetrievalRequestRecordFixture.INSTANCE.getInstance(0,
+ new Random(0)));
+ }
+
@Test
public void serializesRetrievedDataToAFileInTheTargetDirectory()
throws SerializationException {
@@ -79,8 +97,7 @@ public class SerializeRetrievedDataToDirectoryTest {
// "Model"
request.setInsertTime(new Date());
- service.processRetrievedPluginDataObjects(request,
- retrievalPluginDataObjects);
+ service.processRetrievedPluginDataObjects(retrievalPluginDataObjects);
assertThat(directory, hasNumberOfFiles(1));
}
@@ -97,8 +114,7 @@ public class SerializeRetrievedDataToDirectoryTest {
// "Model"
request.setInsertTime(new Date());
- service.processRetrievedPluginDataObjects(request,
- retrievalPluginDataObjects);
+ service.processRetrievedPluginDataObjects(retrievalPluginDataObjects);
assertThat(directory, hasNumberOfFiles(1));
}