diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java index db94342e88..10fc347565 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_336382_Test.java @@ -1,60 +1,60 @@ -/*
- * 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:
- * Stefan Winkler - initial API and implementation
- */
-package org.eclipse.emf.cdo.tests.bugzilla;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-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.config.IModelConfig;
-import org.eclipse.emf.cdo.tests.config.IRepositoryConfig;
-import org.eclipse.emf.cdo.tests.model1.Company;
-import org.eclipse.emf.cdo.transaction.CDOMerger;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-
-import org.eclipse.emf.spi.cdo.DefaultCDOMerger;
-
-/**
- * @author Stefan Winkler
- */
-public class Bugzilla_336382_Test extends AbstractCDOTest
-{
- @Requires(IRepositoryConfig.CAPABILITY_BRANCHING)
- @Skips(IModelConfig.CAPABILITY_LEGACY)
- public void testPromoteToBranch() throws Exception
- {
- CDOSession session = openSession();
-
- CDOBranch mainBranch = session.getBranchManager().getMainBranch();
- long timestamp = mainBranch.getBase().getTimeStamp();
- CDOBranch sourceBranch = mainBranch.createBranch("branch1", timestamp);
-
- {
- CDOTransaction tx = session.openTransaction(sourceBranch);
- CDOResource res = tx.createResource(getResourcePath("/test"));
-
- Company company = getModel1Factory().createCompany();
- company.setName("Foo");
- company.setStreet("Bar");
- company.setCity("somewhere");
- res.getContents().add(company);
- tx.commit();
- }
-
- CDOBranch targetBranch = mainBranch.createBranch("branch2", timestamp);
-
- CDOTransaction transaction = session.openTransaction(targetBranch);
-
- CDOMerger merger = new DefaultCDOMerger.PerFeature.ManyValued();
- transaction.merge(sourceBranch.getHead(), merger);
- transaction.commit();
- }
-}
+/* + * 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: + * Stefan Winkler - initial API and implementation + */ +package org.eclipse.emf.cdo.tests.bugzilla; + +import org.eclipse.emf.cdo.common.branch.CDOBranch; +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.config.IModelConfig; +import org.eclipse.emf.cdo.tests.config.IRepositoryConfig; +import org.eclipse.emf.cdo.tests.model1.Company; +import org.eclipse.emf.cdo.transaction.CDOMerger; +import org.eclipse.emf.cdo.transaction.CDOTransaction; + +import org.eclipse.emf.spi.cdo.DefaultCDOMerger; + +/** + * @author Stefan Winkler + */ +public class Bugzilla_336382_Test extends AbstractCDOTest +{ + @Requires(IRepositoryConfig.CAPABILITY_BRANCHING) + @Skips(IModelConfig.CAPABILITY_LEGACY) + public void testPromoteToBranch() throws Exception + { + CDOSession session = openSession(); + + CDOBranch mainBranch = session.getBranchManager().getMainBranch(); + long timestamp = mainBranch.getBase().getTimeStamp(); + CDOBranch sourceBranch = mainBranch.createBranch("branch1", timestamp); + + { + CDOTransaction tx = session.openTransaction(sourceBranch); + CDOResource res = tx.createResource(getResourcePath("/test")); + + Company company = getModel1Factory().createCompany(); + company.setName("Foo"); + company.setStreet("Bar"); + company.setCity("somewhere"); + res.getContents().add(company); + tx.commit(); + } + + CDOBranch targetBranch = mainBranch.createBranch("branch2", timestamp); + + CDOTransaction transaction = session.openTransaction(targetBranch); + + CDOMerger merger = new DefaultCDOMerger.PerFeature.ManyValued(); + transaction.merge(sourceBranch.getHead(), merger); + transaction.commit(); + } +} |