svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.xml2db / org.gvsig.xml2db.lib / org.gvsig.xml2db.lib.impl / src / test / java / org / gvsig / xml2db / lib / impl / TestStructureExtractor.java @ 47472
History | View | Annotate | Download (31.2 KB)
1 |
package org.gvsig.xml2db.lib.impl; |
---|---|
2 |
|
3 |
import java.io.InputStream; |
4 |
import java.util.ArrayList; |
5 |
import java.util.List; |
6 |
import java.util.Locale; |
7 |
import org.apache.commons.lang3.StringUtils; |
8 |
import org.apache.commons.lang3.tuple.ImmutablePair; |
9 |
import org.apache.commons.lang3.tuple.Pair; |
10 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
11 |
import org.gvsig.fmap.dal.feature.FeatureType; |
12 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
13 |
import org.gvsig.tools.util.ListBuilder; |
14 |
import org.gvsig.xml2db.lib.api.Xml2dbManager; |
15 |
import org.gvsig.xml2db.lib.api.xmlinfo.XMLInfo; |
16 |
import org.gvsig.xml2db.lib.api.xmlinfo.XMLTableInfo; |
17 |
import org.slf4j.Logger; |
18 |
import org.slf4j.LoggerFactory; |
19 |
|
20 |
|
21 |
@SuppressWarnings("UseSpecificCatch") |
22 |
public class TestStructureExtractor extends AbstractLibraryAutoInitTestCase { |
23 |
|
24 |
private static final Logger LOGGER = LoggerFactory.getLogger(TestStructureExtractor.class); |
25 |
|
26 |
public TestStructureExtractor(String testName) { |
27 |
super(testName);
|
28 |
} |
29 |
|
30 |
@Override
|
31 |
protected void doSetUp() throws Exception { |
32 |
|
33 |
} |
34 |
|
35 |
public void testExtractorDeclaracion() throws Exception { |
36 |
try {
|
37 |
Xml2dbManager manager = new DefaultXml2dbManager();
|
38 |
|
39 |
InputStream xml = this.getClass().getResourceAsStream("Declaracion4.xml"); |
40 |
XMLInfo xmlinfo = manager.extractStructure(xml, null, null, Locale.getDefault(), null, null); |
41 |
|
42 |
List<FeatureType> ftypes = new ArrayList<>(); |
43 |
for (XMLTableInfo tableInfo : xmlinfo) {
|
44 |
ftypes.add(tableInfo.getFeatureType()); |
45 |
} |
46 |
ftypes.sort((FeatureType o1, FeatureType o2) -> |
47 |
o1.getTags().getString("xml2db.tablename","") |
48 |
.compareTo(o2.getTags().getString("xml2db.tablename",""))); |
49 |
|
50 |
List<Pair<String,List<String>>> expecteds = ListBuilder.create( |
51 |
new ImmutablePair(
|
52 |
"DECLARACION",
|
53 |
ListBuilder.create( |
54 |
"$ID_DECLARACION",
|
55 |
"DECLARANTE",
|
56 |
"LINEA_DECLARACION",
|
57 |
"METADATA"
|
58 |
) |
59 |
), |
60 |
new ImmutablePair("LINEA_DECLARACION", |
61 |
ListBuilder.create( |
62 |
"$ID_DECLARACION",
|
63 |
"$ID_LINEA_DECLARACION",
|
64 |
"AGREGADO",
|
65 |
"CULTIVO",
|
66 |
"DN_SURFACE",
|
67 |
"FC_ALGARROBOS",
|
68 |
"FC_ALMENDROS",
|
69 |
"FC_AVELLANOS",
|
70 |
"FC_NOGALES",
|
71 |
"FC_PISTACHOS",
|
72 |
"FC_TOTAL",
|
73 |
"MUN_CAT",
|
74 |
"MUN_INE",
|
75 |
"PARCELA",
|
76 |
"PARCELA_AGRICOLA",
|
77 |
"POLIGONO",
|
78 |
"PROV",
|
79 |
"RECINTO",
|
80 |
"SUPERFICIE_DECLARADA",
|
81 |
"WKT",
|
82 |
"ZONA"
|
83 |
) |
84 |
), |
85 |
new ImmutablePair("METADATA", |
86 |
ListBuilder.create( |
87 |
"$ID_DECLARACION",
|
88 |
"$ID_METADATA",
|
89 |
"SRID",
|
90 |
"VERSION"
|
91 |
) |
92 |
) |
93 |
); |
94 |
for (int i = 0; i < ftypes.size(); i++) { |
95 |
FeatureType ftype = ftypes.get(i); |
96 |
String tableName = ftype.getTags().getString("xml2db.tablename",""); |
97 |
System.out.println(tableName);
|
98 |
assertEquals(expecteds.get(i).getLeft(), tableName); |
99 |
for (int j = 0; j < ftype.size(); j++) { |
100 |
FeatureAttributeDescriptor attr = ftype.get(j); |
101 |
System.out.println(" "+attr.getName()); |
102 |
assertEquals(expecteds.get(i).getRight().get(j), attr.getName()); |
103 |
} |
104 |
System.out.println(ftype.toJson().toString());
|
105 |
} |
106 |
} catch(Throwable t) { |
107 |
LOGGER.warn("",t);
|
108 |
throw t;
|
109 |
} |
110 |
} |
111 |
|
112 |
public void testExtractorR10graf() throws Exception { |
113 |
try {
|
114 |
Xml2dbManager manager = new DefaultXml2dbManager();
|
115 |
|
116 |
InputStream xml = this.getClass().getResourceAsStream("r10graf.xml"); |
117 |
XMLInfo xmlinfo = manager.extractStructure(xml, null, null, Locale.getDefault(), null, null); |
118 |
|
119 |
List<FeatureType> ftypes = new ArrayList<>(); |
120 |
for (XMLTableInfo tableInfo : xmlinfo) {
|
121 |
ftypes.add(tableInfo.getFeatureType()); |
122 |
} |
123 |
ftypes.sort((FeatureType o1, FeatureType o2) -> |
124 |
o1.getTags().getString("xml2db.tablename","") |
125 |
.compareTo(o2.getTags().getString("xml2db.tablename",""))); |
126 |
|
127 |
|
128 |
List<Pair<String,List<String>>> expecteds = ListBuilder.create( |
129 |
new ImmutablePair(
|
130 |
"expediente",
|
131 |
ListBuilder.create( |
132 |
"$ID_expediente",
|
133 |
"$ID_r10_graf",
|
134 |
"num_expediente",
|
135 |
"$List_parcela"
|
136 |
) |
137 |
), |
138 |
new ImmutablePair("linea", |
139 |
ListBuilder.create( |
140 |
"$ID_expediente",
|
141 |
"$ID_linea",
|
142 |
"$ID_parcela",
|
143 |
"$ID_r10_graf",
|
144 |
"ag",
|
145 |
"lin_codigo",
|
146 |
"mu",
|
147 |
"pa",
|
148 |
"po",
|
149 |
"pr",
|
150 |
"re",
|
151 |
"wkt",
|
152 |
"zo"
|
153 |
) |
154 |
), |
155 |
new ImmutablePair("parcela", |
156 |
ListBuilder.create( |
157 |
"$ID_expediente",
|
158 |
"$ID_parcela",
|
159 |
"$ID_r10_graf",
|
160 |
"num_parcela",
|
161 |
"$List_linea"
|
162 |
) |
163 |
), |
164 |
new ImmutablePair("r10_graf", |
165 |
ListBuilder.create( |
166 |
"$ID_r10_graf",
|
167 |
"ca",
|
168 |
"campana",
|
169 |
"srid",
|
170 |
"$List_expediente"
|
171 |
) |
172 |
) |
173 |
); |
174 |
for (int i = 0; i < ftypes.size(); i++) { |
175 |
FeatureType ftype = ftypes.get(i); |
176 |
String tableName = ftype.getTags().getString("xml2db.tablename",""); |
177 |
System.out.println("\""+tableName+"\""); |
178 |
assertEquals(expecteds.get(i).getLeft(), tableName); |
179 |
for (int j = 0; j < ftype.size(); j++) { |
180 |
FeatureAttributeDescriptor attr = ftype.get(j); |
181 |
System.out.println(" \""+attr.getName()+"\""); |
182 |
assertEquals(expecteds.get(i).getRight().get(j), attr.getName()); |
183 |
} |
184 |
// System.out.println(ftype.toJson().toString());
|
185 |
} |
186 |
} catch(Throwable t) { |
187 |
LOGGER.warn("Test testExtractorR10graf failed",t);
|
188 |
throw t;
|
189 |
} |
190 |
} |
191 |
|
192 |
public void testExtractorArena2() throws Exception { |
193 |
try {
|
194 |
Xml2dbManager manager = new DefaultXml2dbManager();
|
195 |
|
196 |
InputStream xml = this.getClass().getResourceAsStream("victimas.xml"); |
197 |
XMLInfo xmlinfo = manager.extractStructure(xml, null, null, Locale.getDefault(), null, null); |
198 |
|
199 |
} catch(Throwable t) { |
200 |
LOGGER.warn("Test testExtractorArena2 failed",t);
|
201 |
throw t;
|
202 |
} |
203 |
} |
204 |
|
205 |
|
206 |
public void testExpedienteEnric() throws Exception { |
207 |
testExpedienteEnric(null);
|
208 |
} |
209 |
|
210 |
public void testExpedienteEnricConPrefijoDeTablas() throws Exception { |
211 |
testExpedienteEnric("EXP_");
|
212 |
} |
213 |
|
214 |
public void testExpedienteEnric(String tablesPrefix) throws Exception { |
215 |
try {
|
216 |
Xml2dbManager manager = new DefaultXml2dbManager();
|
217 |
|
218 |
InputStream xml = this.getClass().getResourceAsStream("export-expedientes.xml"); |
219 |
XMLInfo xmlinfo = manager.extractStructure(xml, null, null, Locale.getDefault(), tablesPrefix, null); |
220 |
|
221 |
List<FeatureType> ftypes = new ArrayList<>(); |
222 |
for (XMLTableInfo tableInfo : xmlinfo) {
|
223 |
ftypes.add(tableInfo.getFeatureType()); |
224 |
} |
225 |
ftypes.sort((FeatureType o1, FeatureType o2) -> |
226 |
o1.getTags().getString("xml2db.tablename","") |
227 |
.compareTo(o2.getTags().getString("xml2db.tablename",""))); |
228 |
|
229 |
List<Pair<String, List<String>>> expecteds = ListBuilder.create( |
230 |
new ImmutablePair("Autoriza", |
231 |
ListBuilder.create( |
232 |
"$ID_Autoriza",
|
233 |
"$ID_Solicitud",
|
234 |
"$ID_Solicitudes",
|
235 |
"$List_Concepto"
|
236 |
) |
237 |
), |
238 |
new ImmutablePair("Concepto_Autoriza", |
239 |
ListBuilder.create( |
240 |
"$ID_Autoriza",
|
241 |
"$ID_Concepto_Autoriza",
|
242 |
"$ID_Solicitud",
|
243 |
"$ID_Solicitudes",
|
244 |
"Concepto$v"
|
245 |
) |
246 |
), |
247 |
new ImmutablePair("Concepto_Solicita", |
248 |
ListBuilder.create( |
249 |
"$ID_Concepto_Solicita",
|
250 |
"$ID_Solicita",
|
251 |
"$ID_Solicitud",
|
252 |
"$ID_Solicitudes",
|
253 |
"Concepto$v"
|
254 |
) |
255 |
), |
256 |
new ImmutablePair("Conyuge", |
257 |
ListBuilder.create( |
258 |
"$ID_Conyuge",
|
259 |
"$ID_Solicitud",
|
260 |
"$ID_Solicitudes",
|
261 |
"Apellido1",
|
262 |
"Apellido2",
|
263 |
"IdentDistintoNIF_cony",
|
264 |
"NIF",
|
265 |
"Nombre",
|
266 |
"RegMatrimonial",
|
267 |
"Sexo"
|
268 |
) |
269 |
), |
270 |
new ImmutablePair("DatosBancarios", |
271 |
ListBuilder.create( |
272 |
"$ID_DatosBancarios",
|
273 |
"$ID_Solicitud",
|
274 |
"$ID_Solicitudes",
|
275 |
"CodBanco",
|
276 |
"CodSucursal",
|
277 |
"Cta_IBAN",
|
278 |
"DigControl",
|
279 |
"NumCuenta"
|
280 |
) |
281 |
), |
282 |
new ImmutablePair("DatosCroquis", |
283 |
ListBuilder.create( |
284 |
"$ID_DatosCroquis",
|
285 |
"$ID_Recinto",
|
286 |
"$ID_Recintos",
|
287 |
"$ID_Solicitud",
|
288 |
"$ID_Solicitudes",
|
289 |
"AGREGADO",
|
290 |
"CULTIVO",
|
291 |
"DN_SURFACE",
|
292 |
"FC_ALGARROBOS",
|
293 |
"FC_ALMENDROS",
|
294 |
"FC_AVELLANOS",
|
295 |
"FC_NOGALES",
|
296 |
"FC_PISTACHOS",
|
297 |
"FC_TOTAL",
|
298 |
"MUN_CAT",
|
299 |
"MUN_INE",
|
300 |
"PARCELA",
|
301 |
"PARCELA_AGRICOLA",
|
302 |
"POLIGONO",
|
303 |
"PROV",
|
304 |
"RECINTO",
|
305 |
"SUPERFICIE_DECLARADA",
|
306 |
"WKT",
|
307 |
"ZONA"
|
308 |
) |
309 |
), |
310 |
new ImmutablePair("DatosFiscales", |
311 |
ListBuilder.create( |
312 |
"$ID_DatosFiscales",
|
313 |
"$ID_Solicitud",
|
314 |
"$ID_Solicitudes",
|
315 |
"CodFormaJuridica",
|
316 |
"InicioActAgraria"
|
317 |
) |
318 |
), |
319 |
new ImmutablePair("DatosVariedadProdRec", |
320 |
ListBuilder.create( |
321 |
"$ID_DatosVariedadProdRec",
|
322 |
"$ID_DesgloseVariedades",
|
323 |
"$ID_Recinto",
|
324 |
"$ID_Recintos",
|
325 |
"$ID_Solicitud",
|
326 |
"$ID_Solicitudes",
|
327 |
"CodProducto",
|
328 |
"CodVariedad",
|
329 |
"PorcentajeVar"
|
330 |
) |
331 |
), |
332 |
new ImmutablePair("DchoPagoBasico", |
333 |
ListBuilder.create( |
334 |
"$ID_DchoPagoBasico",
|
335 |
"$ID_Solicitud",
|
336 |
"$ID_Solicitudes",
|
337 |
"$List_DerechoPagoBasico"
|
338 |
) |
339 |
), |
340 |
new ImmutablePair("Declara", |
341 |
ListBuilder.create( |
342 |
"$ID_Declara",
|
343 |
"$ID_Solicitud",
|
344 |
"$ID_Solicitudes",
|
345 |
"Concepto"
|
346 |
) |
347 |
), |
348 |
new ImmutablePair("DerechoPagoBasico", |
349 |
ListBuilder.create( |
350 |
"$ID_DchoPagoBasico",
|
351 |
"$ID_DerechoPagoBasico",
|
352 |
"$ID_Solicitud",
|
353 |
"$ID_Solicitudes",
|
354 |
"IdDerecho",
|
355 |
"OrigenDerecho",
|
356 |
"PorcDerecho",
|
357 |
"PorcDerechoPagoBasicoOrigen",
|
358 |
"PropietarioDerecho",
|
359 |
"SolicitaDerecho",
|
360 |
"ValorNominal",
|
361 |
"ZonaRegionalizacion"
|
362 |
) |
363 |
), |
364 |
new ImmutablePair("DesgloseVariedades", |
365 |
ListBuilder.create( |
366 |
"$ID_DesgloseVariedades",
|
367 |
"$ID_Recinto",
|
368 |
"$ID_Recintos",
|
369 |
"$ID_Solicitud",
|
370 |
"$ID_Solicitudes",
|
371 |
"DatosVariedadProdRec"
|
372 |
) |
373 |
), |
374 |
new ImmutablePair("Documento", |
375 |
ListBuilder.create( |
376 |
"$ID_Documento",
|
377 |
"$ID_Documentos",
|
378 |
"$ID_Solicitud",
|
379 |
"$ID_Solicitudes",
|
380 |
"CodDocumento",
|
381 |
"CodGrupo",
|
382 |
"DocIdRepositorio"
|
383 |
) |
384 |
), |
385 |
new ImmutablePair("Documentos", |
386 |
ListBuilder.create( |
387 |
"$ID_Documentos",
|
388 |
"$ID_Solicitud",
|
389 |
"$ID_Solicitudes",
|
390 |
"$List_Documento"
|
391 |
) |
392 |
), |
393 |
new ImmutablePair("DocumentosAsociadosRecinto", |
394 |
ListBuilder.create( |
395 |
"$ID_DocumentosAsociadosRecinto",
|
396 |
"$ID_Recinto",
|
397 |
"$ID_Recintos",
|
398 |
"$ID_Solicitud",
|
399 |
"$ID_Solicitudes",
|
400 |
"DocumentosRecinto"
|
401 |
) |
402 |
), |
403 |
new ImmutablePair("DocumentosRecinto", |
404 |
ListBuilder.create( |
405 |
"$ID_DocumentosAsociadosRecinto",
|
406 |
"$ID_DocumentosRecinto",
|
407 |
"$ID_Recinto",
|
408 |
"$ID_Recintos",
|
409 |
"$ID_Solicitud",
|
410 |
"$ID_Solicitudes",
|
411 |
"CodDocumentoRec",
|
412 |
"DocIdRepositorioRec"
|
413 |
) |
414 |
), |
415 |
new ImmutablePair("ExclusionListaNegativa_AgriAct", |
416 |
ListBuilder.create( |
417 |
"$ID_ExclusionListaNegativa_AgriAct",
|
418 |
"$ID_Solicitud",
|
419 |
"$ID_Solicitudes",
|
420 |
"ActividadAnexoIII",
|
421 |
"AgriAct_20pct",
|
422 |
"AgriAct_5pct",
|
423 |
"AportaEstatutos",
|
424 |
"AportaOtrosDoc",
|
425 |
"AportaSS",
|
426 |
"AutorizaConsultaSS",
|
427 |
"ConEntidadesAsociadas",
|
428 |
"EstatutoActividadAgr",
|
429 |
"PresentaIngrAgrarios",
|
430 |
"QuiereSerAgriAct",
|
431 |
"RevisarOficio"
|
432 |
) |
433 |
), |
434 |
new ImmutablePair("Expone", |
435 |
ListBuilder.create( |
436 |
"$ID_Expone",
|
437 |
"$ID_Solicitud",
|
438 |
"$ID_Solicitudes",
|
439 |
"Concepto"
|
440 |
) |
441 |
), |
442 |
new ImmutablePair("IdentificacionSolicitud", |
443 |
ListBuilder.create( |
444 |
"$ID_IdentificacionSolicitud",
|
445 |
"$ID_Solicitud",
|
446 |
"$ID_Solicitudes",
|
447 |
"AmbitoGestion",
|
448 |
"AmbitoPresentacion",
|
449 |
"CIF_NIF_CertiRegistro",
|
450 |
"CIF_NIF_Firmante",
|
451 |
"Campania",
|
452 |
"CertifVerificado_Firma",
|
453 |
"CodModo_Firma",
|
454 |
"ComAutonomaAnterior",
|
455 |
"FecFirmaSol",
|
456 |
"FecRegistroSol",
|
457 |
"FecVerificaCerti_Firma",
|
458 |
"FirmadaElectronicamente",
|
459 |
"FueraPlazoFuerzaMayor",
|
460 |
"NombreApe_CertiRegistro",
|
461 |
"NombreApe_Firmante",
|
462 |
"NumExpediente",
|
463 |
"NumRegistroEntrada",
|
464 |
"NumeroSol",
|
465 |
"OrganismoPagador",
|
466 |
"RequiereDecGrafica",
|
467 |
"SolCIP",
|
468 |
"TieneDecGrafica",
|
469 |
"TieneDecGraficaApi",
|
470 |
"TipoSol"
|
471 |
) |
472 |
), |
473 |
new ImmutablePair("Linea", |
474 |
ListBuilder.create( |
475 |
"$ID_Linea",
|
476 |
"$ID_LineasAyuda",
|
477 |
"$ID_Recinto",
|
478 |
"$ID_Recintos",
|
479 |
"$ID_Solicitud",
|
480 |
"$ID_Solicitudes",
|
481 |
"CodLinea"
|
482 |
) |
483 |
), |
484 |
new ImmutablePair("LineasAyuda", |
485 |
ListBuilder.create( |
486 |
"$ID_LineasAyuda",
|
487 |
"$ID_Recinto",
|
488 |
"$ID_Recintos",
|
489 |
"$ID_Solicitud",
|
490 |
"$ID_Solicitudes",
|
491 |
"$List_Linea"
|
492 |
) |
493 |
), |
494 |
new ImmutablePair("Recinto", |
495 |
ListBuilder.create( |
496 |
"$ID_Recinto",
|
497 |
"$ID_Recintos",
|
498 |
"$ID_Solicitud",
|
499 |
"$ID_Solicitudes",
|
500 |
"ActividadAgraria",
|
501 |
"Agregado",
|
502 |
"AnioPlantacion",
|
503 |
"ArrDistintoCIF_NIF",
|
504 |
"CodRecinto",
|
505 |
"CodSecuencial",
|
506 |
"CodSistemaCultivo",
|
507 |
"CodSistemaRiego",
|
508 |
"CodUso",
|
509 |
"CoefRevisionCAP",
|
510 |
"ComputaSIE",
|
511 |
"ConcentracionParc",
|
512 |
"DatosCroquis",
|
513 |
"DeclOlivarAntes2010",
|
514 |
"DesgloseVariedades",
|
515 |
"DocumentosAsociadosRecinto",
|
516 |
"EsBarbechoEnProduccion",
|
517 |
"EsDehesaComunal",
|
518 |
"EsPastoComunalPublicoMant",
|
519 |
"LineasAyuda",
|
520 |
"LongitudGraficaMetros",
|
521 |
"MultSemillaSecundaria",
|
522 |
"MultiplicaSemilla",
|
523 |
"Municipio",
|
524 |
"NoSincronizado",
|
525 |
"NumAlgarrobos",
|
526 |
"NumArboles",
|
527 |
"NumParcelaAgric",
|
528 |
"NumParticion",
|
529 |
"NumeroPuntosGraficos",
|
530 |
"Paraje",
|
531 |
"Parcela",
|
532 |
"PastoComun",
|
533 |
"Poligono",
|
534 |
"PorcPendienteMedia",
|
535 |
"ProdEcologica",
|
536 |
"Producto",
|
537 |
"ProvieneModif",
|
538 |
"Provincia",
|
539 |
"RecForrajero",
|
540 |
"RecintoNuevo",
|
541 |
"RegTenencia",
|
542 |
"SistemaExplot",
|
543 |
"SistemaProdOlivar",
|
544 |
"SolicitaAlegaciones",
|
545 |
"SupDecAlfanumerica",
|
546 |
"SupDecGrafica",
|
547 |
"SupDeclarada",
|
548 |
"SupSIGPAC",
|
549 |
"TieneCroquis",
|
550 |
"Variedad",
|
551 |
"Zona",
|
552 |
"ZonaPastosPermanentesSensible"
|
553 |
) |
554 |
), |
555 |
new ImmutablePair("Recintos", |
556 |
ListBuilder.create( |
557 |
"$ID_Recintos",
|
558 |
"$ID_Solicitud",
|
559 |
"$ID_Solicitudes",
|
560 |
"$List_Recinto"
|
561 |
) |
562 |
), |
563 |
new ImmutablePair("ResponsabilidadJuridicaExplot", |
564 |
ListBuilder.create( |
565 |
"$ID_ResponsabilidadJuridicaExplot",
|
566 |
"$ID_Solicitud",
|
567 |
"$ID_Solicitudes",
|
568 |
"AnioJefeExplo",
|
569 |
"Apellido1_JefeExplo",
|
570 |
"Apellido2_JefeExplo",
|
571 |
"CIF_NIF_JefeExplo",
|
572 |
"CodPorcentajeJornadaExplo",
|
573 |
"ComparteRespConyuge",
|
574 |
"ComparteRespFamiliar",
|
575 |
"FecNacimiento_JefeExplo",
|
576 |
"FormacionAgrJefeExplo",
|
577 |
"FormacionProfesional",
|
578 |
"IdentDistintoCIF_NIF",
|
579 |
"Nombre_RSocial_JefeExplo",
|
580 |
"ResponsabilidadJuridica",
|
581 |
"Sexo_JefeExplo",
|
582 |
"TitularJefeExplo"
|
583 |
) |
584 |
), |
585 |
new ImmutablePair("Solicita", |
586 |
ListBuilder.create( |
587 |
"$ID_Solicita",
|
588 |
"$ID_Solicitud",
|
589 |
"$ID_Solicitudes",
|
590 |
"$List_Concepto"
|
591 |
) |
592 |
), |
593 |
new ImmutablePair("Solicitante", |
594 |
ListBuilder.create( |
595 |
"$ID_Solicitante",
|
596 |
"$ID_Solicitud",
|
597 |
"$ID_Solicitudes",
|
598 |
"Apellido1",
|
599 |
"Apellido2",
|
600 |
"CIF_NIF",
|
601 |
"CodPostalNotif",
|
602 |
"EMail",
|
603 |
"EstadoCivil",
|
604 |
"FecNacimiento",
|
605 |
"IdentDistintoCIF_NIF",
|
606 |
"LocalidadNotif",
|
607 |
"MunicipioNotif",
|
608 |
"NombreViaNotif",
|
609 |
"Nombre_RSocial",
|
610 |
"NumeroViaNotif",
|
611 |
"PaisNotif",
|
612 |
"ProvinciaNotif",
|
613 |
"PuertaNotif",
|
614 |
"ResidenciaIgualNotif",
|
615 |
"Sexo",
|
616 |
"TelefMovil",
|
617 |
"TipoViaNotif",
|
618 |
"TitularidadCompartida"
|
619 |
) |
620 |
), |
621 |
new ImmutablePair("SolicitantePDR", |
622 |
ListBuilder.create( |
623 |
"$ID_SolicitantePDR",
|
624 |
"$ID_Solicitud",
|
625 |
"$ID_Solicitudes",
|
626 |
"ATP",
|
627 |
"AgricultorIndividual",
|
628 |
"AgricultorProfesional",
|
629 |
"ExplotPrioritaria",
|
630 |
"FamiliaNumerosa",
|
631 |
"JovenAgricultor",
|
632 |
"pct50_jovenes",
|
633 |
"pct50_mujeres"
|
634 |
) |
635 |
), |
636 |
new ImmutablePair("Solicitud", |
637 |
ListBuilder.create( |
638 |
"$ID_Solicitud",
|
639 |
"$ID_Solicitudes",
|
640 |
"Autoriza",
|
641 |
"Conyuge",
|
642 |
"DatosBancarios",
|
643 |
"DatosFiscales",
|
644 |
"DchoPagoBasico",
|
645 |
"Declara",
|
646 |
"Documentos",
|
647 |
"ExclusionListaNegativa_AgriAct",
|
648 |
"Expone",
|
649 |
"IdentificacionSolicitud",
|
650 |
"Recintos",
|
651 |
"ResponsabilidadJuridicaExplot",
|
652 |
"Solicita",
|
653 |
"Solicitante",
|
654 |
"SolicitantePDR"
|
655 |
) |
656 |
), |
657 |
new ImmutablePair("Solicitudes", |
658 |
ListBuilder.create( |
659 |
"$ID_Solicitudes",
|
660 |
"Solicitud"
|
661 |
) |
662 |
) |
663 |
); |
664 |
for (int i = 0; i < ftypes.size(); i++) { |
665 |
FeatureType ftype = ftypes.get(i); |
666 |
String tableName = ftype.getTags().getString("xml2db.tablename",""); |
667 |
// System.out.println("new ImmutablePair(\""+tableName+"\", \n ListBuilder.create(\n");
|
668 |
assertEquals(StringUtils.join(tablesPrefix,expecteds.get(i).getLeft()), tableName); |
669 |
for (int j = 0; j < ftype.size(); j++) { |
670 |
FeatureAttributeDescriptor attr = ftype.get(j); |
671 |
// System.out.println(" \""+attr.getName()+"\""+(j==ftype.size()-1?"":","));
|
672 |
assertEquals(expecteds.get(i).getRight().get(j), attr.getName()); |
673 |
} |
674 |
// System.out.println(" )\n ),\n");
|
675 |
// System.out.println(ftype.toJson().toString());
|
676 |
} |
677 |
} catch(Throwable t) { |
678 |
LOGGER.warn("Test testExpedienteEnric failed",t);
|
679 |
throw t;
|
680 |
} |
681 |
} |
682 |
|
683 |
} |