// Path: airomem-direct/src/test/java/pl/setblack/airomem/direct/SampleObject.java
// public class SampleObject implements Serializable {
// 
//     private static final long serialVersionUID = 1l;
// 
//     private String field1;
// 
//     private String field2;
// 
//     public int value;
// 
//     public SampleObject() {
//     }
// 
//     public String getField1() {
//         return field1;
//     }
// 
//     public void setField1(String field1) {
//         this.field1 = field1;
//     }
// 
//     public String getField2() {
//         return field2;
//     }
// 
//     public void setField2(String field2) {
//         this.field2 = field2;
//     }
// 
// }


import java.io.File;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import pl.setblack.airomem.core.builders.PersistenceFactory;
import pl.setblack.airomem.core.SimpleController;
import pl.setblack.airomem.direct.SampleObject;
import pl.setblack.badass.Politician;

/*
 *  Copyright (c) Jarek Ratajski, Licensed under the Apache License, Version 2.0
 *  http://www.apache.org/licenses/LICENSE-2.0
 */
package pl.setblack.airomem.direct.impl;


/**
 *
 * @author jarek ratajski
 */
public class PrevaylerRegisterTest {

    public PrevaylerRegisterTest() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
        PrevaylerRegister.getInstance().clear();
        Politician.beatAroundTheBush(() -> {
            FileUtils.deleteDirectory(new File(PersistenceFactory.STORAGE_FOLDER));
        });
    }

    @Test
    public void shouldReturnSameInstance() {
        final PrevaylerRegister inst1 = PrevaylerRegister.getInstance();
        final PrevaylerRegister inst2 = PrevaylerRegister.getInstance();
        assertTrue(inst1 == inst2);
    }

    @Test
    public void shouldReturnPrevaylerOfGivenClass() {

// Path: airomem-direct/src/test/java/pl/setblack/airomem/direct/SampleObject.java
// public class SampleObject implements Serializable {
// 
//     private static final long serialVersionUID = 1l;
// 
//     private String field1;
// 
//     private String field2;
// 
//     public int value;
// 
//     public SampleObject() {
//     }
// 
//     public String getField1() {
//         return field1;
//     }
// 
//     public void setField1(String field1) {
//         this.field1 = field1;
//     }
// 
//     public String getField2() {
//         return field2;
//     }
// 
//     public void setField2(String field2) {
//         this.field2 = field2;
//     }
// 
// }


// Path: airomem-direct/src/test/java/pl/setblack/airomem/direct/impl/PrevaylerRegisterTest.java
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import pl.setblack.airomem.core.builders.PersistenceFactory;
import pl.setblack.airomem.core.SimpleController;
import pl.setblack.airomem.direct.SampleObject;
import pl.setblack.badass.Politician;

/*
 *  Copyright (c) Jarek Ratajski, Licensed under the Apache License, Version 2.0
 *  http://www.apache.org/licenses/LICENSE-2.0
 */
package pl.setblack.airomem.direct.impl;


/**
 *
 * @author jarek ratajski
 */
public class PrevaylerRegisterTest {

    public PrevaylerRegisterTest() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
        PrevaylerRegister.getInstance().clear();
        Politician.beatAroundTheBush(() -> {
            FileUtils.deleteDirectory(new File(PersistenceFactory.STORAGE_FOLDER));
        });
    }

    @Test
    public void shouldReturnSameInstance() {
        final PrevaylerRegister inst1 = PrevaylerRegister.getInstance();
        final PrevaylerRegister inst2 = PrevaylerRegister.getInstance();
        assertTrue(inst1 == inst2);
    }

    @Test
    public void shouldReturnPrevaylerOfGivenClass() {

        final SimpleController<SampleObject> obj = PrevaylerRegister.getInstance().getController(SampleObject.class, "test");
