/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.b3p.viewer.admin.stripes;

import net.sourceforge.stripes.action.ActionBeanContext;
import nl.b3p.viewer.config.app.ApplicationLayer;
import nl.b3p.viewer.config.app.StartLayer;
import nl.b3p.viewer.util.TestUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;

/**
 *
 * @author meine
 */
public class ApplicationTreeLevelActionBeanTest extends TestUtil {
    private static final Log log = LogFactory.getLog(ApplicationTreeLevelActionBeanTest.class);

    
    private  ApplicationTreeLevelActionBean instance;
    
    @Before
    public void setup(){
        instance = new ApplicationTreeLevelActionBean();
        instance.setContext(new ActionBeanContext());
    }
    
    @Test
    public void testDeleteAppLayer(){
        
        initData(true);
        assertNotNull(testAppLayer);
        assertNotNull(testStartLayer);
        
        String selectedLayer = "";
        
        instance.updateApplayersInLevel(selectedLayer, testLevel, entityManager);
                 
        try{
            entityManager.getTransaction().commit();
        }catch (Exception e){
            log.error("Fout bij verwijderen", e);
            assert(false);
        }
        entityManager.getTransaction().begin();

        ApplicationLayer appLayerNull = entityManager.find(ApplicationLayer.class, testAppLayer.getId());
        StartLayer startLayerNull = entityManager.find(StartLayer.class, testStartLayer.getId());
        assertNull(appLayerNull);
        assertNull(startLayerNull);
    }
}

@@ -980,68 +980,14 @@
 ();%0A
-        instance.setContext(new ActionBeanContext());%0A
     %7D%0A
+
     
@@ -1036,32 +1036,32 @@
 yer()%7B%0A        %0A
-
         initData
@@ -1064,24 +1064,116 @@
 Data(true);%0A
+        instance.setContext(new ActionBeanContext());%0A        instance.setApplication(app);%0A
         asse

Test updated