<commit_before>package dae.prefab.io;

import com.jme3.asset.AssetKey;
import com.jme3.asset.AssetManager;
import dae.GlobalObjects;
import dae.animation.rig.Rig;
import dae.animation.rig.io.RigLoader;
import dae.animation.rig.io.RigWriter;
import dae.io.ObjectTypeReader;
import dae.io.SceneLoader;
import dae.io.SceneSaver;
import dae.prefab.io.rig.ReadWriteRigTest;
import dae.prefabs.Prefab;
import dae.prefabs.brush.TerrainBrush;
import dae.prefabs.types.ObjectType;
import dae.prefabs.types.ObjectTypeCategory;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.xml.sax.SAXException;

/**
 *
 * @author <NAME>
 */
@RunWith(Suite.class)
@Suite.SuiteClasses({dae.prefab.io.ReadWriteCopyStrokeTest.class,
    dae.prefab.io.ReadWriteCopyBrushTest.class,
    ReadWriteCopyMeshTest.class,
    ReadWriteCopyGridTest.class,
    ReadWriteCopyHingeJoint.class,
    ReadWriteCopyWaypointTest.class,
    ReadWriteCopyCharacterPath.class,
    ReadWriteCopySpotLightTest.class,
    ReadWriteCopyAmbientLightTest.class,
    ReadWriteCopyDirectionalLightTest.class,
    ReadWriteCopyPointLightTest.class,
    ReadWriteCopySoundEntityTest.class,
    ReadWriteCopyCameraEntityTest.class,
    ReadWriteCopyPlayerStartEntityTest.class,
    ReadWriteCopyTerrainTest.class,
    ReadWriteCopyRevoluteJointTest.class
})
public class TextIOTestSuite {

    public static void createMockGame() {
        try {
            ObjectTypeReader reader = new ObjectTypeReader();
            MockAssetManager manager = new MockAssetManager();
            MockAssetInfo assetInfo = new MockAssetInfo(manager, new AssetKey("/Objects/ObjectTypes.types"));
            ObjectTypeCategory types = (ObjectTypeCategory) reader.load(assetInfo);
            GlobalObjects.getInstance().setObjectTypeCategory(types);
            GlobalObjects.getInstance().setAssetManager(manager);
        } catch (IOException ex) {
            Logger.getLogger(ReadWriteCopyStrokeTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static Object createObject(String category, String label, Class expected) {
        ObjectTypeCategory types = GlobalObjects.getInstance().getObjectsTypeCategory();
        AssetManager manager = GlobalObjects.getInstance().getAssetManager();
        ObjectType type = types.getObjectType(category, label);
        assertNotNull("Type [" + category + "," + label + "] not found", type);
        Object object = type.create(manager, label + "1");
        assertNotNull("Could not create " + category + ":" + label + "!", object);
        assertTrue("Stroke object not instanceof Stroke", expected.isInstance(object));
        return object;
    }

    public static String writeObject(Prefab toWrite) {
        dae.project.Level l = new dae.project.Level("test", false);
        l.attachChild(toWrite);

        StringWriter sw = new StringWriter();
        BufferedWriter bw = new BufferedWriter(sw);
        try {
            SceneSaver.writeScene(bw, l);
            bw.close();
        } catch (IOException ex) {
            Logger.getLogger(TextIOTestSuite.class.getName()).log(Level.SEVERE, null, ex);
        }
        String result = sw.getBuffer().toString();
        Logger.getLogger("DArtE").log(Level.INFO, "Result of writing the object");
        Logger.getLogger("DartE").log(Level.INFO, result);
        return result;<commit_msg>fixed println message error.<commit_after>package dae.prefab.io;

import com.jme3.asset.AssetKey;
import com.jme3.asset.AssetManager;
import dae.GlobalObjects;
import dae.animation.rig.Rig;
import dae.animation.rig.io.RigLoader;
import dae.animation.rig.io.RigWriter;
import dae.io.ObjectTypeReader;
import dae.io.SceneLoader;
import dae.io.SceneSaver;
import dae.prefab.io.rig.ReadWriteRigTest;
import dae.prefabs.Prefab;
import dae.prefabs.brush.TerrainBrush;
import dae.prefabs.types.ObjectType;
import dae.prefabs.types.ObjectTypeCategory;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.xml.sax.SAXException;

/**
 *
 * @author <NAME>
 */
@RunWith(Suite.class)
@Suite.SuiteClasses({dae.prefab.io.ReadWriteCopyStrokeTest.class,
    dae.prefab.io.ReadWriteCopyBrushTest.class,
    ReadWriteCopyMeshTest.class,
    ReadWriteCopyGridTest.class,
    ReadWriteCopyHingeJoint.class,
    ReadWriteCopyWaypointTest.class,
    ReadWriteCopyCharacterPath.class,
    ReadWriteCopySpotLightTest.class,
    ReadWriteCopyAmbientLightTest.class,
    ReadWriteCopyDirectionalLightTest.class,
    ReadWriteCopyPointLightTest.class,
    ReadWriteCopySoundEntityTest.class,
    ReadWriteCopyCameraEntityTest.class,
    ReadWriteCopyPlayerStartEntityTest.class,
    ReadWriteCopyTerrainTest.class,
    ReadWriteCopyRevoluteJointTest.class
})
public class TextIOTestSuite {

    public static void createMockGame() {
        try {
            ObjectTypeReader reader = new ObjectTypeReader();
            MockAssetManager manager = new MockAssetManager();
            MockAssetInfo assetInfo = new MockAssetInfo(manager, new AssetKey("/Objects/ObjectTypes.types"));
            ObjectTypeCategory types = (ObjectTypeCategory) reader.load(assetInfo);
            GlobalObjects.getInstance().setObjectTypeCategory(types);
            GlobalObjects.getInstance().setAssetManager(manager);
        } catch (IOException ex) {
            Logger.getLogger(ReadWriteCopyStrokeTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static Object createObject(String category, String label, Class expected) {
        ObjectTypeCategory types = GlobalObjects.getInstance().getObjectsTypeCategory();
        AssetManager manager = GlobalObjects.getInstance().getAssetManager();
        ObjectType type = types.getObjectType(category, label);
        assertNotNull("Type [" + category + "," + label + "] not found", type);
        Object object = type.create(manager, label + "1");
        assertNotNull("Could not create " + category + ":" + label + "!", object);
        assertTrue(category+":"+label +" object not an instance of " + expected.getName(), expected.isInstance(object));
        return object;
    }

    public static String writeObject(Prefab toWrite) {
        dae.project.Level l = new dae.project.Level("test", false);
        l.attachChild(toWrite);

        StringWriter sw = new StringWriter();
        BufferedWriter bw = new BufferedWriter(sw);
        try {
            SceneSaver.writeScene(bw, l);
            bw.close();
        } catch (IOException ex) {
            Logger.getLogger(TextIOTestSuite.class.getName()).log(Level.SEVERE, null, ex);
        }
        String result = sw.getBuffer().toString();
        Logger.getLogger("DArtE").log(Level.INFO, "Result of writing the object");
        Logger.getLogger("DartE").log(Level.INFO, result);
        return result;
{'fraction_non_alphanumeric': 0.10687708493713112, 'fraction_numerical': 0.0007698229407236335, 'mean_word_length': 3.917981072555205, 'pattern_counts': {'":': 3, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4635314', 'n_tokens_mistral': 2255, 'n_tokens_neox': 2219, 'n_words': 416}