/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: proactive@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package functionalTests.descriptor.basic;

import java.io.File;

import org.junit.Test;
import org.objectweb.proactive.api.PADeployment;
import org.objectweb.proactive.extensions.gcmdeployment.GCMApplication.GCMApplicationParserImpl;
import org.objectweb.proactive.extensions.gcmdeployment.GCMDeployment.GCMDeploymentParserImpl;


public class TestBasicDescriptorParsing {
    //    @Test
    public void oldDeploymentDescriptorParse() throws Exception {
        String descriptorLocation = getClass().getResource("javaproperty_ERROR.xml").getPath();

        Object proActiveDescriptor = PADeployment.getProactiveDescriptor("file:" + descriptorLocation);

    }

    @Test
    public void deploymentDescriptorParse() throws Exception {
        String descriptorLocation = getClass().getResource("wrong_namespace.xml").getPath();

        GCMDeploymentParserImpl parser = new GCMDeploymentParserImpl(new File(descriptorLocation), null);
    }

    //    @Test
    public void applicationDescriptorParse() throws Exception {

        String descriptorLocation = getClass().getResource("application_ProActive_MS_basic.xml").getPath();

        System.out.println("parsing " + descriptorLocation);
        GCMApplicationParserImpl parser = new GCMApplicationParserImpl(new File(descriptorLocation), null);

        parser.getCommandBuilder();
        parser.getVirtualNodes();
        parser.getNodeProviders();

    }

}

@@ -1291,16 +1291,48 @@
 .File;%0A%0A
+import junit.framework.Assert;%0A%0A
 import o
@@ -1346,16 +1346,16 @@
 t.Test;%0A
-
 import o
@@ -1587,16 +1587,49 @@
 erImpl;%0A
+import org.xml.sax.SAXException;%0A
 %0A%0Apublic
@@ -1664,16 +1664,17 @@
 rsing %7B%0A
+%0A
     //  
@@ -2115,32 +2115,89 @@
 l%22).getPath();%0A%0A
+        boolean gotException = false;%0A%0A        try %7B%0A    
         GCMDeplo
@@ -2286,16 +2286,185 @@
  null);%0A
+        %7D catch (SAXException e) %7B%0A            gotException = e.getException().getMessage().contains(%22old format%22);%0A        %7D%0A%0A        Assert.assertTrue(gotException);%0A%0A
     %7D%0A%0A 

fix test