Author: veithen Date: Wed Mar 19 08:06:49 2014 New Revision: 1579160 URL: http://svn.apache.org/r1579160 Log: Use a Maven plugin instead of Java code to test presence of generated files.
Removed: axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/axis2900/VerifyFilesTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/filegen/README axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java Modified: axis/axis1/java/trunk/axis-ant/pom.xml axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java axis/axis1/java/trunk/pom.xml Modified: axis/axis1/java/trunk/axis-ant/pom.xml URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/pom.xml?rev=1579160&r1=1579159&r2=1579160&view=diff ============================================================================== --- axis/axis1/java/trunk/axis-ant/pom.xml (original) +++ axis/axis1/java/trunk/axis-ant/pom.xml Wed Mar 19 08:06:49 2014 @@ -149,6 +149,144 @@ </excludes> </configuration> </plugin> + <plugin> + <groupId>com.github.veithen.filecheck</groupId> + <artifactId>filecheck-maven-plugin</artifactId> + <executions> + <execution> + <phase>test</phase> + <goals> + <goal>check-multiple</goal> + </goals> + <configuration> + <fileSets> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/axis2900</directory> + <expectedFiles> + <expectedFile>Exception.java</expectedFile> + <expectedFile>MyWS.java</expectedFile> + <expectedFile>MyWSException.java</expectedFile> + <expectedFile>MyWSLocator.java</expectedFile> + <expectedFile>MyWSPortType.java</expectedFile> + <expectedFile>MyWSSoap11BindingStub.java</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/clash</directory> + <expectedFiles> + <expectedFile>AnotherNonSharedNameImpl.java</expectedFile> + <expectedFile>AnotherNonSharedNameStub.java</expectedFile> + <expectedFile>DescribeLayoutType0.java</expectedFile> + <expectedFile>DescribeLayout.java</expectedFile> + <expectedFile>NonSharedNameImpl.java</expectedFile> + <expectedFile>NonSharedNameStub.java</expectedFile> + <expectedFile>SayHello.java</expectedFile> + <expectedFile>SharedName_PortType.java</expectedFile> + <expectedFile>SharedName_Service.java</expectedFile> + <expectedFile>SharedName_ServiceLocator.java</expectedFile> + <expectedFile>SharedName_ServiceTestCase.java</expectedFile> + <expectedFile>SharedName_Type.java</expectedFile> + <expectedFile>deploy.wsdd</expectedFile> + <expectedFile>undeploy.wsdd</expectedFile> + </expectedFiles> + <allowedFiles> + <allowedFile>SharedName_Type_Helper.java</allowedFile> + </allowedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/extra</directory> + <expectedFiles> + <expectedFile>Extra.java</expectedFile> <!-- this is the important one --> + <expectedFile>MyService.java</expectedFile> + <expectedFile>MyServiceService.java</expectedFile> + <expectedFile>MyServiceServiceLocator.java</expectedFile> + <expectedFile>MyServiceSoapBindingStub.java</expectedFile> + <expectedFile>MyService.wsdl</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/filegenAll</directory> + <expectedFiles> + <expectedFile>Address.java</expectedFile> + <expectedFile>OpFault.java</expectedFile> + <expectedFile>PortTypeSoap.java</expectedFile> + <expectedFile>ReferenceService.java</expectedFile> + <expectedFile>ReferenceServiceLocator.java</expectedFile> + <expectedFile>ReferenceSoapBindingStub.java</expectedFile> + <expectedFile>StateType.java</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/filegen</directory> + <expectedFiles> + <expectedFile>OpFault.java</expectedFile> + <expectedFile>PortTypeSoap.java</expectedFile> + <expectedFile>ReferenceService.java</expectedFile> + <expectedFile>ReferenceServiceLocator.java</expectedFile> + <expectedFile>ReferenceSoapBindingStub.java</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/groups</directory> + <expectedFiles> + <expectedFile>SomeType.java</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/header</directory> + <expectedFiles> + <expectedFile>BindingImpl.java</expectedFile> + <expectedFile>BindingSkeleton.java</expectedFile> + <expectedFile>BindingStub.java</expectedFile> + <expectedFile>HeaderService.java</expectedFile> + <expectedFile>HeaderServiceLocator.java</expectedFile> + <expectedFile>HeaderServiceTestCase.java</expectedFile> + <expectedFile>HeaderType.java</expectedFile> + <expectedFile>ImplicitFault.java</expectedFile> + <expectedFile>Op1Fault.java</expectedFile> + <expectedFile>PortType.java</expectedFile> + <expectedFile>deploy.wsdd</expectedFile> + <expectedFile>undeploy.wsdd</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/literal</directory> + <expectedFiles> + <expectedFile>SalesRankNPrice1.java</expectedFile> + <expectedFile>SalesRanks.java</expectedFile> + <expectedFile>Prices.java</expectedFile> + <expectedFile>All.java</expectedFile> + <expectedFile>SalesRankNPriceSoap.java</expectedFile> + <expectedFile>SalesRankNPriceSoapStub.java</expectedFile> + <expectedFile>SalesRankNPrice.java</expectedFile> + <expectedFile>SalesRankNPriceLocator.java</expectedFile> + </expectedFiles> + </fileSet> + <fileSet> + <directory>${project.build.directory}/work/test/wsdl/multibinding</directory> + <expectedFiles> + <expectedFile>BindingAllLitImpl.java</expectedFile> + <expectedFile>BindingAllLitSkeleton.java</expectedFile> + <expectedFile>BindingAllLitStub.java</expectedFile> + <expectedFile>BindingNoLitImpl.java</expectedFile> + <expectedFile>BindingNoLitSkeleton.java</expectedFile> + <expectedFile>BindingNoLitStub.java</expectedFile> + <expectedFile>BindingSomeLitImpl.java</expectedFile> + <expectedFile>BindingSomeLitSkeleton.java</expectedFile> + <expectedFile>BindingSomeLitStub.java</expectedFile> + <expectedFile>MbPT.java</expectedFile> + <expectedFile>MbService.java</expectedFile> + <expectedFile>MbServiceLocator.java</expectedFile> + <expectedFile>MbServiceTestCase.java</expectedFile> + <expectedFile>deploy.wsdd</expectedFile> + <expectedFile>undeploy.wsdd</expectedFile> + </expectedFiles> + </fileSet> + </fileSets> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> </project> Modified: axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java?rev=1579160&r1=1579159&r2=1579160&view=diff ============================================================================== --- axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java (original) +++ axis/axis1/java/trunk/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java Wed Mar 19 08:06:49 2014 @@ -21,111 +21,14 @@ */ package test.wsdl.groups; -import java.io.File; import java.io.IOException; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - public class GroupsTestCase extends junit.framework.TestCase { public GroupsTestCase(String name) { super(name); } - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("SomeType.java"); - return set; - } - - /** - * List of files which may or may not be generated. - */ - protected Set shouldNotExist() { - HashSet set = new HashSet(); - set.add("SomeGroup.java"); - return set; - } - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "groups"; - } - - protected String getPrefix(String parent) { - if (parent == null || parent.length() == 0) { - return ""; - } - else { - return parent + File.separator; - } - } - - /** This method returns a array of String file paths, located within the - * supplied root directory. The string values are created relative to the - * specified parent so that the names get returned in the form of - * "file.java", "dir/file.java", "dir/dir/file.java", etc. This feature - * asslows the various file specs to include files in sub-directories as - * well as the root directory. - */ - protected String[] getPaths(File root, String parent) { - File files[] = root.listFiles(); - if (files == null) - fail("Unable to get a list of files from " + root.getPath()); - - Set filePaths = new HashSet(); - for(int i=0; i<files.length; i++) { - if (files[i].isDirectory()) { - String children[] = getPaths(files[i], - getPrefix(parent) + files[i].getName()); - filePaths.addAll(Arrays.asList(children)); - } - else { - filePaths.add(getPrefix(parent) + files[i].getName()); - } - } - String paths[] = new String[filePaths.size()]; - return (String[]) filePaths.toArray(paths); - } - - public void testGroups() throws IOException, ClassNotFoundException, SecurityException, NoSuchMethodException { - - // Test for the proper files - - String rootDir = rootDir(); - Set shouldExist = shouldExist(); - Set shouldNotExist = shouldNotExist(); - - // open up the output directory and check what files exist. - File outputDir = new File(rootDir); - - String[] files = getPaths(outputDir, null); - - for (int i = 0; i < files.length; ++i) { - if (shouldExist.contains(files[i])) { - shouldExist.remove(files[i]); - } - else if (shouldNotExist.contains(files[i])) { - fail("The following file should not exist in " + rootDir + - ", but does: " + files[i]); - } - } - - if (shouldExist.size() > 0) { - fail("The following files should exist in " + rootDir + - ", but do not: " + shouldExist); - } - // Test for the proper members Class ourClass = Class.forName("test.wsdl.groups.SomeType"); Modified: axis/axis1/java/trunk/pom.xml URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/pom.xml?rev=1579160&r1=1579159&r2=1579160&view=diff ============================================================================== --- axis/axis1/java/trunk/pom.xml (original) +++ axis/axis1/java/trunk/pom.xml Wed Mar 19 08:06:49 2014 @@ -155,6 +155,18 @@ <prerequisites> <maven>3.0.3</maven> </prerequisites> + <pluginRepositories> + <pluginRepository> + <id>cloudbees-snapshot</id> + <url>http://repository-veithen.forge.cloudbees.com/snapshot/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> <build> <pluginManagement> <plugins> @@ -250,6 +262,11 @@ <artifactId>maven-eclipse-plugin</artifactId> <version>2.9</version> </plugin> + <plugin> + <groupId>com.github.veithen.filecheck</groupId> + <artifactId>filecheck-maven-plugin</artifactId> + <version>0.1-SNAPSHOT</version> + </plugin> </plugins> </pluginManagement> <plugins>