Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a75bf5bb32323153eee49e3ea2d8e7e6e8cbba04 (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
/*******************************************************************************
 * Copyright (c) 2010 Oracle. 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:
 *     Oracle - initial API and implementation
 ******************************************************************************/
package org.eclipse.jpt.jaxb.core.tests.internal.projects;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
import org.eclipse.jpt.jaxb.core.JaxbFacet;
import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallConfig;

/**
 * This builds and holds a "JAXB" project.
 * Support for adding packages and types.
 * 
 * The JPA project's settings (platform, database connection, etc.) can be
 * controlled by building a data model and passing it into the constructor.
 */
@SuppressWarnings("nls")
public class TestJaxbProject extends TestJavaProject {
	private final JaxbProject jaxbProject;


	// ********** builders **********

	public static TestJaxbProject buildJaxbProject(String baseProjectName, boolean autoBuild, JaxbFacetInstallConfig config)
			throws CoreException {
		return new TestJaxbProject(baseProjectName, autoBuild, config);
	}

	// ********** constructors/initialization **********

	public TestJaxbProject(String projectName) throws CoreException {
		this(projectName, false);
	}

	public TestJaxbProject(String projectName, boolean autoBuild) throws CoreException {
		this(projectName, autoBuild, null);
	}

	public TestJaxbProject(String projectName, boolean autoBuild, JaxbFacetInstallConfig config) throws CoreException {
		super(projectName, autoBuild);
		String jaxbFacetVersion = config.getProjectFacetVersion().getVersionString();
		this.installFacet(JaxbFacet.ID, jaxbFacetVersion, config);
		this.jaxbProject = JptJaxbCorePlugin.getJaxbProject(this.getProject());
//		this.jaxbProject.setUpdater(new SynchronousJpaProjectUpdater(this.jaxbProject));
	}



	// ********** public methods **********

	public JaxbProject getJaxbProject() {
		return this.jaxbProject;
	}

}

Back to the top