text:
package com.github.haixing_hu.config.impl;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.junit.Test;

import com.github.haixing_hu.config.impl.DefaultConfig;
import com.github.haixing_hu.config.impl.DefaultProperty;
import com.github.haixing_hu.config.impl.StackConfig;
import com.github.haixing_hu.lang.Type;

import static org.junit.Assert.assertEquals;

import static com.github.haixing_hu.util.junit.Assert.assertCollectionEquals;

/**
 * Unit test for the {@link StackConfig} class.
 *
 * @author Haixing Hu
 */
public class StackConfigTest {

  public void testIsStackEmpty() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();

    assertEquals(true, config.isStackEmpty());
    config.push(config1);
    assertEquals(false, config.isStackEmpty());
  }

  public void testStackSize() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();
    final DefaultConfig config2 = new DefaultConfig();
    final DefaultConfig config3 = new DefaultConfig();

    assertEquals(0, config.stackSize());
    config.push(config1);
    assertEquals(1, config.stackSize());
    config.push(config2);
    assertEquals(2, config.stackSize());
    config.push(config3);
    assertEquals(3, config.stackSize());
  }

  public void testIsEmpty() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();
    final DefaultConfig config2 = new DefaultConfig();
    final DefaultConfig config3 = new DefaultConfig();

    assertEquals(true, config.isEmpty());
    config.push(config1);
    assertEquals(true, config.isEmpty());
    config.push(config2);
    assertEquals(true, config.isEmpty());
    config.push(config3);
    assertEquals(true, config.isEmpty());

    config1.add("prop1", Type.INT);
    assertEquals(false, config.isEmpty());
  }

  public void testSize() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();
    final DefaultConfig config2 = new DefaultConfig();
    final DefaultConfig config3 = new DefaultConfig();

    assertEquals(0, config.size());
    config.push(config1);
    assertEquals(0, config.size());
    config.push(config2);
    assertEquals(0, config.size());
    config.push(config3);
    assertEquals(0, config.size());

    config1.add("prop1", Type.INT);
    assertEquals(1, config.size());

    config1.add("prop2", Type.INT);
    assertEquals(2, config.size());

    config2.add("prop3", Type.INT);
    assertEquals(3, config.size());

    config2.add("prop1", Type.INT);
    assertEquals(3, config.size());

    config3.add("prop3", Type.INT);
    assertEquals(3, config.size());
  }

  @Test
  public void testGetNames() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();
    final DefaultConfig config2 = new DefaultConfig();
    final DefaultConfig config3 = new DefaultConfig();
    final Set<String> names = new HashSet<String>();

    assertEquals(names, config.getNames());
    config.push(config1);
    assertEquals(names, config.getNames());
    config.push(config2);
    assertEquals(names, config.getNames());
    config.push(config3);
    assertEquals(names, config.getNames());

    config1.add("prop1", Type.INT);
    names.add("prop1");
    assertEquals(names, config.getNames());

    config1.add("prop2", Type.INT);
    names.add("prop2");
    assertEquals(names, config.getNames());

    config2.add("prop3", Type.INT);
    names.add("prop3");
    assertEquals(names, config.getNames());

    config2.add("prop1", Type.INT);
    assertEquals(names, config.getNames());

    config3.add("prop3", Type.INT);
    assertEquals(names, config.getNames());
  }

  @Test
  public void testGetProperties() {
    final StackConfig config = new StackConfig();
    final DefaultConfig config1 = new DefaultConfig();
    final DefaultConfig config2 = new DefaultConfig();
    final DefaultConfig config3 = new DefaultConfig();
    final Map<String, DefaultProperty> propertiesMap = new HashMap<String, DefaultProperty>();

    assertCollectionEquals(propertiesMap.values(), config.getProperties());
    config.push(config1);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());
    config.push(config2);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());
    config.push(config3);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());

    final DefaultProperty prop1 = new DefaultProperty("prop1", Type.INT);
    config1.add(prop1);
    propertiesMap.put(prop1.getName(), prop1);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());

    final DefaultProperty prop2 = new DefaultProperty("prop2", Type.STRING);
    config1.add(prop2);
    propertiesMap.put(prop2.getName(), prop2);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());

    final DefaultProperty prop3 = new DefaultProperty("prop3", Type.FLOAT);
    config2.add(prop3);
    propertiesMap.put(prop3.getName(), prop3);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());

    final DefaultProperty prop4 = new DefaultProperty("prop1", Type.FLOAT);
    config2.add(prop4);
    propertiesMap.put(prop4.getName(), prop4);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());

    final DefaultProperty prop5 = new DefaultProperty("prop3", Type.DOUBLE);
    config3.add(prop5);
    propertiesMap.put(prop5.getName(), prop5);
    assertCollectionEquals(propertiesMap.values(), config.getProperties());
  }
}


text:
package org.apache.flink.metrics.util;

import org.apache.flink.metrics.Meter;

/**
 * A dummy {@link Meter} implementation.
 */
public class TestMeter implements Meter {
	private final long countValue;
	private final double rateValue;

	public TestMeter() {
		this(100, 5);
	}

	public TestMeter(long countValue, double rateValue) {
		this.countValue = countValue;
		this.rateValue = rateValue;
	}

	@Override
	public void markEvent() {
	}

	@Override
	public void markEvent(long n) {
	}

	@Override
	public double getRate() {
		return rateValue;
	}

	@Override
	public long getCount() {
		return countValue;
	}
}

redpajama_set_name: RedPajamaGithub


text:
working
=======

work to work


text:
This repository contains a proof-of-concept front-end project for the classic minesweeper game. Functinal, but WIP (lacks real tests, or usage docs).

### Technologies applied
- [AngularJS][^angular]
- [Require][^require]
- [GruntJS][^grunt]
- [Yeoman][^yeoman]
- [Angular Generator][^angulargenerator]
- [Bootstrap][^bootstrap]
- [SASS][^sass]
- [Coffeescript][^coffeescript]
- [Bower][^bower]
- [Travis][^travis]

[^angular]: http://angularjs.org/
[^angulargenerator]: https://github.com/yeoman/generator-angular
[^require]: http://requirejs.org/
[^yeoman]: http://yeoman.io/
[^grunt]: http://gruntjs.com/
[^bootstrap]: http://angularjs.org/
[^sass]: http://sass-lang.com/
[^coffeescript]: http://coffeescript.org/
[^bower]: http://bower.io/
[^bootstrap]: http://getbootstrap.com/
[^sauce]: https://saucelabs.com/
[^travis]: https://travis-ci.org/

## Getting Started

This website requires Node/NPM `~0.10.15`, and Grunt `~0.4.1`

_If you haven't used [Node][^node] or [NPM][^npm] before, be sure to check out the linked documentation._

_If you haven't used [grunt][^grunt] before, be sure to check out the [Getting Started][^gruntstart] guide._

_If you haven't used [bower][^bower] before, be sure to [install][^bowerstart] it._

[^node]: http://nodejs.org
[^npm]: https://npmjs.org/
[^gruntstart]: http://gruntjs.com/
[^bower]: http://bower.io
[^bowerstart]: http://bower.io/#installing-bower

### Dependencies

To install all node based dependencies, run:
```
npm install
bower install
```

## License
Copyright (c) 2014 JFMK, LLC. Released under [MIT License](https://github.com/jfroom/poc-fed-contact/blob/master/LICENSE).


text:
//=====================================================================
//
//File:      $RCSfile: ModelTransactionTestGenerics.java,v $
//Version:   $Revision: 1.6 $
//Modified:  $Date: 2013/05/10 04:30:26 $
//
//(c) Copyright 2006-2014 by Mentor Graphics Corp. All rights reserved.
//
//========================================================================
// Licensed 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.
//========================================================================

package org.xtuml.bp.core.test;

import java.io.File;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.gef.tools.AbstractTool;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.PlatformUI;

import org.xtuml.bp.core.Association_c;
import org.xtuml.bp.core.Attribute_c;
import org.xtuml.bp.core.ClassIdentifier_c;
import org.xtuml.bp.core.EventIgnored_c;
import org.xtuml.bp.core.Function_c;
import org.xtuml.bp.core.ModelClass_c;
import org.xtuml.bp.core.Ooaofooa;
import org.xtuml.bp.core.Package_c;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.ClassQueryInterface_c;
import org.xtuml.bp.core.common.IdAssigner;
import org.xtuml.bp.core.common.TransactionManager;
import org.xtuml.bp.core.ui.BinaryFormalizeOnR_RELAction;
import org.xtuml.bp.core.ui.BinaryFormalizeOnR_RELWizardPage1;
import org.xtuml.bp.core.ui.BinaryFormalizeOnR_RELWizardPage2;
import org.xtuml.bp.core.ui.DeleteAction;
import org.xtuml.bp.core.ui.RemoveFromIdentifierOnO_ATTRWizard;
import org.xtuml.bp.core.ui.Selection;
import org.xtuml.bp.core.ui.marker.DelayedMarkerJob;
import org.xtuml.bp.test.TestUtil;
import org.xtuml.bp.test.common.BaseTest;
import org.xtuml.bp.test.common.CanvasTestUtils;
import org.xtuml.bp.test.common.TransactionListener;
import org.xtuml.bp.test.common.UITestingUtilities;
import org.xtuml.bp.ui.canvas.CanvasTransactionListener;
import org.xtuml.bp.ui.canvas.Cl_c;
import org.xtuml.bp.ui.canvas.GraphicalElement_c;
import org.xtuml.bp.ui.canvas.Ooaofgraphics;
import org.xtuml.bp.ui.canvas.Shape_c;
import org.xtuml.bp.ui.graphics.editor.GraphicalEditor;
import org.xtuml.bp.ui.properties.ClassO_OBJPropertySource;
import org.xtuml.bp.ui.properties.EventIgnoredSM_EIGNPropertySource;
import org.xtuml.bp.ui.properties.ModelPropertySourceProvider;
import org.xtuml.bp.ui.text.activity.ActivityEditor;
import org.xtuml.bp.ui.text.description.DescriptionEditor;

public class ModelTransactionTestGenerics extends BaseTest {

	private static String result_folder;
	private Ooaofooa thisModelRoot;
	private static boolean initialized = false;

	public ModelTransactionTestGenerics(String name) {
		super(null, name); //$NON-NLS-1$
	}

	protected void setUp() throws Exception {
		super.setUp();

		if (!initialized) {
			loadProject("testTransaction");
			initialized = true;
		}
		IdAssigner.setSeedOfAllInstances(getName().hashCode());

		thisModelRoot = modelRoot;
		result_folder = new String(m_workspace_path
				+ "/expected_results/linux/TransactionTest/"); //$NON-NLS-1$
		if(Platform.getOS() != "linux") {
			result_folder = new String(m_workspace_path
					+ "/expected_results/TransactionTest/"); //$NON-NLS-1$
		}

		CanvasTransactionListener.disableReconciler();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
		CanvasTransactionListener.enableReconciler();
	}

	public void testEarlyReturnExitTransactionWizard() {
		ModelClass_c mclass = getModelClassByName("EarlyExitA");

		assertNotNull(mclass);
		Attribute_c attr = Attribute_c.getOneO_ATTROnR102(mclass);
		assertNotNull(attr);

		Selection.getInstance().clear();
		StructuredSelection sel = new StructuredSelection(attr);

		RemoveFromIdentifierOnO_ATTRWizard wizard = new RemoveFromIdentifierOnO_ATTRWizard();
		wizard.v_Identifier = ClassIdentifier_c.getOneO_IDOnR104(mclass);
		wizard.init(PlatformUI.getWorkbench(), sel, m_bp_tree);
		// close the warning dialog
		TestUtil.dismissDialog(500);
		wizard.performFinish();

		// verify that the active transaction is null, meaning that
		// the transaction was cancelled
		assertNull("The transaction was not cancelled after an early exit.",
				getSystemModel().getTransactionManager().getActiveTransaction());
	}

	public void testEarlyReturnExitTransaction() {
		DeleteAction action = new DeleteAction(null);

		ModelClass_c mclass = getModelClassByName("EarlyExitA");

		// assumes that the first attribute for the above class
		// is used to formalize an association
		Attribute_c attribute = Attribute_c.getOneO_ATTROnR102(mclass);

		Selection.getInstance().clear();
		Selection.getInstance().addToSelection(attribute);

		// close the warning dialog
		TestUtil.dismissDialog(500);

		action.run();

		assertNull("Transaction was not cancelled after an early return.",
				getSystemModel().getTransactionManager().getActiveTransaction());

	}

	public void testEarlyExceptionExitTransactionInProperties() {
		// pass a null property value so that an exception will occur
		EventIgnoredSM_EIGNPropertySource source = new EventIgnoredSM_EIGNPropertySource(
				new EventIgnored_c(modelRoot));
		source.setPropertyValue("Descrip", null);

		assertTrue("Log file was not present as expected.", logFileExists());

		assertNull(
				"Transaction was not cancelled after an early exit due to an exception.",
				getSystemModel().getTransactionManager().getActiveTransaction());
	}

	// Testing action/transaction that will result in both ooaofooa and ooaofgraphics changes
	public void testShapeCreationTransactionThruCanvas() throws Exception {
		TransactionListener listener = new TransactionListener();
		getSystemModel().getTransactionManager().addTransactionListener(
				listener);

		Package_c[] pkgs = Package_c.PackageInstances(modelRoot);
		Package_c dom = null;
		for (Package_c pkg : pkgs) {
			if (pkg.getName().equalsIgnoreCase("A Subsystem"))
				dom = pkg;
		}
		CanvasTestUtils.openCanvasEditor(dom);

		SequenceTestsGenerics.resizeMainWindow();

		// Create Subsystem in domain, as this forces
		// execution of ModelSpecification_c.Elementcreated() (the one native operation that
		// generates model change events)
		AbstractTool tool = UITestingUtilities.getTool("Package"); //$NON-NLS-1$
		Ooaofooa.setPersistEnabled(true);
		UITestingUtilities.activateTool(tool);
		CanvasTestUtils.createMouseEvent(100, 100, "MouseDown"); //$NON-NLS-1$
		CanvasTestUtils.createMouseEvent(200, 200, "MouseMove"); //$NON-NLS-1$
		CanvasTestUtils.createMouseEvent(200, 200, "MouseUp"); //$NON-NLS-1$
		UITestingUtilities.deactivateTool(tool);

		listener.WaitForTransactionUnderReview();
		getSystemModel().getTransactionManager().removeTransactionListener(
				listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "shape_creation_transaction_generics.exp"); //$NON-NLS-1$
	}

	public void testPropertyChangeTransaction() throws Exception {
		TransactionListener listener = new TransactionListener();
		getSystemModel().getTransactionManager().addTransactionListener(
				listener);

		TigerNatureTestGenerics tnt = new TigerNatureTestGenerics(
				"Nature test for property transaction"); //$NON-NLS-1$
		ModelClass_c testclass = ModelClass_c.ModelClassInstance(modelRoot,
				new ClassQueryInterface_c() {
					public boolean evaluate(Object candidate) {
						return (((ModelClass_c) candidate).getName()
								.equals("Test Class")); //$NON-NLS-1$
					}
				});
		assertNotNull(testclass);
		ModelPropertySourceProvider mpsp = tnt.getPropertiesSheet();
		ClassO_OBJPropertySource mcps = (ClassO_OBJPropertySource) mpsp
				.getPropertySource(testclass);
		String oldName = testclass.getName();
		mcps.setPropertyValue("Name", "PropertiesTestClass"); //$NON-NLS-1$//$NON-NLS-2$

		listener.WaitForTransactionUnderReview();
		getSystemModel().getTransactionManager().removeTransactionListener(
				listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "property_transaction.exp"); //$NON-NLS-1$

		//Putting the old value back
		testclass.Rename(oldName);
	}

	public void testDescriptorEditorChangeTransaction() throws Exception {
		TransactionListener listener = new TransactionListener();
		getSystemModel().getTransactionManager().addTransactionListener(
				listener);

		ModelClass_c testclass = ModelClass_c.ModelClassInstance(modelRoot);
		TigerNatureTestGenerics.openDescriptionEditor(testclass);
		DescriptionEditor de = (DescriptionEditor) PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
		IDocument doc = de.getDocumentProvider().getDocument(
				de.getEditorInput());
		try {
			doc.replace(0, 0, "Test description"); //$NON-NLS-1$
		} catch (BadLocationException e) {
			fail("Bad Location Exception"); //$NON-NLS-1$
		}
		assertTrue(de.isSaveOnCloseNeeded());
		assertTrue(de.isDirty());
		de.doSave(new NullProgressMonitor());

		listener.WaitForTransactionUnderReview();
		getSystemModel().getTransactionManager().removeTransactionListener(
				listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "editor_transaction.exp"); //$NON-NLS-1$
	}

	public void testActivityEditorChangeTransaction() throws Exception {
		TransactionListener listener = new TransactionListener();
		getSystemModel().getTransactionManager().addTransactionListener(
				listener);

		Function_c function = Function_c.FunctionInstance(modelRoot);
		CanvasTestUtils.openActivityEditor(function);

		ActivityEditor ae = (ActivityEditor) PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
		IDocument doc = ae.getDocumentProvider().getDocument(
				ae.getEditorInput());
		try {
			doc.replace(0, 0, "select any a from instances of D;"); //$NON-NLS-1$
		} catch (BadLocationException e) {
			fail("Bad Location Exception"); //$NON-NLS-1$
		}
		assertTrue(ae.isSaveOnCloseNeeded());
		assertTrue(ae.isDirty());
		ae.doSave(new NullProgressMonitor());

		listener.WaitForTransactionUnderReview();
		getSystemModel().getTransactionManager().removeTransactionListener(
				listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "activity_editor_transaction.exp"); //$NON-NLS-1$
	}

	public void testRenamingTransactionOnExplorer() throws Exception {
		/**
		 * Load Rename test model
		 */
		Ooaofooa.setPersistEnabled(false);
		TransactionListener listener = new TransactionListener();
		RenameTestGenerics renTest = new RenameTestGenerics();

		//super.defaultProjectName = "testTransaction";
		getSystemModel("Default Project").getTransactionManager()
				.addTransactionListener(listener);

		//	renTest.setUp();

		SystemModel_c arr[] = SystemModel_c.SystemModelInstances(Ooaofooa
				.getDefaultInstance());

		renTest.testRenameS_SYS();

		listener.WaitForTransactionUnderReview();
		getSystemModel("Default Project").getTransactionManager()
				.removeTransactionListener(listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "rename_transaction.exp"); //$NON-NLS-1$
	}

	public void testDeleteClassTransactionFromExplorer() throws Exception {
		// disable the problem marker thread
		DelayedMarkerJob.disableProblemMarkerJob();
		TransactionListener listener = new TransactionListener();
		getSystemModel().getTransactionManager().addTransactionListener(
				listener);

		/**
		 * Get class by the name of 'Class E'
		 */
		ModelClass_c obj = ModelClass_c.ModelClassInstance(modelRoot,
				new ClassQueryInterface_c() {
					public boolean evaluate(Object candidate) {
						return ((ModelClass_c) candidate).getName().equals(
								"Class E"); //$NON-NLS-1$
					}
				});

		assertNotNull(obj);

		while(PlatformUI.getWorkbench().getDisplay().readAndDispatch());

		StructuredSelection sel = new StructuredSelection(obj);
		Selection.getInstance().setSelection(sel);
		DeleteAction t2 = new DeleteAction(null);
		t2.run();

		listener.WaitForTransactionUnderReview();
		getSystemModel().getTransactionManager().removeTransactionListener(
				listener);

		while(PlatformUI.getWorkbench().getDisplay().readAndDispatch());

		BaseTest.compareAndOutputResults(result_folder
				+ "delete_transaction_generics.exp"); //$NON-NLS-1$
		DelayedMarkerJob.enableProblemMarkerJob();
	}

	public void testFormalizeSimpleAssociationTransaction() throws Exception {
		modelRoot = thisModelRoot;
		graphicsModelRoot = Ooaofgraphics.getInstance(modelRoot.getId());
		TransactionListener listener = new TransactionListener();
		TransactionManager manager = getSystemModel().getTransactionManager();
		manager.addTransactionListener(listener);

		Package_c uut = Package_c.PackageInstance(modelRoot,
				new ClassQueryInterface_c() {
					public boolean evaluate(Object candidate) {
						Package_c selected = (Package_c) candidate;
						return (selected.getName().equals("test"));
					}
				});
		CanvasTestUtils.openCanvasEditor(uut);
		final Association_c assoc = Association_c.AssociationInstance(
				modelRoot, new ClassQueryInterface_c() {
					public boolean evaluate(Object candidate) {
						Association_c selected = (Association_c) candidate;
						return (selected.getNumb() == 109);
					}
				});
		assertNotNull(assoc);
		GraphicalElement_c ge2 = GraphicalElement_c.GraphicalElementInstance(
				graphicsModelRoot, new ClassQueryInterface_c() {
					public boolean evaluate(Object candidate) {
						GraphicalElement_c selected = (GraphicalElement_c) candidate;
						return (selected.getRepresents() == assoc);
					}
				});
		assertNotNull(ge2);
		Cl_c.Clearselection();
		Selection.getInstance().addToSelection(ge2.getRepresents());
		BinaryFormalizeOnR_RELAction fa = (BinaryFormalizeOnR_RELAction) new BinaryFormalizeOnR_RELAction();
		Action a = new Action() {
		};
		fa.setActivePart(a, PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage().getActivePart());
		IStructuredSelection structuredSelection = (IStructuredSelection) Selection
				.getInstance().getSelection();
		WizardDialog wd = fa.R_REL_BinaryFormalize(structuredSelection);
		BinaryFormalizeOnR_RELWizardPage1 page1 = (BinaryFormalizeOnR_RELWizardPage1) wd
				.getCurrentPage();
		BinaryFormalizeOnR_RELWizardPage2 page2 = (BinaryFormalizeOnR_RELWizardPage2) page1
				.getNextPage();
		String strings[] = page1.Non_formalizerCombo.getItems();
		for (int i = 0; i < strings.length; ++i) {
			if (strings[i].equals("Class C")) {
				page1.Non_formalizerCombo.select(i);
			}
		}
		page1.updateSelectedNon_formalizer();
		page2.onPageEntry();
		page2.IdentifierCombo.select(0);
		page2.updateSelectedIdentifier();
		page1.onPageEntry();
		IWizard w = page1.getWizard();
		w.performFinish();
		wd.close();
		listener.WaitForTransactionUnderReview();
		manager.removeTransactionListener(listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "formalize_transaction.exp"); //$NON-NLS-1$

	}

	public void testMenuItemUserAction() throws Exception {
		AttributeMenuItemTestGenerics attrMenuItemTest = new AttributeMenuItemTestGenerics(
				"Menu Item user action"); //$NON-NLS-1$
		attrMenuItemTest.setReloadModel(true);
		attrMenuItemTest.setUp();
		TransactionListener listener = new TransactionListener();
		TransactionManager manager = getSystemModel("AttributeMenuItemTests")
				.getTransactionManager();
		manager.addTransactionListener(listener);

		// we skip graphical validation here, as it
		// has 1 pixel differences due to GEF and
		// revalidation
		// The graphical validation is not necessary
		// as it has been tested with the original
		// run.
		attrMenuItemTest.fSkipValidate = true;
		attrMenuItemTest.testMoveWithTwoAttributes();
		attrMenuItemTest.testMoveWithThreeAttributes();
		attrMenuItemTest.fSkipValidate = false;

		listener.WaitForTransactionUnderReview();
		manager.removeTransactionListener(listener);

		BaseTest.compareAndOutputResults(result_folder
				+ "menu_item_useraction_transaction.exp"); //$NON-NLS-1$

		attrMenuItemTest.tearDown();
	}

	public void setGenerateResults() throws Exception {
		BaseTest.doCreateResults = true;

		testShapeCreationTransactionThruCanvas();

		setUp();

		testShapeCreationTransactionThruCanvas();

		testPropertyChangeTransaction();

		testDescriptorEditorChangeTransaction();
		testActivityEditorChangeTransaction();

		testRenamingTransactionOnExplorer();
		testDeleteClassTransactionFromExplorer();

		testFormalizeSimpleAssociationTransaction();
		testMenuItemUserAction();

		BaseTest.doCreateResults = false;
	}

	private boolean logFileExists() {
		IPath logfile_path = new Path(m_logfile_path);
		File logfile = logfile_path.toFile();
		if (logfile.exists()) {
			logfile.delete();
			return true;
		} else {
			return false;
		}
	}

	private ModelClass_c getModelClassByName(final String name) {
		ModelClass_c mclass = ModelClass_c.ModelClassInstance(modelRoot,
				new ClassQueryInterface_c() {

					public boolean evaluate(Object candidate) {
						ModelClass_c mclass = (ModelClass_c) candidate;
						if (mclass.getName().equals(name)) {
							return true;
						}
						return false;
					}

				});
		assertNotNull(mclass);

		return mclass;
	}

	private Package_c getPackageByName(final String name) {
		Package_c pkg = Package_c.PackageInstance(modelRoot,
				new ClassQueryInterface_c() {

					public boolean evaluate(Object candidate) {
						Package_c mclass = (Package_c) candidate;
						if (mclass.getName().equals(name)) {
							return true;
						}
						return false;
					}

				});
		assertNotNull(pkg);

		return pkg;
	}

}


text:
require 'dragonfly/image_magick/analysers/image_properties'
require 'dragonfly/image_magick/generators/convert'
require 'dragonfly/image_magick/generators/plain'
require 'dragonfly/image_magick/generators/plasma'
require 'dragonfly/image_magick/generators/text'
require 'dragonfly/image_magick/processors/convert'
require 'dragonfly/image_magick/processors/encode'
require 'dragonfly/image_magick/processors/thumb'

module Dragonfly
  module ImageMagick

    # The ImageMagick Plugin registers an app with generators, analysers and processors.
    # Look at the source code for #call to see exactly how it configures the app.
    class Plugin

      def call(app, opts={})
        # ENV
        app.env[:convert_command] = opts[:convert_command] || 'convert'
        app.env[:identify_command] = opts[:identify_command] || 'identify'

        # Analysers
        app.add_analyser :image_properties, ImageMagick::Analysers::ImageProperties.new
        app.add_analyser :width do |content|
          content.analyse(:image_properties)['width']
        end
        app.add_analyser :height do |content|
          content.analyse(:image_properties)['height']
        end
        app.add_analyser :format do |content|
          content.analyse(:image_properties)['format']
        end
        app.add_analyser :aspect_ratio do |content|
          attrs = content.analyse(:image_properties)
          attrs['width'].to_f / attrs['height']
        end
        app.add_analyser :portrait do |content|
          attrs = content.analyse(:image_properties)
          attrs['width'] <= attrs['height']
        end
        app.add_analyser :landscape do |content|
          !content.analyse(:portrait)
        end
        app.add_analyser :image do |content|
          begin
            content.analyse(:image_properties)['format'] != 'pdf'
          rescue Shell::CommandFailed
            false
          end
        end

        # Aliases
        app.define(:portrait?) { portrait }
        app.define(:landscape?) { landscape }
        app.define(:image?) { image }

        # Generators
        app.add_generator :convert, ImageMagick::Generators::Convert.new
        app.add_generator :plain, ImageMagick::Generators::Plain.new
        app.add_generator :plasma, ImageMagick::Generators::Plasma.new
        app.add_generator :text, ImageMagick::Generators::Text.new

        # Processors
        app.add_processor :convert, Processors::Convert.new
        app.add_processor :encode, Processors::Encode.new
        app.add_processor :thumb, Processors::Thumb.new
        app.add_processor :rotate do |content, amount|
          content.process!(:convert, "-rotate #{amount}")
        end

        # Extra methods
        app.define :identify do |*args|
          cli_args = args.first # because ruby 1.8.7 can't deal with default args in blocks
          shell_eval do |path|
            "#{app.env[:identify_command]} #{cli_args} #{path}"
          end
        end

      end

    end
  end
end


text:
<?php

namespace backend\master\controllers;

use Yii;
use backend\master\models\Pasien;
use backend\master\models\PasienSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\helpers\ArrayHelper;
use backend\master\models\Agama;
use backend\master\models\RekamHeader;
use backend\master\models\DetailRekamMedisSearch;
use backend\master\models\DetailRekamMedis;
use backend\master\models\Obat;
use backend\master\models\TypeObat;
use backend\master\models\RekamdosisObat;
use yii\web\Response;
use yii\helpers\Json;
use yii\widgets\ActiveForm;
use ptrnov\postman4excel\Postman4ExcelBehavior;
use yii\helpers\Url;

/**
 * PasienController implements the CRUD actions for Pasien model.
 */
class PasienController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [

        'export4excel' => [
            'class' => Postman4ExcelBehavior::className(),
            'widgetType'=>'download'
      ],

            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

     /**
       * Before Action Index
       * if not login then logout
         * @author wawan
         * @since 1.0
       */
    public function beforeAction(){

        if (Yii::$app->user->isGuest){
                 Yii::$app->user->logout();
              $this->redirect(array('/site/login'));  //
            }else{
                return true;
        }
    }

     #list array status
    public function aryStatus(){
        $aryStt= [
          ['STATUS' => 1, 'STT_NM' => 'InActive'],
          ['STATUS' => 0, 'STT_NM' => 'Active'],
        ];

        return $valStt = ArrayHelper::map($aryStt, 'STATUS', 'STT_NM');
    }

     #list array jenis kelamin
    public function ary_jenis_kelamin(){
        $ary_kelamin= [
          ['id' => 1, 'jenis' => 'Male'],
          ['id' => 0, 'jenis' => 'Female'],
        ];

        return $valStt = ArrayHelper::map($ary_kelamin, 'id', 'jenis');
    }

    /**
     * Lists all Pasien models.
     * @return mixed
     */
    public function actionIndex()
    {

         $paramCari=Yii::$app->getRequest()->getQueryParam('id');

         if($paramCari != ''){
            $cari=['id'=>$paramCari];
            $url = Url::toRoute(['/master/pasien/view','id'=>$paramCari]);
            $js='$("#modalpasien-view").modal("show")
              .find("#modalContentpasienview").html("<i class=\"fa fa-2x fa-spinner fa-spin\"></i>")
              .load("'.$url.'")';

            $this->getView()->registerJs($js);

          }else{
            $cari='';
          };

        $searchModel = new PasienSearch($cari);
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

         if(Yii::$app->request->post('hasEditable'))
        {
            $ID = \Yii::$app->request->post('editableKey');
            Yii::$app->response->format = Response::FORMAT_JSON;
            $model = Pasien::findOne($ID);

            $out = Json::encode(['output'=>'', 'message'=>'']);

            // fetch the first entry in posted data (there should
            // only be one entry anyway in this array for an
            // editable submission)
            // - $posted is the posted data for Book without any indexes
            // - $post is the converted array for single model validation
            $post = [];
            $posted = current($_POST['Pasien']);
            $post['Pasien'] = $posted;

            // load model like any single model validation
            if ($model->load($post)) {
                // can save model or do something before saving model

                // custom output to return to be displayed as the editable grid cell
                // data. Normally this is empty - whereby whatever value is edited by
                // in the input by user is updated automatically.
                $output = '';

                $msg = '';

                if (isset($posted['nama_pasien'])) {
                    $model->save();
                    $output = $model->nama_pasien;
                }

                if (isset($posted['pekerjaan'])) {
                    $model->save();
                    $output = $model->pekerjaan;
                }
                if (isset($posted['telp'])) {
                    $model->save();
                    $output = $model->telp;
                }
                if (isset($posted['nomer_alias_pasien'])) {

                    $cek_nomer_pasien = Pasien::find()->where(['nomer_alias_pasien'=>$posted['nomer_alias_pasien']])
                                        ->one();

                    if(!$cek_nomer_pasien){
                        $model->save();
                        $output = $model->nomer_alias_pasien;
                    }else{
                        $output = 'sorry duplicate nomer';
                        $msg =  'sorry duplicate nomer';
                    }

                }
                if (isset($posted['agamaNama'])) {
                    $model->id_agama = $posted['agamaNama'];
                    $model->save();
                    $output = $model->agamaNama;
                }

                // specific use case where you need to validate a specific
                // editable column posted when you have more than one
                // EditableColumn in the grid view. We evaluate here a
                // check to see if buy_amount was posted for the Book model
                // similarly you can check if the name attribute was posted as well

                $out = Json::encode(['output'=>$output, 'message'=>$msg]);

            // return ajax json encoded response and exit
            echo $out;

            return;
          }
        }

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'data_agama'=>self::ary_agama(),
            'valStt'=>self::aryStatus()
        ]);
    }

     public function actionValidPasien()
    {
      # code...
        $model = new Pasien();
      if(Yii::$app->request->isAjax && $model->load($_POST))
      {
        Yii::$app->response->format = 'json';
        return ActiveForm::validate($model);
      }
    }

    public function actionValidDosis()
    {
      # code...
        $model = new RekamdosisObat();
      if(Yii::$app->request->isAjax && $model->load($_POST))
      {
        Yii::$app->response->format = 'json';
        return ActiveForm::validate($model);
      }
    }

    public function actionPilihExport(array $idx){

      if(is_array($idx)){
        $array_id = explode(',',$idx[0]);

        foreach ($array_id as  $value) {

              $id[] = $value;
          }
      }

      $data_pasien = Pasien::find()->where(['id'=>$id])->all();

      if(!empty($data_pasien)){
         $data_export = ArrayHelper::toArray($data_pasien, [
            'backend\master\models\Pasien' => [
                'kd_pasien',
                'nama_pasien',
                'pekerjaan',
                'telp',
                'agamaNama',
                'Jeniskelaminx',
                'umur',
                'riwayatx',
                'nomerLama',
            ],
        ]);
      }else{
        return $this->redirect(['index']);
      }

       $excel_data = Postman4ExcelBehavior::excelDataFormat($data_export);
        $excel_title = $excel_data['excel_title'];
        $excel_ceils = $excel_data['excel_ceils'];

    $excel_content = [
       [
        'sheet_name' => 'Data Pasien',
                'sheet_title' =>  ['Kode Pasien','nama pasien','pekerjaan','telp','Nama Agama','Jenis Kelamin','Umur Pasien','Riwaya Alergi','Nomer Pasien Lama'],
        'ceils' => $excel_ceils,
                'freezePane' => 'A2',
                'headerColor' => Postman4ExcelBehavior::getCssClass("header"),
                'headerStyle'=>[
          [
            'kd_pasien' =>['align'=>'center'],
            'nama_pasien' =>['align'=>'center'],
            'pekerjaan' => ['align'=>'center'],
            'agamaNama' => ['align'=>'center'],
            'telp' => ['align'=>'center'],
            'nomer_alias_pasien' =>['align'=>'center'],
          ]
        ],
        'contentStyle'=>[
          [
            'kd_pasien' =>['align'=>'center'],
            'nama_pasien' =>['align'=>'center'],
            'pekerjaan' => ['align'=>'center'],
            'agamaNama' => ['align'=>'center'],
            'telp' => ['align'=>'center'],
            'nomer_alias_pasien' =>['align'=>'center'],
          ]
        ],
               'oddCssClass' => Postman4ExcelBehavior::getCssClass("odd"),
               'evenCssClass' => Postman4ExcelBehavior::getCssClass("even"),
      ]
    ];

    $excel_file = "Data Pasien";
    $this->export4excel($excel_content, $excel_file);

}

     /**
     * delete using ajax.
     * @author wawan
     * @since 1.1.0
     * @return mixed
     */
   public function actionPilihDelete(){

            if (Yii::$app->request->isAjax) {

                Yii::$app->response->format = Response::FORMAT_JSON;
                $request= Yii::$app->request;
                $dataKeySelect=$request->post('keysSelect');
                foreach ($dataKeySelect as $key => $value) {

                   $id[] = $value;
             }

             $transaction  = Yii::$app->db->beginTransaction();
            try {
                    Yii::$app->db->createCommand()
                    ->delete(Pasien::tableName(), ['id'=>$id])
                    ->execute();

                    Yii::$app->db->createCommand()
                    ->delete(RekamHeader::tableName(), ['id_pasien'=>$id])
                    ->execute();

                    Yii::$app->db->createCommand()
                    ->delete(DetailRekamMedis::tableName(), ['id_pasien'=>$id])
                    ->execute();

                    Yii::$app->db->createCommand()
                    ->delete(RekamdosisObat::tableName(), ['id_pasien'=>$id])
                    ->execute();

                    // ...other DB operations...
                    $transaction->commit();
                } catch(\Exception $e) {
                    $transaction->rollBack();
                    throw $e;
                }

             }

         return true;

       }

     /**
     * delete using ajax.
     * @author wawan
     * @since 1.1.0
     * @return mixed
     */
   public function actionDeleteDetail(){

            if (Yii::$app->request->isAjax) {

                Yii::$app->response->format = Response::FORMAT_JSON;
                $request= Yii::$app->request;
                $dataKeySelect=$request->post('keysSelect');
                foreach ($dataKeySelect as $key => $value) {

                   $id[] = $value;
             }

             $transaction  = Yii::$app->db->beginTransaction();
            try {

                    Yii::$app->db->createCommand()
                    ->delete(DetailRekamMedis::tableName(), ['id'=>$id])
                    ->execute();

                    Yii::$app->db->createCommand()
                    ->delete(RekamdosisObat::tableName(), ['id_detail_medis'=>$id])
                    ->execute();

                    // ...other DB operations...
                    $transaction->commit();
                } catch(\Exception $e) {
                    $transaction->rollBack();
                    throw $e;
                }

             }

         return true;

       }

        /**
     * delete using ajax.
     * @author wawan
     * @since 1.1.0
     * @return mixed
     */
   public function actionDeleteDosis(){

            if (Yii::$app->request->isAjax) {

                Yii::$app->response->format = Response::FORMAT_JSON;
                $request= Yii::$app->request;
                $id_data=$request->post('id');

                Yii::$app->db->createCommand()
                ->delete(RekamdosisObat::tableName(), ['id_dosis'=>$id_data])
                ->execute();

             }

         return true;

       }

    /**
     * Depdrop type obat
     * @author wawan
     * @since 1.1.0
     * @return mixed
     */
   public function actionListObat() {
    $out = [];
    if (isset($_POST['depdrop_parents'])) {
        $parents = $_POST['depdrop_parents'];
        if ($parents != null) {
            $id = $parents[0];
            $model = Obat::find()->asArray()->where(['id_type_obat'=>$id])
                                                    ->all();
            //$out = self::getSubCatList($cat_id);
            // the getSubCatList function will query the database based on the
            // cat_id and return an array like below:
            // [
            //    ['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],
            //    ['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']
            // ]

            foreach ($model as $key => $value) {
                   $out[] = ['id'=>$value['kd_obat'],'name'=> $value['nama_obat']];
               }

               echo json_encode(['output'=>$out, 'selected'=>'']);
               return;
           }
       }
       echo Json::encode(['output'=>'', 'selected'=>'']);
   }

    /**
     * Displays a single Pasien model.
     * @param string $id
     * @return mixed
     */
    public function actionView($id)
    {
      $model = $this->findModel($id);

      if ($model->load(Yii::$app->request->post())) {
          $model->user_update = Yii::$app->user->identity ->id;
          $model->date_update = date('Y-m-d h:i:s');
          $model->save();
          return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->renderAjax('view', [
                'model' => $model,
                'data_agama' => self::ary_agama()
            ]);
        }
    }

    public function ary_obat(){
         return ArrayHelper::map(Obat::find()->all(),'kd_obat','nama_obat');
    }

    public function ary_type_obat(){
         return ArrayHelper::map(TypeObat::find()->all(),'id_type','type_obat');
    }

    public function actionCreateRekammedis($id,$kd){
        $model = new DetailRekamMedis();

        if ($model->load(Yii::$app->request->post())) {
            $model->kd_rekam_medis = $kd;
            $model->id_pasien = $id;
            $model->save();
            return $this->redirect(['review-pasien','id'=>$model->id_pasien]);
        } else {
            return $this->renderAjax('_form_detail_rekam', [
                'model' => $model,
            ]);
        }

    }

     /**
     * Displays a single Pasien model.
     * @param string $id
     * @return mixed
     */
    public function actionReviewPasien($id)
    {

        if($id != ''){
            $cari = ['id_pasien'=> $id];
        }else{
             $cari = "";
        }

        $searchModel = new DetailRekamMedisSearch($cari);
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        if(Yii::$app->request->post('hasEditable'))
        {
            $ID = \Yii::$app->request->post('editableKey');
            Yii::$app->response->format = Response::FORMAT_JSON;
            $model = DetailRekamMedis::findOne($ID);

            $out = Json::encode(['output'=>'', 'message'=>'']);

            // fetch the first entry in posted data (there should
            // only be one entry anyway in this array for an
            // editable submission)
            // - $posted is the posted data for Book without any indexes
            // - $post is the converted array for single model validation
            $post = [];
            $posted = current($_POST['DetailRekamMedis']);
            $post['DetailRekamMedis'] = $posted;

            // load model like any single model validation
            if ($model->load($post)) {
                // can save model or do something before saving model

                // custom output to return to be displayed as the editable grid cell
                // data. Normally this is empty - whereby whatever value is edited by
                // in the input by user is updated automatically.
                $output = '';

                $msg = '';

                if (isset($posted['tanggal'])) {
                    $model->save();
                    $output = $model->tanggal;
                }

                if (isset($posted['cek_fisik'])) {
                    $model->save();
                    $output = $model->cek_fisik;
                }

                // specific use case where you need to validate a specific
                // editable column posted when you have more than one
                // EditableColumn in the grid view. We evaluate here a
                // check to see if buy_amount was posted for the Book model
                // similarly you can check if the name attribute was posted as well

                $out = Json::encode(['output'=>$output, 'message'=>$msg]);

            // return ajax json encoded response and exit
            echo $out;

            return;
          }
        }

        return $this->render('reveiw', [
            'modelx' => $this->findModel($id),
            'searchModel'=>$searchModel,
            'dataProvider'=>$dataProvider
        ]);
    }

    public function ary_agama(){
        return ArrayHelper::map(Agama::find()->all(),'id_agama','nama_agama');
    }

    /**
     * Creates a new Pasien model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Pasien();

        $model_rekamheader = new RekamHeader();

        if ($model->load(Yii::$app->request->post())) {

            $transaction  = Yii::$app->db->beginTransaction();
            try {
                    $model->kd_pasien = Yii::$app->ambilkonci->getKey_pasien();
                    $model->user_create = Yii::$app->user->identity ->id;
                    $model->date_create = date('Y-m-d h:i:s');
                    $model->save();

                    $model_rekamheader->id_pasien = $model->id;
                    $model_rekamheader->kd_rekam_medis = Yii::$app->ambilkonci->getKey_rekamheader();
                    $model_rekamheader->date_create = date('Y-m-d h:i:s');
                    $model_rekamheader->save();
                    // ...other DB operations...
                    $transaction->commit();
                } catch(\Exception $e) {
                    $transaction->rollBack();
                    throw $e;
                }
            return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->renderAjax('create', [
                'model' => $model,
                'ary_agama'=>self::ary_agama(),
                'ary_jenis_kelamin'=>self::ary_jenis_kelamin()
            ]);
        }
    }

    /**
     * Creates a new Pasien model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreateDosis($id,$kd)
    {
        $model = new RekamdosisObat();

        if ($model->load(Yii::$app->request->post())) {
            $model->id_detail_medis = $kd;
            $model->id_pasien = $id;
            $model->user_create = Yii::$app->user->identity ->id;
            $model->date_create = date('Y-m-d h:i:s');
            if($model->save()){
              echo 1;
            }else{
              echo 0;
            }

        } else {
            return $this->renderAjax('_form_dosis', [
                'model' => $model,
                'data_type_obat'=>self::ary_type_obat(),
                'kd'=>$kd
            ]);
        }
    }

    /**
     * Updates an existing Pasien model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param string $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post())) {
            $model->user_update = Yii::$app->user->identity ->id;
            $model->date_update = date('Y-m-d h:i:s');
            $model->save();
            return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->renderAjax('update', [
                'model' => $model,
                'data_agama' => self::ary_agama()
            ]);
        }
    }

    /**
     * Deletes an existing Pasien model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param string $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Pasien model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param string $id
     * @return Pasien the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Pasien::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
package com.dci.intellij.dbn.language.common.element.lookup;

import com.dci.intellij.dbn.language.common.element.LeafElementType;

public abstract class LeafElementTypeLookupCache<T extends LeafElementType> extends AbstractElementTypeLookupCache<T> {
    public LeafElementTypeLookupCache(T leafElementType) {
        super(leafElementType);
        T elementType = getElementType();
        allPossibleLeafs.add(elementType);
        firstPossibleLeafs.add(elementType);
        firstRequiredLeafs.add(elementType);
    }

    @Override
    public boolean containsLeaf(LeafElementType leafElementType) {
        return getElementType() == leafElementType;
    }

    @Override
    public boolean canStartWithLeaf(LeafElementType leafElementType) {
        return getElementType() == leafElementType;
    }
}


text:
<?php

namespace Alchemy\Zippy\Tests\Adapter\BSDTar;

class TarBz2BSDTarAdapterTest extends BSDTarAdapterWithOptionsTest
{
    protected function getOptions()
    {
        return '--bzip2';
    }

    protected static function getAdapterClassName()
    {
        return 'Alchemy\\Zippy\\Adapter\\BSDTar\\TarBz2BSDTarAdapter';
    }
}


text:
Plugs are used to fill "holes" in .NET libraries and replace them with different
 code. Holes exist for example when a method in .NET library uses a Windows API
 call. That API call will not be available on Cosmos. One method would be to
 emulate the Windows API as WINE does, but the API is a low level C style API
 relying on memory structures. Emulating it would be highly inefficient. Instead,
 Cosmos replaces specific methods and property implementations that rely on
 Windows API calls. Plugs can also be used to provide an alternate implementation
 for a method, even if it does not rely on the Windows API.

 Plugs can be implemented in the following manners:

*   Code Plug - Standard C# (or any .NET language) is used to provide the alternate  implementation.
*   Assembly Languge - In a few low level cases assembly language is used. This is  reserved for a few few cases and only allowed in the Cosmos.Core ring.

 When a Cosmos project is compiled, IL2CPU creates a list of plugs. When it
 encounters a method or property for which a plug exists, instead of using the IL
 contained in the existing implementation, it substitutes the plug version
 instead.

###
 Plug Targets

*   Source Plugs - Used to target a class library without modifiable or available  source.  For example the Console class in the .NET Framework. The Console class uses the  Windows API, so plugs can be used to redefine the methods in the Console class  to use code which interacts with Cosmos instead. For these types of plug  targets, the attributes are specified on the plug implemenation since the source  cannot be modified of the target. If we coud modify the source, we wouldn't need  plugs. :)Sou
*   Assembly Plug - Empty methods which create a sort of "abstract" class are used  to define an interface to an assembly language plug. This type of plug is rare  and only for the core ring. For these types of plugs, the attributes are  specified on the target, rather than the implementation.

 Non source targets should never need to use assembly language, but if they do
 the plugs must be cascaded since assembly language plugs can only be applied to
 classes with modifiable source.

###
 Implementing a Plug

 Plugs can be applied at the class, or to an individual method or property. Plug
 implementations are defined by applying attributes to the class which provides
 the plug implementation.

###
 Plug Assembly Naming in Cosmos

 Plugs assemblies in Cosmos are named in the following manner.

 Cosmos.<ring>.Plugs.<Unique section of target namespace>

 ie Cosmos.System.Plugs.System

 Normally only one section will exist after plugs, but mutliple sections could
 exist to further seperate a group of plugs into multiple assemblies. In the
 previous example we can determine the following information:

*   **Cosmos**.System.Plugs.System - All Cosmos assemblies start with Cosmos.*.  User assemblies should not use the Cosmos. prefix.
*   Cosmos.**System**.Plugs.System - The plugs are part of the System ring.
*   Cosmos.System.**Plugs**.System - Plugs seperates plugs from normal code with  in the Cosmos.System.*
*   Cosmos.System.Plugs.**System** - The plugs in this assembly will apply to  System.*. It could also be System.Collections for example to apply to  System.Collections.*

 Plugs should be implemented in the highest ring possible and according to the
 code in the plug, not according to the class to which the plug targets. Most
 plugs should be in fact in the system ring. Except for a few special plugs
 needed by the compiler, off hand I cannot think of any that should be
 implemented in any ring lower than the system ring.

 **Plug Target**

 Please specify the PlugTarget using the fully qualified name, like:
 global::System.Console. To avoid later name colisions.