Fix CS warnings in sal-clustering-commons and enable enforcement
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / xml / codec / XmlUtilsTest.java
index b82f534839dca342c5c1a49e19947d0fd05caeaa..023d1fad8f0d16b9d4c84bbdaba1e69d52b0caf0 100644 (file)
@@ -13,10 +13,8 @@ import com.google.common.io.ByteSource;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import javax.xml.parsers.DocumentBuilderFactory;
 import org.junit.Before;
 import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
@@ -24,47 +22,33 @@ import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline
 
 // FIXME : CompositeNode is not avaliable anymore so fix the test to use NormalizedNodeContainer ASAP
 public class XmlUtilsTest {
-
-  private static final DocumentBuilderFactory BUILDERFACTORY;
-
-  static {
-    final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-    factory.setNamespaceAware(true);
-    factory.setCoalescing(true);
-    factory.setIgnoringElementContentWhitespace(true);
-    factory.setIgnoringComments(true);
-    BUILDERFACTORY = factory;
-  }
-
-  private SchemaContext schemaContext;
-  private RpcDefinition testRpc;
-
-  public static final String XML_CONTENT = "<add-flow xmlns=\"urn:opendaylight:controller:rpc:test\"><input xmlns=\"urn:opendaylight:controller:rpc:test\">" +
-      "<id>flowid</id>" +
-      "<flow xmlns:ltha=\"urn:opendaylight:controller:rpc:test\">/ltha:node/ltha:node1[ltha:id='3@java.lang.Short']</flow>" +
-      "</input></add-flow>";
-
-  @Before
-  public void setUp() throws Exception {
-    final ByteSource byteSource = new ByteSource() {
-      @Override
-      public InputStream openStream() throws IOException {
-        return XmlUtilsTest.this.getClass().getResourceAsStream("rpcTest.yang");
-      }
-    };
-
-    final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
-    final ArrayList<ByteSource> sources = Lists.newArrayList(byteSource);
-
-    try {
-
-      schemaContext = reactor.buildEffective(sources);
-    } catch (ReactorException e) {
-      throw new RuntimeException("Unable to build schema context from " + sources, e);
+    public static final String XML_CONTENT = "<add-flow xmlns=\"urn:opendaylight:controller:rpc:test\">"
+            + "<input xmlns=\"urn:opendaylight:controller:rpc:test\"><id>flowid</id>"
+            + "<flow xmlns:ltha=\"urn:opendaylight:controller:rpc:test\">/ltha:node/ltha:node1"
+            + "[ltha:id='3@java.lang.Short']</flow></input></add-flow>";
+
+    private SchemaContext schemaContext;
+
+    @Before
+    public void setUp() throws Exception {
+        final ByteSource byteSource = new ByteSource() {
+            @Override
+            public InputStream openStream() throws IOException {
+                return XmlUtilsTest.this.getClass().getResourceAsStream("rpcTest.yang");
+            }
+        };
+
+        final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
+        final ArrayList<ByteSource> sources = Lists.newArrayList(byteSource);
+
+        try {
+
+            schemaContext = reactor.buildEffective(sources);
+        } catch (ReactorException e) {
+            throw new RuntimeException("Unable to build schema context from " + sources, e);
+        }
+
+        final Module rpcTestModule = schemaContext.getModules().iterator().next();
+        rpcTestModule.getRpcs().iterator().next();
     }
-
-    final Module rpcTestModule = schemaContext.getModules().iterator().next();
-    testRpc = rpcTestModule.getRpcs().iterator().next();
-  }
-
 }