blob: 4e7858470abcb1785a6c7625f7bdbc1957b08691 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/*
* Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.emf.cdo.tests.bugzilla;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
import org.eclipse.emf.cdo.tests.model1.Product1;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
/**
* @author Stefan Winkler
*/
public class Bugzilla_351393_Test extends AbstractCDOTest
{
public void testExtRef() throws Exception
{
skipStoreWithoutExternalReferences();
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put("test", new XMIResourceFactoryImpl());
URI uri = URI.createURI("test:///tmp/file.xmi?" + "12345678901234567890" + // 41
"12345678901234567890" + // 61
"12345678901234567890" + // 81
"12345678901234567890" + // 101
"12345678901234567890" + // 121
"12345678901234567890" + // 141
"12345678901234567890" + // 161
"12345678901234567890" + // 181
"12345678901234567890" + // 201
"12345678901234567890" + // 221
"12345678901234567890" + // 241
"12345678901234567890" + // 261
"12345678901234567890" + // 281
"12345678901234567890" + // 301
"12345678901234567890"); // 321 characters (> 256)
Resource extRes = resourceSet.createResource(uri);
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.createResource(getResourcePath("test1"));
resourceSet.getResource(resource.getURI(), false);
OrderDetail od1 = getModel1Factory().createOrderDetail();
Product1 p1 = getModel1Factory().createProduct1();
p1.getOrderDetails().add(od1);
resource.getContents().add(p1);
extRes.getContents().add(od1);
transaction.commit();
}
}
|