From: Carlos S. <car...@us...> - 2005-09-22 02:33:24
|
carlossg 05/09/21 19:33:18 Added: cobertura/src/plugin-test maven.xml project.xml cobertura/src/plugin-test/testGenerateReportWhenTestFails maven.xml project.xml cobertura/src/plugin-test/testGenerateReportWhenTestFails/src/main/org/apache/maven/cobertura/test Simple.java cobertura/src/plugin-test/testGenerateReportWhenTestFails/src/test/org/apache/maven/cobertura/test SimpleTest.java cobertura/src/plugin-test/testSimple maven.xml project.xml cobertura/src/plugin-test/testSimple/src/main/org/apache/maven/cobertura/test Simple.java cobertura/src/plugin-test/testSimple/src/test/org/apache/maven/cobertura/test SimpleTest.java Log: Added test cases Revision Changes Path 1.1 maven-plugins/cobertura/src/plugin-test/maven.xml Index: maven.xml =================================================================== <!-- /* * Copyright 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. */ --> <project default="testPlugin" xmlns:j="jelly:core"> <goal name="testPlugin"> <j:set var="goal" value="testPlugin"/> <attainGoal name="multiproject:goal"/> </goal> </project> 1.1 maven-plugins/cobertura/src/plugin-test/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- /* * 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. */ --> <project> <pomVersion>3</pomVersion> <groupId>maven</groupId> <currentVersion>1.0</currentVersion> <organization> <name>Apache Software Foundation</name> <url>http://jakarta.apache.org/</url> </organization> <inceptionYear>2003</inceptionYear> <package>org.apache.maven.cobertura.test</package> <shortDescription>Test project for Maven Cobertura plugin</shortDescription> <url>http://maven.apache.org/reference/plugins/cobertura/</url> <repository> <connection>scm:svn:http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/cobertura/</connection> <url>http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/cobertura/</url> </repository> <mailingLists/> <developers/> <dependencies/> <build> <sourceDirectory>src/main</sourceDirectory> <unitTestSourceDirectory>src/test</unitTestSourceDirectory> <unitTest> <includes> <include>**/*Test.java</include> </includes> </unitTest> </build> </project> 1.1 maven-plugins/cobertura/src/plugin-test/testGenerateReportWhenTestFails/maven.xml Index: maven.xml =================================================================== <!-- /* * Copyright 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. */ --> <project default="testPlugin" xmlns:util="jelly:util" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:x="jelly:xml" xmlns:maven="jelly:maven" xmlns:assert="assert"> <goal name="testPlugin"> <!-- Fixture --> <attainGoal name="clean"/> <attainGoal name="cobertura"/> <echo>${maven.docs.dest}/cobertura/index.html</echo> <assert:assertFile file="${maven.docs.dest}/cobertura/index.html"/> </goal> </project> 1.1 maven-plugins/cobertura/src/plugin-test/testGenerateReportWhenTestFails/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- /* * Copyright 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. */ --> <project> <extend>${basedir}/../project.xml</extend> <artifactId>testGenerateReportWhenNoTests</artifactId> <name>testGenerateReportWhenTestFails</name> </project> 1.1 maven-plugins/cobertura/src/plugin-test/testGenerateReportWhenTestFails/src/main/org/apache/maven/cobertura/test/Simple.java Index: Simple.java =================================================================== package org.apache.maven.cobertura.test; /* ==================================================================== * 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. * ==================================================================== */ public class Simple { public void someMethod() { } } 1.1 maven-plugins/cobertura/src/plugin-test/testGenerateReportWhenTestFails/src/test/org/apache/maven/cobertura/test/SimpleTest.java Index: SimpleTest.java =================================================================== package org.apache.maven.cobertura.test; /* ==================================================================== * 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. * ==================================================================== */ import junit.framework.TestCase; public class SimpleTest extends TestCase { public void testSomeMethod() throws Exception { throw new Exception("Make test fail"); } } 1.1 maven-plugins/cobertura/src/plugin-test/testSimple/maven.xml Index: maven.xml =================================================================== <!-- /* * Copyright 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. */ --> <project default="testPlugin" xmlns:util="jelly:util" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:x="jelly:xml" xmlns:maven="jelly:maven" xmlns:assert="assert"> <goal name="testPlugin"> <!-- Fixture --> <attainGoal name="clean"/> <attainGoal name="cobertura"/> <assert:assertFile file="${maven.docs.dest}/cobertura/index.html"/> </goal> </project> 1.1 maven-plugins/cobertura/src/plugin-test/testSimple/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- /* * Copyright 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. */ --> <project> <extend>${basedir}/../project.xml</extend> <artifactId>testSimple</artifactId> <name>testSimple</name> </project> 1.1 maven-plugins/cobertura/src/plugin-test/testSimple/src/main/org/apache/maven/cobertura/test/Simple.java Index: Simple.java =================================================================== package org.apache.maven.cobertura.test; /* ==================================================================== * 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. * ==================================================================== */ public class Simple { public void someMethod() { } } 1.1 maven-plugins/cobertura/src/plugin-test/testSimple/src/test/org/apache/maven/cobertura/test/SimpleTest.java Index: SimpleTest.java =================================================================== package org.apache.maven.cobertura.test; /* ==================================================================== * 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. * ==================================================================== */ import junit.framework.TestCase; public class SimpleTest extends TestCase { public void testSomeMethod() { Simple simple = new Simple(); simple.someMethod(); } } |