o starting new tests for the embedder

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@491443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-12-31 16:58:08 +00:00
parent 9d792d6d1c
commit 26f1777dba
3 changed files with 0 additions and 126 deletions

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2005-2006 The Apache Software Foundation.
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>maven</artifactId>
<groupId>org.apache.maven</groupId>
<version>2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-embedder-it</artifactId>
<name>Maven Embedder Integration Tests</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>2.1-SNAPSHOT</version>
<classifier>dep</classifier>
</dependency>
</dependencies>
</project>

View File

@ -1,49 +0,0 @@
package org.apache.maven.embedder.it;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.model.Model;
import java.io.File;/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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.
*/
/**
* A mock tool plugin that uses the Maven Embedder API
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class MockPlugin
{
private MavenEmbedder maven;
public MockPlugin()
throws Exception
{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
maven = new MavenEmbedder();
maven.setClassLoader( classLoader );
maven.start();
}
public Model readModel( File model )
throws Exception
{
return maven.readModel( model );
}
}

View File

@ -1,40 +0,0 @@
package org.apache.maven.embedder.it;
import junit.framework.TestCase;
import org.apache.maven.model.Model;
import java.io.File;/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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.
*/
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class MockPluginTest
extends TestCase
{
public void testMockPlugin()
throws Exception
{
MockPlugin plugin = new MockPlugin();
String basedir = System.getProperty( "basedir" );
Model model = plugin.readModel( new File( basedir, "pom.xml" ) );
assertEquals( "org.apache.maven", model.getGroupId() );
}
}