Skip to content

Commit

Permalink
[MGPG-94] Integration tests - convert and reformat bsh to groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Apr 15, 2023
1 parent 955ea0e commit 5e51734
Show file tree
Hide file tree
Showing 21 changed files with 232 additions and 303 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ under the License.
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.5.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down
37 changes: 37 additions & 0 deletions src/it/alternative-secret-keyring/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
def artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")

def expectedFiles = [
"test-1.0.pom",
"test-1.0.pom.asc",
"test-1.0-jdk15.jar",
"test-1.0-jdk15.jar.asc"
]

expectedFiles.each { expectedFile ->
def file = new File(artifactDir, expectedFile)

println "Checking for existence of $file"

if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -18,23 +17,22 @@
* under the License.
*/

import java.io.*;

File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadnjp/test/1.0" );
def artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")

String[] expectedFiles = {
"test-1.0-javadoc.jar",
"test-1.0-javadoc.jar.asc",
};
def expectedFiles = [
"test-1.0.pom",
"test-1.0.pom.asc",
"test-1.0-jdk15.jar",
"test-1.0-jdk15.jar.asc"
]

for ( String expectedFile : expectedFiles )
{
File file = new File( artifactDir, expectedFile );
for (String expectedFile : expectedFiles) {
def file = new File(artifactDir, expectedFile)

System.out.println( "Checking for existence of " + file );
println "Checking for existence of $file"

if ( !file.isFile() )
{
throw new Exception( "Missing file " + file );
if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -18,7 +17,6 @@
* under the License.
*/

import java.io.*;
import org.codehaus.plexus.util.*;
import org.codehaus.plexus.util.FileUtils

FileUtils.deleteDirectory( new File( basedir, "target" ) );
FileUtils.deleteDirectory(new File(basedir, "target"))
46 changes: 0 additions & 46 deletions src/it/sign-and-deploy-file-with-extras/verify.bsh

This file was deleted.

42 changes: 42 additions & 0 deletions src/it/sign-and-deploy-file-with-extras/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/

def artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwe/test/1.0")

var expectedFiles = [
"test-1.0.jar",
"test-1.0.jar.asc",
"test-1.0-sources.jar",
"test-1.0-sources.jar.asc",
"test-1.0-javadoc.jar",
"test-1.0-javadoc.jar.asc",
"test-1.0.pom",
"test-1.0.pom.asc"
]

for (String expectedFile : expectedFiles) {
var file = new File(artifactDir, expectedFile)

println "Checking for existence of $file"

if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -18,7 +17,7 @@
* under the License.
*/

import java.io.*;
import org.codehaus.plexus.util.*;

FileUtils.deleteDirectory( new File( basedir, "target" ) );
import org.codehaus.plexus.util.FileUtils

FileUtils.deleteDirectory(new File(basedir, "target"))
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -17,26 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwp/test/1.0")

import java.io.*;

File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwp/test/1.0" );

String[] expectedFiles = {
var expectedFiles = [
"test-1.0.jar",
"test-1.0.jar.asc",
"test-1.0.pom",
"test-1.0.pom.asc",
};
"test-1.0.pom.asc"
]

for ( String expectedFile : expectedFiles )
{
File file = new File( artifactDir, expectedFile );
for (String expectedFile : expectedFiles) {
var file = new File(artifactDir, expectedFile)

System.out.println( "Checking for existence of " + file );
println "Checking for existence of $file"

if ( !file.isFile() )
{
throw new Exception( "Missing file " + file );
if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -17,8 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import org.codehaus.plexus.util.FileUtils

import java.io.*;
import org.codehaus.plexus.util.*;

FileUtils.deleteDirectory( new File( basedir, "target" ) );
FileUtils.deleteDirectory(new File(basedir, "target"))
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -17,26 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwop/test/1.0")

import java.io.*;

File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwop/test/1.0" );

String[] expectedFiles = {
var expectedFiles = [
"test-1.0.jar",
"test-1.0.jar.asc",
"test-1.0.pom",
"test-1.0.pom.asc",
};
"test-1.0.pom.asc"
]

for ( String expectedFile : expectedFiles )
{
File file = new File( artifactDir, expectedFile );
for (String expectedFile : expectedFiles) {
var file = new File(artifactDir, expectedFile)

System.out.println( "Checking for existence of " + file );
println "Checking for existence of $file"

if ( !file.isFile() )
{
throw new Exception( "Missing file " + file );
if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -17,8 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import org.codehaus.plexus.util.FileUtils

import java.io.*;
import org.codehaus.plexus.util.*;

FileUtils.deleteDirectory( new File( basedir, "target" ) );
FileUtils.deleteDirectory(new File(basedir, "target"))
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -17,12 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfs/test/1.0")

import java.io.*;

File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfs/test/1.0" );

String[] expectedFiles = {
var expectedFiles = [
"test-1.0.jar",
"test-1.0.jar.asc",
"test-1.0-sources.jar",
Expand All @@ -36,17 +32,15 @@ String[] expectedFiles = {
"test-1.0-src.tar.gz",
"test-1.0-src.tar.gz.asc",
"test-1.0.tar.gz",
"test-1.0.tar.gz.asc",
};
"test-1.0.tar.gz.asc"
]

for ( String expectedFile : expectedFiles )
{
File file = new File( artifactDir, expectedFile );
for (String expectedFile : expectedFiles) {
var file = new File(artifactDir, expectedFile)

System.out.println( "Checking for existence of " + file );
println "Checking for existence of $file"

if ( !file.isFile() )
{
throw new Exception( "Missing file " + file );
if (!file.isFile()) {
throw new Exception("Missing file $file")
}
}
24 changes: 0 additions & 24 deletions src/it/sign-and-deploy-not-jar-packaging/setup.bsh

This file was deleted.

Loading

0 comments on commit 5e51734

Please sign in to comment.