You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/09/07 10:19:04 UTC

svn commit: r573499 - in /incubator/uima/sandbox/trunk/CasEditor: META-INF/ src/main/java/org/apache/uima/caseditor/ src/main/java/org/apache/uima/caseditor/editor/editview/ src/plugintest/java/org/apache/uima/caseditor/core/test/

Author: twgoetz
Date: Fri Sep  7 01:19:03 2007
New Revision: 573499

URL: http://svn.apache.org/viewvc?rev=573499&view=rev
Log:
Jira UIMA-561, UIMA-566: apply UIMA-561-2.patch and UIMA-566.patch.

https://issues.apache.org/jira/browse/UIMA-561
https://issues.apache.org/jira/browse/UIMA-566

Modified:
    incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF
    incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java
    incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java
    incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml
    incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java

Modified: incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF (original)
+++ incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF Fri Sep  7 01:19:03 2007
@@ -1,34 +1,45 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: UIMA CAS Editor
-Bundle-SymbolicName: org.apache.uima.caseditor;singleton:=true
-Bundle-Version: 2.2.0.incubating-SNAPSHOOT
-Bundle-ClassPath: ./target/classes
-Bundle-Activator: org.apache.uima.caseditor.CasEditorPlugin
-Bundle-Vendor: The Apache Software Foundation
-Require-Bundle: org.eclipse.core.runtime,org.eclipse.core.resources,org.apache.uima.runtime,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui,org.eclipse.ui.ide,org.eclipse.ui.workbench.texteditor,org.eclipse.pde.runtime,org.eclipse.jface.text,org.eclipse.core.filesystem,com.ibm.icu
-Eclipse-RegisterBuddy: org.apache.uima.runtime
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Eclipse-LazyStart: true
-Export-Package: org.apache.uima.caseditor,
- org.apache.uima.caseditor.core,
- org.apache.uima.caseditor.core.model,
- org.apache.uima.caseditor.core.model.delta,
- org.apache.uima.caseditor.core.model.dotcorpus,
- org.apache.uima.caseditor.core.uima,
- org.apache.uima.caseditor.core.util,
- org.apache.uima.caseditor.editor,
- org.apache.uima.caseditor.editor.action,
- org.apache.uima.caseditor.editor.annotation,
- org.apache.uima.caseditor.editor.context,
- org.apache.uima.caseditor.editor.editview,
- org.apache.uima.caseditor.editor.editview.validator,
- org.apache.uima.caseditor.editor.fsview,
- org.apache.uima.caseditor.editor.outline,
- org.apache.uima.caseditor.ui,
- org.apache.uima.caseditor.ui.action,
- org.apache.uima.caseditor.ui.corpusview,
- org.apache.uima.caseditor.ui.model,
- org.apache.uima.caseditor.ui.property,
- org.apache.uima.caseditor.ui.wizards,
- org.apache.uima.caseditor.uima
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: UIMA CAS Editor
+Bundle-SymbolicName: org.apache.uima.caseditor;singleton:=true
+Bundle-Version: 2.2.0.incubating-SNAPSHOOT
+Bundle-ClassPath: ./target/classes
+Bundle-Activator: org.apache.uima.caseditor.CasEditorPlugin
+Bundle-Vendor: The Apache Software Foundation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.apache.uima.runtime,
+ org.eclipse.ui.views.properties.tabbed,
+ org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.pde.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.core.filesystem,
+ com.ibm.icu,
+ org.junit4
+Eclipse-RegisterBuddy: org.apache.uima.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-LazyStart: true
+Export-Package: org.apache.uima.caseditor,
+ org.apache.uima.caseditor.core,
+ org.apache.uima.caseditor.core.model,
+ org.apache.uima.caseditor.core.model.delta,
+ org.apache.uima.caseditor.core.model.dotcorpus,
+ org.apache.uima.caseditor.core.uima,
+ org.apache.uima.caseditor.core.util,
+ org.apache.uima.caseditor.editor,
+ org.apache.uima.caseditor.editor.action,
+ org.apache.uima.caseditor.editor.annotation,
+ org.apache.uima.caseditor.editor.context,
+ org.apache.uima.caseditor.editor.editview,
+ org.apache.uima.caseditor.editor.editview.validator,
+ org.apache.uima.caseditor.editor.fsview,
+ org.apache.uima.caseditor.editor.outline,
+ org.apache.uima.caseditor.ui,
+ org.apache.uima.caseditor.ui.action,
+ org.apache.uima.caseditor.ui.corpusview,
+ org.apache.uima.caseditor.ui.model,
+ org.apache.uima.caseditor.ui.property,
+ org.apache.uima.caseditor.ui.wizards,
+ org.apache.uima.caseditor.uima

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,7 +19,8 @@
 
 package org.apache.uima.caseditor;
 
-import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
@@ -28,10 +29,11 @@
 /**
  * This class controls all aspects of the application's execution
  */
-public class Application implements IPlatformRunnable {
+public class Application implements IApplication {
 
-  public Object run(Object args) throws Exception {
+  private static final String PROP_EXIT_CODE = "eclipse.exitcode";
 
+  public Object start(IApplicationContext context) throws Exception {
     Display display = PlatformUI.createDisplay();
 
     Shell shell = new Shell(display, SWT.ON_TOP);
@@ -49,13 +51,19 @@
 
     try {
       int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
-      if (returnCode == PlatformUI.RETURN_RESTART) {
-        return IPlatformRunnable.EXIT_RESTART;
+      if (returnCode != PlatformUI.RETURN_RESTART) {
+        return EXIT_OK;
       }
-      return IPlatformRunnable.EXIT_OK;
+      
+      // the OpenWorkspaceAction sets the PROP_EXIT_CODE before the restart
+      return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ? EXIT_RELAUNCH
+              : EXIT_RESTART;
     } finally {
       display.dispose();
     }
   }
 
-}
+  public void stop() {
+  }
+
+}
\ No newline at end of file

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -36,6 +36,7 @@
 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
 import org.eclipse.ui.application.ActionBarAdvisor;
 import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.internal.ide.actions.OpenWorkspaceAction;
 
 public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
 
@@ -43,7 +44,7 @@
 
   private IWorkbenchWindow window;
 
-//  private OpenWorkspaceAction openWorkspaceAction;
+  private OpenWorkspaceAction openWorkspaceAction;
 
   public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
     super(configurer);
@@ -54,29 +55,29 @@
 
     this.window = window;
     ActionFactory actionsToCreate[] = new ActionFactory[] { ActionFactory.NEW_WIZARD_DROP_DOWN,
-        ActionFactory.NEW, 
-        ActionFactory.IMPORT, 
-        ActionFactory.EXPORT, 
+        ActionFactory.NEW,
+        ActionFactory.IMPORT,
+        ActionFactory.EXPORT,
         ActionFactory.SAVE,
-        ActionFactory.SAVE_ALL, 
-        ActionFactory.CLOSE, 
-        ActionFactory.CLOSE_ALL, 
+        ActionFactory.SAVE_ALL,
+        ActionFactory.CLOSE,
+        ActionFactory.CLOSE_ALL,
         ActionFactory.CUT,
-        ActionFactory.COPY, 
-        ActionFactory.PASTE, 
-        ActionFactory.SELECT_ALL, 
+        ActionFactory.COPY,
+        ActionFactory.PASTE,
+        ActionFactory.SELECT_ALL,
         ActionFactory.DELETE,
-        ActionFactory.QUIT, 
-        ActionFactory.ABOUT, 
-        ActionFactory.REVERT, 
+        ActionFactory.QUIT,
+        ActionFactory.ABOUT,
+        ActionFactory.REVERT,
         ActionFactory.PROPERTIES,
-        ActionFactory.FORWARD_HISTORY, 
-        ActionFactory.BACKWARD_HISTORY, 
+        ActionFactory.FORWARD_HISTORY,
+        ActionFactory.BACKWARD_HISTORY,
         ActionFactory.LOCK_TOOL_BAR,
-        ActionFactory.RESET_PERSPECTIVE, 
-        ActionFactory.PREFERENCES, 
+        ActionFactory.RESET_PERSPECTIVE,
+        ActionFactory.PREFERENCES,
         ActionFactory.OPEN_NEW_WINDOW,
-        ActionFactory.NEW_EDITOR, 
+        ActionFactory.NEW_EDITOR,
 //        ActionFactory.EDIT_ACTION_SETS,
         ActionFactory.MAXIMIZE,
         ActionFactory.MINIMIZE,
@@ -96,8 +97,8 @@
       actions.put(factory, action);
       register(action);
     }
-    
-//    openWorkspaceAction = new OpenWorkspaceAction(window);
+
+    openWorkspaceAction = new OpenWorkspaceAction(window);
   }
 
   @Override
@@ -118,7 +119,7 @@
     fileMenu.add(actions.get(ActionFactory.REVERT));
     fileMenu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
     fileMenu.add(new Separator());
-//    fileMenu.add(openWorkspaceAction);
+    fileMenu.add(openWorkspaceAction);
     fileMenu.add(new Separator());
     fileMenu.add(actions.get(ActionFactory.IMPORT));
     fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
@@ -167,9 +168,9 @@
     subMenu.add(actions.get(ActionFactory.NEXT_PART));
     subMenu.add(actions.get(ActionFactory.PREVIOUS_PART));
     windowMenu.add(subMenu);
-    
+
     windowMenu.add(new Separator());
-    
+
     windowMenu.add(actions.get(ActionFactory.PREFERENCES));
     windowMenu.add(ContributionItemFactory.OPEN_WINDOWS.create(window));
     menuBar.add(windowMenu);

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/editview/FeatureStructureContentProvider.java Fri Sep  7 01:19:03 2007
@@ -48,6 +48,11 @@
   private Viewer viewer;
 
   FeatureStructureContentProvider(AnnotationDocument document) {
+
+    if (document == null) {
+      throw new IllegalArgumentException("document parameter must not be null!");
+    }
+
     mDocument = document;
   }
 

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann Fri Sep  7 01:19:03 2007
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.    
+-->
+
 <taeDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
 <frameworkImplementation>com.ibm.uima.java</frameworkImplementation>
 <primitive>true</primitive>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con Fri Sep  7 01:19:03 2007
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.    
+-->
+
 <casConsumerDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
 <frameworkImplementation>com.ibm.uima.java</frameworkImplementation>
 <implementationName>none</implementationName>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -27,6 +27,7 @@
 import org.apache.uima.caseditor.core.model.AnnotatorElement;
 import org.apache.uima.caseditor.core.model.ConsumerElement;
 import org.apache.uima.caseditor.core.model.DocumentElement;
+import org.apache.uima.caseditor.core.model.TypesystemElement;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IResource;
@@ -35,6 +36,8 @@
 import org.junit.Test;
 
 /**
+ * This test produces invalid model elements and tests the nlp model for the
+ * specified behavior.
  */
 public class DefectiveNlpModelTest {
   private TestProject mProject;
@@ -89,7 +92,7 @@
     }
   }
 
-  @Test
+  @Test(expected=CoreException.class)
   public void testInvalidDocument() throws CoreException {
     mProject.createProject();
     mProject.createProjectContent();
@@ -97,8 +100,9 @@
 
     mProject.getDocument().setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
 
-    assertTrue(((DocumentElement) CasEditorPlugin.getNlpModel().findMember(mProject.getDocument()))
-            .getDocument().getCAS() == null);
+    // throws a core exception since the document cannot be parsed
+    ((DocumentElement) CasEditorPlugin.getNlpModel().findMember(mProject.getDocument()))
+            .getDocument();
   }
 
   @Test
@@ -134,7 +138,8 @@
 
     mProject.getTypesystem().setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
 
-    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getTypesystem()) == null);
+    assertTrue(((TypesystemElement) CasEditorPlugin.getNlpModel().findMember(
+            mProject.getTypesystem())).getTypeSystem() == null);
   }
 
   @Test
@@ -160,4 +165,4 @@
     // check that model and project creation did not failed
     assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getProject()) != null);
   }
-}
+}
\ No newline at end of file

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,6 +25,7 @@
 import java.util.Set;
 
 import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.core.model.DocumentElement;
 import org.apache.uima.caseditor.core.model.INlpElement;
 import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
 import org.apache.uima.caseditor.core.model.delta.INlpModelChangeListener;
@@ -54,9 +55,21 @@
     WorkspaceUtil.clearWorkspace();
   }
 
+  @Test
+  public void testDocumentCasCreation() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    DocumentElement document = ((DocumentElement) CasEditorPlugin.getNlpModel().findMember(
+            mProject.getDocument()));
+
+    assertTrue(document.getDocument().getCAS().getDocumentText().length() > 0);
+  }
+
   /**
    * Creates the nlp project from an existing project structure.
-   * 
+   *
    * @throws CoreException
    */
   @Test
@@ -70,8 +83,8 @@
   }
 
   /**
-   * Adds the dotcorpus to an empty existing nlp project.
-   * 
+   * Adds the .corpus to an empty existing nlp project.
+   *
    * @throws CoreException
    */
   @Test
@@ -91,9 +104,9 @@
 
   /**
    * This creates an nlp project. Then it creates the dot corpus and the NlpModel.
-   * 
+   *
    * After that all resources are added to the project.
-   * 
+   *
    * @throws CoreException
    */
   @Test
@@ -111,11 +124,12 @@
   }
 
   /**
-   * 1. create project with nlp nature 2. then create the dot corpus file 3. add all folders and
-   * files
-   * 
+   * 1. create project with nlp nature
+   * 2. then create the dot corpus file
+   * 3. add all folders and files
+   *
    * Note: the listener must be removed after the test
-   * 
+   *
    * @throws CoreException
    */
   @Test
@@ -157,7 +171,7 @@
 
   /**
    * Tests if a project can be removed.
-   * 
+   *
    * @throws CoreException
    */
   @Test
@@ -185,7 +199,7 @@
 
   /**
    * Note: the listener must be removed after the test.
-   * 
+   *
    * @throws CoreException
    */
   @Test

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -45,9 +45,7 @@
 
   private IFolder mCorpusFolder;
 
-  private IFolder mSourceFolder;
-
-  private IFolder mConfiguration;
+  private IFolder mProcessorFolder;
 
   private IFile mTypesystem;
 
@@ -66,15 +64,14 @@
 
     mCorpusFolder = mProject.getFolder("corpus");
 
-    mSourceFolder = mProject.getFolder("UimaSourceFolder");
-    mConfiguration = mProject.getFolder("UimaSourceFolder/Config");
+    mProcessorFolder = mProject.getFolder("UimaSourceFolder");
 
     mTypesystem = mProject.getFile("Typesystem.xml");
     mDocument = mCorpusFolder.getFile("Document.xcas");
-    mAnnotatorFile = mConfiguration.getFile("Annotator.ann");
-    mConsumerFile = mConfiguration.getFile("Consumer.con");
+    mAnnotatorFile = mProcessorFolder.getFile("Annotator.ann");
+    mConsumerFile = mProcessorFolder.getFile("Consumer.con");
 
-    mContentResources = new IResource[] { mCorpusFolder, mSourceFolder, mConfiguration, mDocument,
+    mContentResources = new IResource[] { mCorpusFolder, mProcessorFolder, mDocument,
         mAnnotatorFile, mConsumerFile };
   }
 
@@ -90,10 +87,6 @@
     return mAnnotatorFile;
   }
 
-  IFolder getConfiguration() {
-    return mConfiguration;
-  }
-
   IFile getConsumerFile() {
     return mConsumerFile;
   }
@@ -106,8 +99,8 @@
     return mDocument;
   }
 
-  IFolder getSourceFolder() {
-    return mSourceFolder;
+  IFolder getProcessorFolder() {
+    return mProcessorFolder;
   }
 
   IFile getTypesystem() {
@@ -119,8 +112,8 @@
   }
 
   /**
-   * Creates an emtpy project with nlp nature.
-   * 
+   * Creates an empty project with nlp nature.
+   *
    * @throws CoreException
    */
   void createProject() throws CoreException {
@@ -133,7 +126,7 @@
 
   /**
    * Creates the Nlp Project content.
-   * 
+   *
    * @throws CoreException
    */
   void createProjectContent() throws CoreException {
@@ -141,10 +134,7 @@
     mCorpusFolder.create(true, true, null);
 
     // create source folder
-    mSourceFolder.create(true, true, null);
-
-    // create config folder
-    mConfiguration.create(true, true, null);
+    mProcessorFolder.create(true, true, null);
 
     // create a typesystem file here ...
     mTypesystem.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Typesystem.xml"),
@@ -154,7 +144,7 @@
     mAnnotatorFile.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Annotator.ann"),
             true, null);
 
-    // careate consumer.con
+    // create consumer.con
     mConsumerFile.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Consumer.con"),
             true, null);
 
@@ -164,14 +154,14 @@
   }
 
   /**
-   * 
+   *
    * @throws CoreException
    */
   void createDotCorpus() throws CoreException {
     DotCorpus dotCorpus = new DotCorpus();
 
     dotCorpus.addCorpusFolder(mCorpusFolder.getName());
-    dotCorpus.addCasProcessorFolder(mSourceFolder.getName());
+    dotCorpus.addCasProcessorFolder(mProcessorFolder.getName());
     dotCorpus.setTypeSystemFilename(mTypesystem.getName());
 
     ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -191,8 +181,7 @@
     mCorpusFolder.delete(true, null);
     mAnnotatorFile.delete(true, null);
     mConsumerFile.delete(true, null);
-    mConfiguration.delete(true, null);
-    mSourceFolder.delete(true, null);
+    mProcessorFolder.delete(true, null);
   }
 
   void validateNlpProject() {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml Fri Sep  7 01:19:03 2007
@@ -1,4 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.    
+-->
+
 <typeSystemDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
 	<name>TutorialTypeSystemTutorialTypeSystem</name>
 	<description>Sample project typesystem</description>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java?rev=573499&r1=573498&r2=573499&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java Fri Sep  7 01:19:03 2007
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,9 +30,9 @@
 class WorkspaceUtil {
   /**
    * Deletes all projects inside the workspace.
-   * 
+   *
    * Will be run after every test.
-   * 
+   *
    * @throws CoreException
    *           is thrown if deletion goes wrong
    */