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