Commit e613d08e authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade excepción para selección no permitida + test

parent 55886ad2
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -134,7 +134,11 @@ public enum ExceptionType implements ExceptionTypeItfc {
	
	REPORT_ERROR(Constants.REPORT_ERROR),
	
	NO_CONTENT(Constants.NO_CONTENT);
	NO_CONTENT(Constants.NO_CONTENT),
	
	// Settings
	
	SELECTION_CHANGE_NOT_ALLOWED(Constants.SELECTION_CHANGE_NOT_ALLOWED);
	
	// @formatter:on

@@ -274,7 +278,11 @@ public enum ExceptionType implements ExceptionTypeItfc {
			
			REPORT_ERROR = "ReportError",
		
			NO_CONTENT = "NoContentException";
			NO_CONTENT = "NoContentException",
		
			// Settings
			SELECTION_CHANGE_NOT_ALLOWED = "SelectionChangeNotAllowedException";
		
		// @formatter:on
	}

+33 −0
Original line number Diff line number Diff line
package es.redmic.exception.settings;

/*-
 * #%L
 * Exceptions
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

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

public class SelectionChangeNotAllowedException extends InternalException {

	private static final long serialVersionUID = 1L;

	public SelectionChangeNotAllowedException() {
		super(ExceptionType.SELECTION_CHANGE_NOT_ALLOWED);
	}
}
+3 −0
Original line number Diff line number Diff line
@@ -109,3 +109,6 @@ JobRunningStepNotAllowed=Error. Trying to execute a task without being initiated
JobCompletedStepNotAllowed=Error. Trying to finish a task that has not been executed.

ReportError=Error. Required report could not be generated. Type {0}. Ids {1}.

#Settings
SelectionChangeNotAllowedException=Error. Selection could not be changed. Try again.
+3 −0
Original line number Diff line number Diff line
@@ -109,3 +109,6 @@ JobRunningStepNotAllowed=Error. Intentando ejecutar una tarea sin estar iniciada
JobCompletedStepNotAllowed=Error. Intentando finalizar una tarea que no se ha ejecutado.

ReportError=Error. No se ha podido generar el report requerido. Tipo {0}. Ids {1}.

#Settings
SelectionChangeNotAllowedException=Error. No se ha podido cambiar la selección. Inténtelo de nuevo.
+39 −0
Original line number Diff line number Diff line
package es.redmic.test.unit.exception.settings;

/*-
 * #%L
 * Exceptions
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.io.IOException;

import org.junit.Test;

import es.redmic.exception.common.ExceptionType;
import es.redmic.exception.settings.SelectionChangeNotAllowedException;
import es.redmic.test.unit.exception.common.BaseExceptionTest;

public class SelectionChangeNotAllowedExceptionTest extends BaseExceptionTest {

	@Test
	public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException {

		checkMessage(new SelectionChangeNotAllowedException(), ExceptionType.SELECTION_CHANGE_NOT_ALLOWED.toString(),
				null);
	}
}