<commit_before>package org.openmrs.sdk;
import org.dom4j.*;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
import java.util.List;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 13-09-02
 * Time: 10:42 PM
 * To change this template use File | Settings | File Templates.
 */
public class testing {

    public static void main (String []args){
        addModule("/Users/admin/openmrs/gsoc/openmrs-sdk/openmrs-sdk-tool/test.xml");

    }

    public static void addModule(String fileName) {
        SAXReader reader = new SAXReader();
        Document modulePom = null;
        Element root = null;
        String groupID = null, artID = null, version = null;
        try {
            modulePom = reader.read(fileName);
            root = modulePom.getRootElement();
            List elements =  root.getParent().elements();

            for (Iterator i = root.elementIterator(); i.hasNext();) {
                Element pElement = (Element) i.next();
                if (pElement.getName().equals("properties")) {
                    System.out.println("Found: "+pElement.getName());

                    Element e = DocumentHelper.createElement("modules");
                    Element module = e.addElement("module");
                    module.setText("testing");
                    System.out.println(pElement.getName());
                    pElement.getParent().add(e);




                }

            }
           writePom(modulePom);

        }

        catch (DocumentException e1) {
           System.out.print("file missing");
        }
    }

    public static void writePom(Document document) {
        System.out.println("Saving file.");
        // write output
        OutputFormat format = OutputFormat.createPrettyPrint();
        format.setEncoding("utf-8");
        XMLWriter writer;
        try {<commit_msg>added testing class for adding modules elementg<commit_after>package org.openmrs.sdk;
import org.dom4j.*;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
import java.util.List;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 13-09-02
 * Time: 10:42 PM
 * To change this template use File | Settings | File Templates.
 */
public class testing {

    public static void main (String []args){
        addModule("/Users/admin/openmrs/gsoc/openmrs-sdk/openmrs-sdk-tool/test.xml");

    }

    public static void addModule(String fileName) {
        SAXReader reader = new SAXReader();
        Document modulePom = null;
        Element root = null;
        String groupID = null, artID = null, version = null;
        try {
            modulePom = reader.read(fileName);
            root = modulePom.getRootElement();


            for (Iterator i = root.elementIterator(); i.hasNext();) {
                Element pElement = (Element) i.next();
                if (pElement.getName().equals("properties")) {
                    System.out.println("Found: "+pElement.getName());

                    Element e = DocumentHelper.createElement("modules");
                    Element module = e.addElement("module");
                    module.setText("testing");
                    System.out.println(pElement.getName());
                    ((Element) i.next()).getParent().add(e);
                    pElement.getParent().add(e);




                }

            }
           writePom(modulePom);

        }

        catch (DocumentException e1) {
           System.out.print("file missing");
        }
    }

    public static void writePom(Document document) {
        System.out.println("Saving file.");
        // write output
        OutputFormat format = OutputFormat.createPrettyPrint();
        format.setEncoding("utf-8");
        XMLWriter writer;
        try {
{'fraction_non_alphanumeric': 0.11725132148005767, 'fraction_numerical': 0.0076886112445939455, 'mean_word_length': 2.182721712538226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3953795', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1120, 'n_words': 257}