35f1354cb70e427b815754c82441c9477d1950f5
[yangtools.git] / codec / yang-data-codec-xml / src / test / java / org / opendaylight / yangtools / yang / data / codec / xml / TestFactories.java
1 /*
2  * Copyright (c) 2019 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.codec.xml;
9
10 import java.util.Collection;
11 import java.util.List;
12 import javax.xml.stream.XMLOutputFactory;
13
14 final class TestFactories {
15     /**
16      * Non-repairing XMLOutputFactory.
17      */
18     static final XMLOutputFactory DEFAULT_OUTPUT_FACTORY = XMLOutputFactory.newFactory();
19
20     /**
21      * Repairing XMLOuputFactory.
22      */
23     static final XMLOutputFactory REPAIRING_OUTPUT_FACTORY;
24
25     static {
26         final var f = XMLOutputFactory.newFactory();
27         f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
28         REPAIRING_OUTPUT_FACTORY = f;
29     }
30
31     private TestFactories() {
32         // Hidden on purpose
33     }
34
35     static Collection<Object[]> junitParameters() {
36         return List.of(new Object[][] {
37             { "default", DEFAULT_OUTPUT_FACTORY },
38             { "repairing", REPAIRING_OUTPUT_FACTORY },
39         });
40     }
41 }