/******************************************************************************* | |
* <copyright> | |
* | |
* Copyright (c) 2013, 2013 SAP AG. | |
* 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: | |
* SAP AG - initial API, implementation and documentation | |
* | |
* </copyright> | |
* | |
*******************************************************************************/ | |
package org.eclipse.fmc.meta; | |
import org.eclipse.core.resources.IFile; | |
import org.eclipse.emf.common.util.URI; | |
import org.eclipse.emf.transaction.RecordingCommand; | |
import org.eclipse.fmc.ShapeTest; | |
import org.eclipse.fmc.blockdiagram.editor.util.DiagramFactory; | |
import org.junit.After; | |
import org.junit.Test; | |
/** | |
* Testing all shape types for meta editor | |
* | |
* @author Benjamin Schmeling | |
* | |
*/ | |
public class MetaShapeTest extends ShapeTest { | |
@Override | |
protected void createFMCFile(IFile file) { | |
DiagramFactory.createDefaultBlockdiagramMetaFile(URI.createPlatformResourceURI( | |
file.getFullPath().toString(), true), 1000, 1000, 10); | |
} | |
@Test | |
@Override | |
public void testAgent() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testAgent(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testAgentL() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testAgentL(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testAgentU() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testAgentU(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testStorage() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testStorage(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testStorageL() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testStorageL(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testStorageU() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testStorageU(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testHumanAgent() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testHumanAgent(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testStructureVariance() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testStructureVariance(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testCommonFeatureArea() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testCommonFeatureArea(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testBrace() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testBrace(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testAreaBorder() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testAreaBorder(); | |
} | |
}); | |
} | |
@Test | |
@Override | |
public void testDots() { | |
getEditingDomain().getCommandStack().execute( | |
new RecordingCommand(getEditingDomain()) { | |
@Override | |
protected void doExecute() { | |
MetaShapeTest.super.testDots(); | |
} | |
}); | |
} | |
@Override | |
@After | |
public void tearDown() { | |
MetaTestUtil.assertMetaFileExists(getProject(), BLOCKDIAG_FILENAME); | |
super.tearDown(); | |
} | |
} |