Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 40260 Details for
Bug 139139
Compilation error in the generated diagram code if DiagramLabel points to the deep Label
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Additional test that demonstrates related problem with figures back-referencing diagram elements with spaced names
patch_139139_graphdef_failing_test.txt (text/plain), 3.40 KB, created by
Michael Golubev
on 2006-05-03 12:52:08 EDT
(
hide
)
Description:
Additional test that demonstrates related problem with figures back-referencing diagram elements with spaced names
Filename:
MIME Type:
Creator:
Michael Golubev
Created:
2006-05-03 12:52:08 EDT
Size:
3.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.tests >Index: src/org/eclipse/gmf/tests/gen/HandcodedGraphDefTest.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests/src/org/eclipse/gmf/tests/gen/HandcodedGraphDefTest.java,v >retrieving revision 1.1 >diff -u -r1.1 HandcodedGraphDefTest.java >--- src/org/eclipse/gmf/tests/gen/HandcodedGraphDefTest.java 24 Feb 2006 13:52:06 -0000 1.1 >+++ src/org/eclipse/gmf/tests/gen/HandcodedGraphDefTest.java 3 May 2006 16:49:41 -0000 >@@ -11,6 +11,14 @@ > */ > package org.eclipse.gmf.tests.gen; > >+import java.io.IOException; >+ >+import org.eclipse.emf.common.util.TreeIterator; >+import org.eclipse.emf.common.util.URI; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.resource.Resource; >+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; >+import org.eclipse.gmf.gmfgraph.Canvas; > import org.eclipse.gmf.gmfgraph.DiagramElement; > import org.eclipse.gmf.gmfgraph.DiagramLabel; > import org.eclipse.gmf.gmfgraph.Figure; >@@ -18,7 +26,9 @@ > import org.eclipse.gmf.gmfgraph.FigureMarker; > import org.eclipse.gmf.gmfgraph.FigureRef; > import org.eclipse.gmf.gmfgraph.GMFGraphFactory; >+import org.eclipse.gmf.gmfgraph.Identity; > import org.eclipse.gmf.gmfgraph.Label; >+import org.eclipse.gmf.gmfgraph.Node; > import org.eclipse.gmf.gmfgraph.Rectangle; > > import junit.framework.TestCase; >@@ -78,9 +88,63 @@ > assertParentOfFirstChild(figWithRef); > } > >+ public void off_fails_now_testSaveWithSpace() throws IOException{ >+ final String NAME_WITH_SPACE = "Name With Space"; >+ >+ Canvas canvas = GMFGraphFactory.eINSTANCE.createCanvas(); >+ canvas.setName("Canvas"); >+ >+ FigureGallery gallery = GMFGraphFactory.eINSTANCE.createFigureGallery(); >+ gallery.setName("Gallery"); >+ canvas.getFigures().add(gallery); >+ >+ Figure f = GMFGraphFactory.eINSTANCE.createRectangle(); >+ f.setName("Rect"); >+ gallery.getFigures().add(f); >+ >+ Node node = GMFGraphFactory.eINSTANCE.createNode(); >+ node.setName(NAME_WITH_SPACE); >+ node.setFigure(f); >+ canvas.getNodes().add(node); >+ >+ URI uri = URI.createFileURI("C:\\_sample.gmfgraph"); >+ Resource r = new ResourceSetImpl().createResource(uri); >+ r.getContents().add(canvas); >+ r.save(null); >+ >+ Resource copy = new ResourceSetImpl().getResource(uri, true); >+ assertEquals(1, copy.getContents().size()); >+ Canvas canvasCopy = (Canvas)copy.getContents().get(0); >+ >+ Rectangle fCopy = (Rectangle)searchById(canvasCopy, "Rect"); >+ assertNotNull(fCopy); >+ >+ Node nodeCopy = (Node)searchById(canvas, NAME_WITH_SPACE); >+ assertNotNull(nodeCopy); >+ >+ assertSame(fCopy, nodeCopy.getFigure()); >+ assertTrue(fCopy.getReferencingElements().contains(nodeCopy)); >+ >+ } >+ >+ private static Identity searchById(EObject root, String id){ >+ for (TreeIterator contents = root.eAllContents(); contents.hasNext();){ >+ EObject next = (EObject) contents.next(); >+ if (next instanceof Identity){ >+ Identity identity = (Identity)next; >+ if (id.equals(identity.getName())){ >+ return identity; >+ } >+ } >+ } >+ return null; >+ } >+ > private static void assertParentOfFirstChild(Figure figure) { > final FigureMarker child = (FigureMarker) figure.getChildren().get(0); > assertNotNull(child.getParent()); > assertEquals(figure, child.getParent()); > } >+ >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139139
:
39759
|
39763
|
40174
|
40260
|
40261