update copyright
[fedora-idea.git] / plugins / maven / src / test / java / org / jetbrains / idea / maven / execution / MavenExecutorsTest.java
blobea464ba9499c6c7e8c0ec3405d8b358e4af67988
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.jetbrains.idea.maven.execution;
18 import com.intellij.openapi.progress.EmptyProgressIndicator;
19 import com.intellij.openapi.vfs.VfsUtil;
20 import org.jetbrains.idea.maven.MavenTestCase;
22 import java.io.File;
23 import java.util.Arrays;
25 public class MavenExecutorsTest extends MavenTestCase {
26 public void testExternalExecutor() throws Exception {
27 if (!hasMavenInstallation()) return;
29 VfsUtil.saveText(createProjectSubFile("src/main/java/A.java"), "public class A {}");
31 createProjectPom("<groupId>test</groupId>" +
32 "<artifactId>project</artifactId>" +
33 "<version>1</version>");
35 assertFalse(new File(getProjectPath(), "target").exists());
37 MavenRunnerParameters params = new MavenRunnerParameters(true, getProjectPath(), Arrays.asList("compile"), null);
38 MavenRunnerSettings settings = new MavenRunnerSettings();
40 MavenExecutor e;
41 settings.setJreName(MavenRunnerSettings.USE_INTERNAL_JAVA);
42 e = new MavenExternalExecutor(params, getMavenGeneralSettings(), settings, NULL_MAVEN_CONSOLE);
44 assertTrue(e.execute(new EmptyProgressIndicator()));
46 assertTrue(new File(getProjectPath(), "target").exists());