Search in sources :

Example 1 with ConfigurationActor

use of org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor in project jbosstools-hibernate by jbosstools.

the class HbmExporterTest method getConfigurationFor.

/**
 * Method returns Configuration object for selected ICompilationUnits.
 * Fails if configuration is null.
 * @return
 */
protected IConfiguration getConfigurationFor(String... cuNames) {
    Set<ICompilationUnit> selectionCU = new HashSet<ICompilationUnit>();
    for (int i = 0; i < cuNames.length; i++) {
        ICompilationUnit icu = Utils.findCompilationUnit(project.getIJavaProject(), cuNames[i]);
        assertNotNull(icu);
        selectionCU.add(icu);
    }
    ConfigurationActor actor = new ConfigurationActor(selectionCU);
    Map<IJavaProject, IConfiguration> configurations = actor.createConfigurations(Integer.MAX_VALUE);
    assertEquals(1, configurations.size());
    IConfiguration config = configurations.get(project.getIJavaProject());
    assertNotNull(config);
    return config;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IJavaProject(org.eclipse.jdt.core.IJavaProject) ConfigurationActor(org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 ConfigurationActor (org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor)1 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)1