Commit 0e0d8b1c authored by Noel Alonso's avatar Noel Alonso
Browse files

Crea excepción de query errónea

parent e6b77da6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
	ES_BBOX_QUERY_ERROR(Constants.ES_BBOX_QUERY_ERROR),
	ES_HISTOGRAM_INTERVAL_QUERY_ERROR(Constants.ES_HISTOGRAM_INTERVAL_QUERY_ERROR),
	ES_TERM_QUERY_ERROR(Constants.ES_TERM_QUERY_ERROR),
	ES_QUERY_ERROR(Constants.ES_QUERY_ERROR),
	ES_INSERT_DOCUMENT(Constants.ES_INSERT_DOCUMENT),
	ES_CREATE_MAPPING_ERROR(Constants.ES_CREATE_MAPPING_ERROR),
	
@@ -186,6 +187,7 @@ public enum ExceptionType implements ExceptionTypeItfc {
			ES_BBOX_QUERY_ERROR = "ESBboxQueryError",
			ES_HISTOGRAM_INTERVAL_QUERY_ERROR = "ESHistogramIntervalQueryError",
			ES_TERM_QUERY_ERROR = "ESTermQueryError",
			ES_QUERY_ERROR = "ESQueryError",
			ES_INSERT_DOCUMENT = "ESInsertError",
			ES_CREATE_MAPPING_ERROR = "ESCreateMappingError",
			
+13 −0
Original line number Diff line number Diff line
package es.redmic.exception.elasticsearch;

import es.redmic.exception.common.BadRequestException;
import es.redmic.exception.common.ExceptionType;

public class ESQueryException extends BadRequestException {

	private static final long serialVersionUID = 3658782399097632577L;

	public ESQueryException() {
		super(ExceptionType.ES_QUERY_ERROR);
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ ESNotExistsType=Type {0} does not exist in index {1}.
ESBboxQueryError=Error. Impossible to perform the query by Bbox with the input parameters.
ESHistogramIntervalQueryError=Error. The interval sent {0} does not match the set of supported intervals.
ESTermQueryError=Error. Term {0} with value {1} is not as expected.
ESQueryError=Error. Query is erroneous.
ESInsertError=Error. Register with field {0} and value {1} already exists.
ESCreateMappingError=Error. Mapping for index {0} could not be created.

+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ ESNotExistsType=El tipo {0} no existe en el
ESBboxQueryError=Error. Imposible realizar la query por bbox con los parámetros de entrada.
ESHistogramIntervalQueryError=Error. El intervalo de agrupación enviado {0} no coincide con el conjunto de intervalos soportados
ESTermQueryError=Error. El término {0} con valor {1} no es el esperado.
ESQueryError=Error. La consulta realizada es erronea.
ESInsertError=Error. El registro con campo {0} y valor {1} ya existe.
ESCreateMappingError=Error. El mapping para el índice {0} no se ha podido crear.

+18 −0
Original line number Diff line number Diff line
package es.redmic.test.unit.exception.elasticsearch;

import java.io.IOException;

import org.junit.Test;

import es.redmic.exception.common.ExceptionType;
import es.redmic.exception.elasticsearch.ESQueryException;
import es.redmic.test.unit.exception.common.BaseExceptionTest;

public class ESQueryExceptionTest extends BaseExceptionTest {

	@Test
	public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException {

		checkMessage(new ESQueryException(), ExceptionType.ES_QUERY_ERROR.toString(), null);
	}
}
 No newline at end of file