/**
 * (C) Copyright 2015 Chiral Behaviors, LLC. All Rights Reserved
 *
 
 * This file is part of Ultrastructure.
 *
 *  Ultrastructure is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  ULtrastructure 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 Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with Ultrastructure.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.chiralbehaviors.CoRE.workspace.dsl;

import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.BaseErrorListener;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Recognizer;
import org.junit.Test;

/**
 * @author hhildebrand
 *
 */
public class TestParse {
    @Test
    public void testExampleWorkspace() throws Exception {
        WorkspaceLexer l = new WorkspaceLexer(new ANTLRInputStream(getClass().getResourceAsStream("/thing.wsp")));
        WorkspaceParser p = new WorkspaceParser(new CommonTokenStream(l));
        p.addErrorListener(new BaseErrorListener() {
            @Override
            public void syntaxError(Recognizer<?, ?> recognizer,
                                    Object offendingSymbol, int line,
                                    int charPositionInLine, String msg,
                                    RecognitionException e) {
                throw new IllegalStateException("failed to parse at line "
                                                + line + " due to " + msg, e);
            }
        });
        p.workspace();
    }

}

@@ -1100,16 +1100,91 @@
 .Test;%0A%0A
+import com.chiralbehaviors.CoRE.meta.workspace.dsl.WorkspacePresentation;%0A%0A
 /**%0A * @
@@ -1268,23 +1268,12 @@
 test
-ExampleWorkspac
+Pars
 e() 
@@ -2005,16 +2005,16 @@
     %7D);%0A
-
         
@@ -2035,10 +2035,1610 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testPresentation() throws Exception %7B%0A        WorkspacePresentation presentation = new WorkspacePresentation(getClass().getResourceAsStream(%22/thing.wsp%22));%0A        presentation.getAgencies();%0A        presentation.getAgencyFacets();%0A        presentation.getAgencyNetworks();%0A        presentation.getAttributes();%0A        presentation.getAttributeFacets();%0A        presentation.getAttributeNetworks();%0A        presentation.getChildSequencings();%0A        presentation.getImports();%0A        presentation.getInferences();%0A        presentation.getIntervalFacets();%0A        presentation.getIntervalNetworks();%0A        presentation.getIntervals();%0A        presentation.getLocationFacets();%0A        presentation.getLocationNetworks();%0A        presentation.getLocations();%0A        presentation.getMetaProtocols();%0A        presentation.getParentSequencings();%0A        presentation.getProductFacets();%0A        presentation.getProductNetworks();%0A        presentation.getProducts();%0A        presentation.getProtocols();%0A        presentation.getRelationshipFacets();%0A        presentation.getRelationshipNetworks();%0A        presentation.getRelationships();%0A        presentation.getSelfSequencings();%0A        presentation.getSiblingSequencings();%0A        presentation.getStatusCodeFacets();%0A        presentation.getStatusCodeNetworks();%0A        presentation.getStatusCodes();%0A        presentation.getStatusCodeSequencings();%0A        presentation.getUnitFacets();%0A        presentation.getUnitNetworks();%0A        presentation.getUnits();%0A        presentation.getWorkspaceDefinition();%0A%0A    %7D%0A%0A
 %7D%0A

add test for presentation for code coverage.