Compare commits
21 Commits
nota_credi
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
7f720461ac | |
|
|
7de61ab179 | |
|
|
2c219e2fa5 | |
|
|
5b16970477 | |
|
|
cba4454dae | |
|
|
131196f3fd | |
|
|
6fac8ae22a | |
|
|
ac6cc7c9ec | |
|
|
423ad06d8d | |
|
|
ade3406b12 | |
|
|
274c40b59e | |
|
|
bb76a879f3 | |
|
|
64f21fcfaa | |
|
|
28a8333a92 | |
|
|
db1150dfec | |
|
|
2b2c59ab28 | |
|
|
3a0ca4f706 | |
|
|
67a73c6309 | |
|
|
636b8a4a49 | |
|
|
b5ef6cffd8 | |
|
|
7dd9d28f69 |
|
|
@ -24,6 +24,7 @@ Any value defined here will override the pom.xml file value but is only applicab
|
|||
<org-netbeans-modules-css-prep.less_2e_compiler_2e_options/>
|
||||
<org-netbeans-modules-css-prep.sass_2e_mappings>/scss:/css</org-netbeans-modules-css-prep.sass_2e_mappings>
|
||||
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>js/libs</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
|
||||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
|
||||
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
|
||||
</properties>
|
||||
</project-shared-configuration>
|
||||
|
|
|
|||
|
|
@ -15,11 +15,6 @@ import javax.ws.rs.container.ContainerResponseFilter;
|
|||
import javax.ws.rs.core.MultivaluedMap;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
/**
|
||||
* See http://www.w3.org/TR/cors/
|
||||
*
|
||||
* @author airhacks.com
|
||||
*/
|
||||
@Provider
|
||||
@Priority(Priorities.HEADER_DECORATOR)
|
||||
public class CorsFilter implements ContainerResponseFilter {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package com.qsoft.wmp.services.rest;
|
||||
|
||||
import com.qsoft.dao.exception.DaoException;
|
||||
import com.qsoft.util.constantes.CodigoRespuesta;
|
||||
import com.qsoft.util.constantes.ErrorTipo;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
|
|
@ -12,18 +13,23 @@ import com.qsoft.erp.constantes.DominioConstantes;
|
|||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.AccionGenerica;
|
||||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dominio.util.AuditoriaUtil;
|
||||
import com.qsoft.erp.dto.AuditoriaDTO;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccion;
|
||||
import com.stripe.exception.StripeException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
|
|
@ -37,9 +43,14 @@ public class AccionResource {
|
|||
@Inject
|
||||
private AccionGenerica accion;
|
||||
|
||||
@Inject
|
||||
private AuditoriaUtil auditoria;
|
||||
|
||||
@Context
|
||||
private HttpServletRequest request;
|
||||
|
||||
@PostConstruct
|
||||
public void postConstructor() {
|
||||
System.out.println("POST CONTRUCTOR " + accion);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,10 +76,17 @@ public class AccionResource {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public SalidaAccion postJson(EntradaAccion entrada) {
|
||||
SalidaAccion salida = null;
|
||||
Long time = System.currentTimeMillis();
|
||||
EntidadEnum entidad = null;
|
||||
if (entrada == null) {
|
||||
salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.WARNING, CodigoRespuesta.CODIGO_IN_NULO, "La entrada no puede ser nula");
|
||||
} else {
|
||||
EntidadEnum entidad = Enum.valueOf(EntidadEnum.class, entrada.getBodyIn().getEntidad());
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
super.getClass().getName() + ".posJson", request.getRequestURL().toString(),
|
||||
AccionGenerica.class.getName() + ".accionGenerica", ServiceUtil.REQUEST,
|
||||
"" + entrada.getBodyIn().getTipoAccion(), 0, ServiceUtil.getJson(entrada));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
entidad = Enum.valueOf(EntidadEnum.class, entrada.getBodyIn().getEntidad());
|
||||
if (entidad == null) {
|
||||
salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_VALOR_NULO, "No se puede identificar la entidad a la cual se desea acceder");
|
||||
} else {
|
||||
|
|
@ -81,7 +99,7 @@ public class AccionResource {
|
|||
ex.printStackTrace(System.err);
|
||||
String msg = getCauses(ex, new StringBuilder());
|
||||
if (msg.contains("Duplicate entry")) {
|
||||
salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_ERROR_GUARDA_BDD,
|
||||
salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_ERROR_GUARDA_BDD,
|
||||
"Error el registro " + entrada.getBodyIn().getEntidad() + " ya existe en la Base de datos");
|
||||
} else {
|
||||
salida = ServiceUtil.crearSalidaAccionError(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_ERROR_GENERICO, "ERROR NO CONTROLADO: " + msg);
|
||||
|
|
@ -89,6 +107,12 @@ public class AccionResource {
|
|||
}
|
||||
}
|
||||
}
|
||||
time = System.currentTimeMillis() - time;
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(salida.getHeaderOut(), entidad.name(),
|
||||
super.getClass().getName() + ".posJson", request.getRequestURL().toString(),
|
||||
AccionGenerica.class.getName() + ".accionGenerica", ServiceUtil.RESPONSE,
|
||||
"", time.intValue(), ServiceUtil.getJson(salida.getError()));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
|
@ -118,8 +142,11 @@ public class AccionResource {
|
|||
* @param entidad
|
||||
* @return
|
||||
* @throws DominioExcepcion
|
||||
* @throws java.io.IOException
|
||||
* @throws com.stripe.exception.StripeException
|
||||
* @throws com.qsoft.dao.exception.DaoException
|
||||
*/
|
||||
public SalidaAccion ejecutarAccion(EntradaAccion entrada, EntidadEnum entidad) throws DominioExcepcion, IOException {
|
||||
public SalidaAccion ejecutarAccion(EntradaAccion entrada, EntidadEnum entidad) throws DominioExcepcion, IOException, StripeException, DaoException {
|
||||
List<Object> resultado = accion.accionGenerica(entrada.getHeaderIn(), entidad, entrada.getBodyIn().getEntidades(), entrada.getBodyIn().getTipoAccion());
|
||||
String msg = "A continuacion se muestra el resultado de la accion.";
|
||||
HeaderMS header = entrada.getHeaderIn();
|
||||
|
|
|
|||
|
|
@ -11,17 +11,21 @@ import com.qsoft.util.ms.pojo.HeaderMS;
|
|||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.dominio.ConsultaGenerica;
|
||||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dominio.util.AuditoriaUtil;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.BodyEntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.EntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
|
|
@ -35,9 +39,14 @@ public class ConsultaResource {
|
|||
@Inject
|
||||
private ConsultaGenerica consulta;
|
||||
|
||||
@Inject
|
||||
private AuditoriaUtil auditoria;
|
||||
|
||||
@Context
|
||||
private HttpServletRequest request;
|
||||
|
||||
@PostConstruct
|
||||
public void postConstructor() {
|
||||
System.out.println("======> POST CONTRUCTOR " + consulta);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,25 +72,37 @@ public class ConsultaResource {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public SalidaConsulta postJson(EntradaConsulta entrada) {
|
||||
SalidaConsulta salida = null;
|
||||
// Long time = System.currentTimeMillis();
|
||||
if (entrada == null) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(ErrorTipo.WARNING, CodigoRespuesta.CODIGO_IN_NULO, "La entrada no puede ser nula");
|
||||
} else {
|
||||
// AuditoriaDTO dto = ServiceUtil.crearAuditoria(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
// super.getClass().getName() + ".posJson", this.request.getRequestURL().toString(),
|
||||
// ConsultaGenerica.class.getName() + ".consultaGenerica", ServiceUtil.REQUEST,
|
||||
// "" + entrada.getBodyIn().getTipoConsulta(), 0, ServiceUtil.getJson(entrada));
|
||||
// this.auditoria.AddAuditoria(dto);
|
||||
try {
|
||||
List resultado = null;
|
||||
resultado = consulta.consultaGenerica(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
entrada.getBodyIn().getParametros(), entrada.getBodyIn().getMaximoRegistros(), entrada.getBodyIn().getTipoConsulta());
|
||||
|
||||
BodyEntradaConsulta body = entrada.getBodyIn();
|
||||
resultado = consulta.consultaGenerica(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(), body.getParametros(),
|
||||
body.getOrden(), body.getMaximoRegistros(), body.getRegistroInicio(), body.getTipoConsulta());
|
||||
HeaderMS header = entrada.getHeaderIn();
|
||||
header.setFechaHora(DominioConstantes.getDateTime());
|
||||
salida = ServiceUtil.crearSalidaConsultaOk(header, entrada.getBodyIn().getEntidad(), resultado);
|
||||
} catch (DominioExcepcion ex) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(ex.getTipo(), ex.getCodigo(), ex.getMensaje());
|
||||
}catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(CodigoRespuesta.CODIGO_ERROR_GENERICO, ex.toString());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
// time = System.currentTimeMillis() - time;
|
||||
// AuditoriaDTO dto = ServiceUtil.crearAuditoria(salida.getHeaderOut(), salida.getBodyOut().getEntidad(),
|
||||
// super.getClass().getName() + ".posJson", this.request.getRequestURL().toString(),
|
||||
// ConsultaGenerica.class.getName() + ".consultaGenerica", ServiceUtil.RESPONSE,
|
||||
// "", time.intValue(), ServiceUtil.getJson(salida.getError()));
|
||||
// System.out.println("=====> TIEMPO " + dto.getAudTiempoEjecucion());
|
||||
// this.auditoria.AddAuditoria(dto);
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,21 +6,13 @@
|
|||
package com.qsoft.wmp.services.rest;
|
||||
|
||||
import com.qsoft.dao.exception.DaoException;
|
||||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.AccionGenerica;
|
||||
import com.qsoft.erp.dominio.ConsultaGenerica;
|
||||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dto.PersonaPolizaDTO;
|
||||
import com.qsoft.util.constantes.CodigoRespuesta;
|
||||
import com.qsoft.util.constantes.ErrorTipo;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
import com.qsoft.wmp.services.xsd.EntradaConsulta;
|
||||
import com.qsoft.wmp.services.xsd.EntradaRecetas;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccionFarmaEnlace;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,13 @@ import com.qsoft.erp.constantes.DominioConstantes;
|
|||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.MultipartService;
|
||||
import com.qsoft.erp.dominio.exception.DominioExcepcion;
|
||||
import com.qsoft.erp.dominio.util.AuditoriaUtil;
|
||||
import com.qsoft.erp.dominio.util.DominioUtil;
|
||||
import com.qsoft.erp.dto.AuditoriaDTO;
|
||||
import com.qsoft.erp.dto.DocumentoDTO;
|
||||
import com.qsoft.erp.dto.LiquidacionDTO;
|
||||
import com.qsoft.wmp.services.util.ServiceUtil;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
import com.qsoft.wmp.services.xsd.EntradaLiquidacion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.io.IOException;
|
||||
|
|
@ -27,11 +31,13 @@ import java.util.Map;
|
|||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.annotation.MultipartConfig;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
||||
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
||||
|
|
@ -42,7 +48,7 @@ import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
|||
* @author james
|
||||
*/
|
||||
@Path("multipart")
|
||||
@MultipartConfig(
|
||||
@MultipartConfig(
|
||||
maxFileSize = 838860800l, // 100Mb
|
||||
fileSizeThreshold = 52428800, //512
|
||||
maxRequestSize = 1024000 // 10Kb
|
||||
|
|
@ -52,6 +58,15 @@ public class MultipartResource {
|
|||
@Inject
|
||||
private MultipartService multipart;
|
||||
|
||||
@Inject
|
||||
private AuditoriaUtil auditoria;
|
||||
|
||||
@Inject
|
||||
private DominioUtil dominioUtil;
|
||||
|
||||
@Context
|
||||
private HttpServletRequest request;
|
||||
|
||||
@PostConstruct
|
||||
public void postConstructor() {
|
||||
|
||||
|
|
@ -75,6 +90,7 @@ public class MultipartResource {
|
|||
public SalidaConsulta postFile(FormDataMultiPart input) {
|
||||
SalidaConsulta salida = null;
|
||||
EntradaLiquidacion entrada = null;
|
||||
Long time = System.currentTimeMillis();
|
||||
|
||||
boolean estado = false;
|
||||
if (input != null) {
|
||||
|
|
@ -82,23 +98,29 @@ public class MultipartResource {
|
|||
Map<String, List<FormDataBodyPart>> parts = input.getFields();
|
||||
int i = 0;
|
||||
try {
|
||||
System.out.println("===========> RECIBE: " + parts);
|
||||
for (List<FormDataBodyPart> p : parts.values()) {
|
||||
for (List<FormDataBodyPart> p : parts.values()) {
|
||||
FormDataBodyPart bp = p.get(0);
|
||||
if (i == 0) {
|
||||
entrada = getEntrada(bp);
|
||||
if(entrada != null && entrada.getBodyIn().getParametros() != null &&
|
||||
entrada.getBodyIn().getParametros().get("Liquidacion") != null &&
|
||||
entrada.getBodyIn().getParametros().get("Liquidacion").getPolCodigo() != null &&
|
||||
entrada.getBodyIn().getParametros().get("Liquidacion").getPolCodigo() == -1){
|
||||
if (entrada != null && entrada.getBodyIn() != null) {
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
super.getClass().getName() + ".posFile", request.getRequestURL().toString(),
|
||||
MultipartService.class.getName() + ".multipartGenerico", ServiceUtil.REQUEST,
|
||||
"" + entrada.getBodyIn().getTipoConsulta(), 0, ServiceUtil.getJson(entrada));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
}
|
||||
if (entrada != null && entrada.getBodyIn().getParametros() != null
|
||||
&& entrada.getBodyIn().getParametros().get("Liquidacion") != null
|
||||
&& entrada.getBodyIn().getParametros().get("Liquidacion").getPolCodigo() != null
|
||||
&& entrada.getBodyIn().getParametros().get("Liquidacion").getPolCodigo() == -1) {
|
||||
throw new DominioExcepcion(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_VALOR_NULO,
|
||||
"No existe una poliza activa no puede ejecutar este proceso");
|
||||
"No existe una poliza activa no puede ejecutar este proceso");
|
||||
}
|
||||
} else {
|
||||
InputStream in = bp.getValueAs(InputStream.class);
|
||||
try {
|
||||
if (in != null && entrada != null && entrada.getBodyIn().getParametros() != null &&
|
||||
entrada.getBodyIn().getParametros().get("Liquidacion") != null) {
|
||||
if (in != null && entrada != null && entrada.getBodyIn().getParametros() != null
|
||||
&& entrada.getBodyIn().getParametros().get("Liquidacion") != null) {
|
||||
DocumentoDTO doc = (DocumentoDTO) entrada.getBodyIn().getParametros().get("Liquidacion").getDocumentos().get(i - 1);
|
||||
doc.setData(in.readAllBytes());
|
||||
}
|
||||
|
|
@ -113,7 +135,7 @@ public class MultipartResource {
|
|||
"Uno o mas documentos enviados son nulos por favor verifique la informacion");
|
||||
}
|
||||
EntidadEnum entidad = Enum.valueOf(EntidadEnum.class, entrada.getBodyIn().getEntidad());
|
||||
data = this.multipart.multipartGenerico(entrada.getHeaderIn(), entidad,
|
||||
data = this.multipart.multipartLiquidacion(entrada.getHeaderIn(), entidad,
|
||||
entrada.getBodyIn().getParametros(), entrada.getBodyIn().getTipoConsulta());
|
||||
HeaderMS header = entrada.getHeaderIn();
|
||||
header.setFechaHora(DominioConstantes.getDateTime());
|
||||
|
|
@ -129,10 +151,110 @@ public class MultipartResource {
|
|||
} else {
|
||||
ServiceUtil.crearSalidaConsultaError(CodigoRespuesta.CODIGO_VALOR_NULO, "ERROR. La entrada no puede ser nula");
|
||||
}
|
||||
time = System.currentTimeMillis() - time;
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(salida.getHeaderOut(), salida.getBodyOut().getEntidad(),
|
||||
super.getClass().getName() + ".posFile", request.getRequestURL().toString(),
|
||||
MultipartService.class.getName() + ".multipartGenerico", ServiceUtil.RESPONSE,
|
||||
"", time.intValue(), ServiceUtil.getJson(salida.getError()));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
|
||||
return salida;
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("documento")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public SalidaConsulta postDocumento(FormDataMultiPart input) {
|
||||
SalidaConsulta salida = null;
|
||||
EntradaAccion entrada = null;
|
||||
Long time = System.currentTimeMillis();
|
||||
if (input != null) {
|
||||
List<Object> data = new ArrayList<>();
|
||||
Map<String, List<FormDataBodyPart>> parts = input.getFields();
|
||||
int i = 0;
|
||||
try {
|
||||
List<DocumentoDTO> documentoDTOs = new ArrayList<>();
|
||||
for (List<FormDataBodyPart> p : parts.values()) {
|
||||
System.out.println("FormDataBodyPart p.get(0) =>: " + p.get(0));
|
||||
FormDataBodyPart bodyPart = p.get(0);
|
||||
if (i == 0) {
|
||||
entrada = getEntradaAccion(bodyPart);
|
||||
if (entrada != null && entrada.getBodyIn() != null) {
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(entrada.getHeaderIn(), entrada.getBodyIn().getEntidad(),
|
||||
super.getClass().getName() + ".posFile", request.getRequestURL().toString(),
|
||||
MultipartService.class.getName() + ".multipartGenerico", ServiceUtil.REQUEST,
|
||||
"" + entrada.getBodyIn().getTipoAccion(), 0, ServiceUtil.getJson(entrada));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
}
|
||||
} else {
|
||||
InputStream in = bodyPart.getValueAs(InputStream.class);
|
||||
try {
|
||||
if (in != null && entrada != null && entrada.getBodyIn().getEntidades() != null) {
|
||||
System.out.println("===== Entro a la condicion =====");
|
||||
DocumentoDTO doc = (DocumentoDTO) this.dominioUtil.crearObjeto(DocumentoDTO.class, entrada.getBodyIn().getEntidades().get(i - 1));
|
||||
doc.setData(in.readAllBytes());
|
||||
documentoDTOs.add(doc);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
System.out.println("ERROR CARGANDO ARCHIVO " + ex);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!validarEntrada(entrada, documentoDTOs)) {
|
||||
throw new DominioExcepcion(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_VALOR_NULO,
|
||||
"Uno o mas documentos enviados son nulos por favor verifique la informacion");
|
||||
}
|
||||
EntidadEnum entidad = Enum.valueOf(EntidadEnum.class, entrada.getBodyIn().getEntidad());
|
||||
data = this.multipart.multipartGenerico(entrada.getHeaderIn(), entidad,
|
||||
entrada.getBodyIn().getEntidades(), entrada.getBodyIn().getTipoAccion(), documentoDTOs);
|
||||
HeaderMS header = entrada.getHeaderIn();
|
||||
header.setFechaHora(DominioConstantes.getDateTime());
|
||||
salida = ServiceUtil.crearSalidaConsultaOk(header, entrada.getBodyIn().getEntidad(), data);
|
||||
} catch (DominioExcepcion ex) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(ex.getCodigo(), ex.getMensaje());
|
||||
ex.printStackTrace();
|
||||
} catch (Exception ex) {
|
||||
salida = ServiceUtil.crearSalidaConsultaError(CodigoRespuesta.CODIGO_ERROR_GENERICO, ex.toString());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
ServiceUtil.crearSalidaConsultaError(CodigoRespuesta.CODIGO_VALOR_NULO, "ERROR. La entrada no puede ser nula");
|
||||
}
|
||||
time = System.currentTimeMillis() - time;
|
||||
AuditoriaDTO dto = ServiceUtil.crearAuditoria(salida.getHeaderOut(), salida.getBodyOut().getEntidad(),
|
||||
super.getClass().getName() + ".posFile", request.getRequestURL().toString(),
|
||||
MultipartService.class.getName() + ".multipartGenerico", ServiceUtil.RESPONSE,
|
||||
"", time.intValue(), ServiceUtil.getJson(salida.getError()));
|
||||
this.auditoria.AddAuditoria(dto);
|
||||
|
||||
return salida;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entrada
|
||||
* @return
|
||||
*/
|
||||
private boolean validarEntrada(EntradaAccion entrada, List<DocumentoDTO> docs) {
|
||||
boolean estado = true;
|
||||
if (entrada == null || entrada.getBodyIn() == null || entrada.getBodyIn().getEntidades() == null) {
|
||||
return false;
|
||||
}
|
||||
if (entrada.getBodyIn() != null && entrada.getBodyIn().getEntidades() != null) {
|
||||
for (DocumentoDTO docMap : docs) {
|
||||
System.out.println("Docmap => " + docMap.toString());
|
||||
if (docMap == null || docMap.getData() == null) {
|
||||
estado = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return estado;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entrada
|
||||
|
|
@ -158,6 +280,31 @@ public class MultipartResource {
|
|||
return estado;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea la entrada a partir de la consulta del servicio
|
||||
*
|
||||
* @param bp
|
||||
* @return
|
||||
*/
|
||||
public EntradaAccion getEntradaAccion(FormDataBodyPart bp) throws DominioExcepcion {
|
||||
EntradaAccion entrada = null;
|
||||
System.out.println("=====> entrada");
|
||||
InputStream in = bp.getValueAs(InputStream.class);
|
||||
if (in != null) {
|
||||
System.out.println("======> in: " + in.toString());
|
||||
try {
|
||||
String json = new String(in.readAllBytes());
|
||||
ObjectMapper maper = new ObjectMapper();
|
||||
maper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
|
||||
entrada = maper.readValue(json, EntradaAccion.class);
|
||||
} catch (IOException ex) {
|
||||
throw new DominioExcepcion(ErrorTipo.ERROR, CodigoRespuesta.CODIGO_VALOR_NULO, "No es posible convertir el JSON " + ex.toString());
|
||||
}
|
||||
}
|
||||
System.out.println("CREO ENTRADA... " + entrada);
|
||||
return entrada;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea la entrada a partir de la consulta del servicio
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,23 +5,29 @@
|
|||
*/
|
||||
package com.qsoft.wmp.services.util;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.dto.AuditoriaDTO;
|
||||
import com.qsoft.util.constantes.CodigoRespuesta;
|
||||
import com.qsoft.util.constantes.ErrorTipo;
|
||||
import com.qsoft.util.ms.pojo.HeaderMS;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccion;
|
||||
import com.qsoft.wmp.services.xsd.SalidaAccionFarmaEnlace;
|
||||
import com.qsoft.wmp.services.xsd.SalidaConsulta;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author james
|
||||
*/
|
||||
public class ServiceUtil {
|
||||
|
||||
|
||||
|
||||
public static final String REQUEST = "Request";
|
||||
public static final String RESPONSE = "Response";
|
||||
|
||||
/**
|
||||
* Crear salida
|
||||
*
|
||||
|
|
@ -36,7 +42,7 @@ public class ServiceUtil {
|
|||
salida.getError().setTipo(ErrorTipo.ERROR.name());
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Crear salida
|
||||
*
|
||||
|
|
@ -67,7 +73,7 @@ public class ServiceUtil {
|
|||
salida.getError().setTipo(error.name());
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Crear salida
|
||||
*
|
||||
|
|
@ -83,9 +89,9 @@ public class ServiceUtil {
|
|||
salida.getError().setTipo(error.name());
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Crear salida ok
|
||||
* Crear salida ok
|
||||
*
|
||||
* @param header
|
||||
* @param tipoSalida
|
||||
|
|
@ -102,9 +108,9 @@ public class ServiceUtil {
|
|||
salida.getBodyOut().setData(data);
|
||||
return salida;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Crear salida ok
|
||||
* Crear salida ok
|
||||
*
|
||||
* @param <error>
|
||||
* @param header
|
||||
|
|
@ -134,6 +140,61 @@ public class ServiceUtil {
|
|||
salida.getBodyOut().setEstado(estado);
|
||||
salida.getBodyOut().setResultados(data);
|
||||
return salida;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permite convertiri un objeto determinado en JSON
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
public static String getJson(Object object) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = null;
|
||||
try {
|
||||
json = mapper.writeValueAsString(object);
|
||||
} catch (JsonProcessingException ex) {
|
||||
Logger.getLogger(ServiceUtil.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permite crear el DTO de auditoria
|
||||
*
|
||||
* @param header
|
||||
* @param entidad
|
||||
* @param metodo
|
||||
* @param endpoint
|
||||
* @param backend
|
||||
* @param servicio
|
||||
* @param json
|
||||
* @param tiempo
|
||||
* @param accion
|
||||
* @return
|
||||
*/
|
||||
public static AuditoriaDTO crearAuditoria(HeaderMS header, String entidad, String metodo,
|
||||
String endpoint, String backend, String servicio, String accion, Integer tiempo, String json) {
|
||||
AuditoriaDTO auditoria = new AuditoriaDTO();
|
||||
auditoria.setAudAplicacion(header.getAplicacion());
|
||||
auditoria.setAudBackend(backend);
|
||||
auditoria.setAudCanal(header.getCanal());
|
||||
auditoria.setAudDinamico(json);
|
||||
auditoria.setAudDispositivo(header.getDispositivo());
|
||||
auditoria.setAudEmpresa(header.getEmpresa());
|
||||
auditoria.setAudEndpoint(endpoint);
|
||||
auditoria.setAudEntidad(entidad);
|
||||
auditoria.setAudFecha(DominioConstantes.getBddDate());
|
||||
auditoria.setAudGeolocalizacion(header.getGeolocalizacion());
|
||||
auditoria.setAudIdioma(header.getIdioma());
|
||||
auditoria.setAudMedio(header.getMedio());
|
||||
auditoria.setAudMetodo(metodo);
|
||||
auditoria.setAudServicio(servicio);
|
||||
auditoria.setAudTiempoEjecucion(tiempo);
|
||||
auditoria.setAudTipoEjecucion(accion);
|
||||
auditoria.setAudToken(header.getUuid());
|
||||
auditoria.setAudTransaccion(header.getTipoTransaccion());
|
||||
auditoria.setAudUsuario(header.getUsuario());
|
||||
return auditoria;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package com.qsoft.wmp.services.xsd;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -18,6 +19,7 @@ public class BodyEntradaConsulta {
|
|||
private Integer registroInicio;
|
||||
private String entidad;
|
||||
private Map<String, Object> parametros;
|
||||
private List<String> orden;
|
||||
|
||||
public Integer getTipoConsulta() {
|
||||
return tipoConsulta;
|
||||
|
|
@ -57,6 +59,14 @@ public class BodyEntradaConsulta {
|
|||
|
||||
public void setRegistroInicio(Integer registroInicio) {
|
||||
this.registroInicio = registroInicio;
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getOrden() {
|
||||
return orden;
|
||||
}
|
||||
|
||||
public void setOrden(List<String> orden) {
|
||||
this.orden = orden;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
<servlet>
|
||||
<servlet-name>com.qsoft.wmp.services.rest.ApplicationConfig</servlet-name>
|
||||
<init-param>
|
||||
<param-name>jersey.config.server.provider.classnames</param-name>
|
||||
<param-value>org.glassfish.jersey.jackson.JacksonFeature</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>com.qsoft.wmp.services.rest.ApplicationConfig</servlet-name>
|
||||
<url-pattern>/servicios/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
|
|||
|
|
@ -1,62 +1,11 @@
|
|||
{
|
||||
"headerIn": {
|
||||
"dispositivo": "james-laptop001",
|
||||
"canal": null,
|
||||
"medio": null,
|
||||
"aplicacion": "WeERPV1.0",
|
||||
"tipoTransaccion": "0101151",
|
||||
"usuario": "james",
|
||||
"uuid": "2e25aed60f2d4c63e33864a638b906f2df987a9b37ce3f8dafde7b565b2a6c41",
|
||||
"fechaHora": "20/05/2020 23:55:36",
|
||||
"idioma": "ES",
|
||||
"empresa": "Enigma-Lovers",
|
||||
"geolocalizacion": null
|
||||
[
|
||||
{
|
||||
"acceso": "Acceso norte 1",
|
||||
"fecha": "14/04/2020 16:55:22"
|
||||
},
|
||||
"bodyIn": {
|
||||
"tipoAccion": 1,
|
||||
"entidad": "FacturaCompra",
|
||||
"entidades": [
|
||||
{
|
||||
"facEstablecimiento": "001",
|
||||
"facPtoEmision": "001",
|
||||
"facSecuencial": "00000001",
|
||||
"facClaveAcceso": null,
|
||||
"facAutorizacion": null,
|
||||
"facTotalDescuentos": null,
|
||||
"facTotalImpuestos": null,
|
||||
"facTotalOtros": null,
|
||||
"facImporte": null,
|
||||
"facTotal": null,
|
||||
"facAdelanto": null,
|
||||
"facPendiente": null,
|
||||
"facReferencia": null,
|
||||
"facPropina": null,
|
||||
"facFechaRegistro": null,
|
||||
"facFechaAutorizacion": null,
|
||||
"facDescripcion": null,
|
||||
"facObservacion": null,
|
||||
"facDetalle": null,
|
||||
"facDinamico": "CUANDO SE ADQUIERE SERVICIOS O CONSUMIBLES QUE NO GENERAN ENTRADA SE AGREGA AQUI",
|
||||
"ejeCodigo": null,
|
||||
"empCodigo": null,
|
||||
"proCodigo": 1,
|
||||
"detEstado": null,
|
||||
"detTipo": null,
|
||||
"usuCodigo": null,
|
||||
"detalle": [
|
||||
{
|
||||
"denCantidad": 2.0,
|
||||
"denPrecioCompra": 89.3,
|
||||
"denFecProduccion": 1590073789081,
|
||||
"denFecCaducidad": 1590073789081,
|
||||
"artCodigo": 1,
|
||||
"bodCodigo": 1,
|
||||
"detUnidad": null,
|
||||
"entCodigo": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
{
|
||||
"acceso": "Salida peatonal sur",
|
||||
"fecha": "14/04/2020 22:55:22"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
|
@ -9,10 +9,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import com.qsoft.erp.constantes.DominioConstantes;
|
||||
import com.qsoft.erp.constantes.EntidadEnum;
|
||||
import com.qsoft.erp.dominio.AccionGenerica;
|
||||
import com.qsoft.erp.dto.DocumentoDTO;
|
||||
import com.qsoft.erp.dto.EstadoLiquidacionDTO;
|
||||
import com.qsoft.erp.dto.LiquidacionDTO;
|
||||
import com.qsoft.erp.dto.PolizaDTO;
|
||||
import com.qsoft.erp.dto.AgendamientoDTO;
|
||||
import com.qsoft.erp.dto.EstadoAgendamientoDTO;
|
||||
import com.qsoft.wmp.services.rest.AccionResource;
|
||||
import com.qsoft.wmp.services.rest.ConsultaResource;
|
||||
import com.qsoft.wmp.services.xsd.EntradaAccion;
|
||||
|
|
@ -32,24 +30,30 @@ public class Tester {
|
|||
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println("TEST " + DominioConstantes.getDateTime());
|
||||
testAccionService();
|
||||
// testAccionService();
|
||||
testConsultaService();
|
||||
}
|
||||
|
||||
|
||||
public static void testConsultaService() throws IOException {
|
||||
ObjectMapper maper = new ObjectMapper();
|
||||
EntradaConsulta entrada = new EntradaConsulta();
|
||||
entrada.getBodyIn().setTipoConsulta(1);
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.Liquidacion.name());
|
||||
List<String> ord = new ArrayList<>();
|
||||
ord.add("CAMPO");
|
||||
ord.add("ASC");
|
||||
entrada.getBodyIn().setOrden(ord);
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.Agendamiento.name());
|
||||
|
||||
LiquidacionDTO ld = new LiquidacionDTO();
|
||||
List<DocumentoDTO> documentos = new ArrayList<>();
|
||||
List<EstadoLiquidacionDTO> estados = new ArrayList<>();
|
||||
documentos.add(new DocumentoDTO());
|
||||
estados.add(new EstadoLiquidacionDTO());
|
||||
ld.setDocumentos(documentos);
|
||||
ld.setEstados(estados);
|
||||
AgendamientoDTO dto = new AgendamientoDTO();
|
||||
|
||||
List<EstadoAgendamientoDTO> estados = new ArrayList<>();
|
||||
|
||||
estados.add(new EstadoAgendamientoDTO());
|
||||
|
||||
dto.setEstado(estados);
|
||||
Map<String, Object> parametros = new HashMap<>();
|
||||
parametros.put(EntidadEnum.Liquidacion.name(), ld);
|
||||
parametros.put(EntidadEnum.Agendamiento.name(), dto);
|
||||
|
||||
entrada.getBodyIn().setParametros(parametros);
|
||||
String s = maper.writeValueAsString(entrada);
|
||||
|
|
@ -67,7 +71,7 @@ public class Tester {
|
|||
ObjectMapper maper = new ObjectMapper();
|
||||
EntradaAccion entrada = new EntradaAccion();
|
||||
entrada.getBodyIn().setTipoAccion(AccionGenerica.GUARDA);
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.DetalleLiquidacion.name());
|
||||
entrada.getBodyIn().setEntidad(EntidadEnum.Agendamiento.name());
|
||||
List<Map<String, Object>> entidades = new ArrayList<>();
|
||||
//TODO: agregar entidades
|
||||
entrada.getBodyIn().setEntidades(entidades);
|
||||
|
|
@ -76,24 +80,16 @@ public class Tester {
|
|||
System.out.println("JSON=> " + s);
|
||||
AccionResource ar = new AccionResource();
|
||||
System.out.println("POSTING....");
|
||||
List<PolizaDTO> data = new ArrayList<>();
|
||||
PolizaDTO pol = new PolizaDTO();
|
||||
pol.setDetTipoIdentificacion(3);
|
||||
pol.setPerCedulaTitular("1715060073");
|
||||
pol.setDetModalidad(25);
|
||||
pol.setDetPeriodicidad(17200);
|
||||
pol.setDetFormaPago(23516);
|
||||
pol.setDetIfi(17205);
|
||||
pol.setDetSucursalIfi(23484);
|
||||
pol.setDetPromocion(23584);
|
||||
pol.setDetTipoCuenta(17187);
|
||||
pol.setEmpCodigo(2);
|
||||
pol.setCedulaDebito("1715060012");
|
||||
pol.setCuentaDebito("123456789");
|
||||
pol.setPolBroker("Asesor CPN");
|
||||
List<AgendamientoDTO> data = new ArrayList<>();
|
||||
|
||||
AgendamientoDTO agenda = new AgendamientoDTO();
|
||||
List<EstadoAgendamientoDTO> detalle = new ArrayList<>();
|
||||
|
||||
detalle.add(new EstadoAgendamientoDTO());
|
||||
agenda.setEstado(detalle);
|
||||
|
||||
data.add(agenda);
|
||||
|
||||
data.add(pol);
|
||||
|
||||
s = maper.writeValueAsString(data);
|
||||
System.out.println("JSON=> " + s);
|
||||
// SalidaAccion salida = ar.postJson(entrada);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
{
|
||||
"contacto": ["Sr don daviik"],
|
||||
"contactoContable": ["Contador demo"],
|
||||
"emailContable": ["facturas@test.com"],
|
||||
"teléfonoContable": [],
|
||||
"telefono": ["02365487", "03569748", "0996852147"],
|
||||
"telefonoContacto": ["0965479965"],
|
||||
"email": ["email1@test.com", "email2@test.com"]
|
||||
}
|
||||
|
|
@ -4,20 +4,28 @@
|
|||
"canal": null,
|
||||
"medio": null,
|
||||
"aplicacion": "WeMedicalProV1.0",
|
||||
"tipoTransaccion": "0101000",
|
||||
"usuario": "james",
|
||||
"uuid": "7cbec0b8ec642ddbd7b9b24a35e39b70938d",
|
||||
"tipoTransaccion": "0101116",
|
||||
"usuario": "1715060073",
|
||||
"uuid": "sak8743892ur89w37493q3ure213098r320",
|
||||
"fechaHora": null,
|
||||
"idioma": null,
|
||||
"empresa": null,
|
||||
"geolocalizacion": null
|
||||
},
|
||||
"bodyIn": {
|
||||
"maximoRegistros": 10,
|
||||
"tipoConsulta": 1,
|
||||
"entidad": "Empresa",
|
||||
"parametros": {
|
||||
"tipoNemonico": "COMERC"
|
||||
}
|
||||
"tipoAccion": 1,
|
||||
"entidad": "Usuario",
|
||||
"entidades": [
|
||||
{
|
||||
"usuUsuario": "1722779285",
|
||||
"usuNombre": "Diego Alejandro Panchi Ponce",
|
||||
"usuDescripcion": "Usuario Diego Panchi suscripciones",
|
||||
"usuEmail": "suscripcion@segurosmedi.com",
|
||||
"usuPassword": "Diego@2020*",
|
||||
"usuEstado": 1,
|
||||
"usuIdOrigen": "20423",
|
||||
"usuOrigen": "PERSONA"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -0,0 +1,71 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>TestNG: Command line test</title>
|
||||
<link href="../testng.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../my-testng.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style type="text/css">
|
||||
.log { display: none;}
|
||||
.stack-trace { display: none;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function flip(e) {
|
||||
current = e.style.display;
|
||||
if (current == 'block') {
|
||||
e.style.display = 'none';
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
e.style.display = 'block';
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBox(szDivId, elem, msg1, msg2)
|
||||
{
|
||||
var res = -1; if (document.getElementById) {
|
||||
res = flip(document.getElementById(szDivId));
|
||||
}
|
||||
else if (document.all) {
|
||||
// this is the way old msie versions work
|
||||
res = flip(document.all[szDivId]);
|
||||
}
|
||||
if(elem) {
|
||||
if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toggleAllBoxes() {
|
||||
if (document.getElementsByTagName) {
|
||||
d = document.getElementsByTagName('div');
|
||||
for (i = 0; i < d.length; i++) {
|
||||
if (d[i].className == 'log') {
|
||||
flip(d[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h2 align='center'>Command line test</h2><table border='1' align="center">
|
||||
<tr>
|
||||
<td>Tests passed/Failed/Skipped:</td><td>0/0/0</td>
|
||||
</tr><tr>
|
||||
<td>Started on:</td><td>Tue Jun 29 20:55:56 ECT 2021</td>
|
||||
</tr>
|
||||
<tr><td>Total time:</td><td>0 seconds (6 ms)</td>
|
||||
</tr><tr>
|
||||
<td>Included groups:</td><td></td>
|
||||
</tr><tr>
|
||||
<td>Excluded groups:</td><td></td>
|
||||
</tr>
|
||||
</table><p/>
|
||||
<small><i>(Hover the method name to see the test class name)</i></small><p/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
|
||||
<testsuite ignored="0" hostname="james-laptop001" failures="0" tests="0" time="0.006" errors="0" timestamp="30 jun. 2021 01:55:56 GMT">
|
||||
</testsuite>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testng-results ignored="0" total="0" passed="0" failed="0" skipped="0">
|
||||
<reporter-output>
|
||||
</reporter-output>
|
||||
<suite started-at="2021-06-30T01:55:56Z" name="com.qsoft.test.Tester" finished-at="2021-06-30T01:55:56Z" duration-ms="6">
|
||||
<groups>
|
||||
</groups>
|
||||
<test started-at="2021-06-30T01:55:56Z" name="Command line test" finished-at="2021-06-30T01:55:56Z" duration-ms="6">
|
||||
</test> <!-- Command line test -->
|
||||
</suite> <!-- com.qsoft.test.Tester -->
|
||||
</testng-results>
|
||||
Loading…
Reference in New Issue