package org.deeplearning4j.nn.conf;

import static org.junit.Assert.*;
import org.junit.Test;

/**
 * Created by agibsonccc on 11/27/14.
 */
public class MultiLayerNeuralNetConfigurationTest {

    @Test
    public void testJson() {
        MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
                .list(4).hiddenLayerSizes(new int[]{3,2,2}).build();
        String json = conf.toJson();
        MultiLayerConfiguration from = MultiLayerConfiguration.fromJson(json);
        assertEquals(conf,from);
    }


}

@@ -68,29 +68,118 @@
 .*;%0A
-import org.junit.Test
+%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.junit.Test;%0A%0Aimport java.io.*;%0Aimport java.util.Properties
 ;%0A%0A/
@@ -312,16 +312,33 @@
 stJson()
+ throws Exception
  %7B%0A     
@@ -625,16 +625,784 @@
 f,from);
+%0A%0A        Properties props = new Properties();%0A        props.put(%22json%22,json);%0A        String key = props.getProperty(%22json%22);%0A        assertEquals(json,key);%0A        File f = new File(%22props%22);%0A        f.deleteOnExit();%0A        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(f));%0A        props.store(bos,%22%22);%0A        bos.flush();%0A        bos.close();%0A        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f));%0A        Properties props2 = new Properties();%0A        props2.load(bis);%0A        bis.close();%0A        assertEquals(props2.getProperty(%22json%22),props.getProperty(%22json%22));%0A%0A        MultiLayerConfiguration conf3 = MultiLayerConfiguration.fromJson(props2.getProperty(%22json%22));%0A        assertEquals(conf,conf3);%0A%0A
 %0A    %7D%0A%0A

add some more tests for the configuration loading