Skip to content

Commit

Permalink
Merge pull request #2242 from darranl/ELY-2865
Browse files Browse the repository at this point in the history
[ELY-2865] Move CommandCredentialSourceTest to the wildfly-elytron-credential-source-impl module.
  • Loading branch information
fjuma authored Dec 3, 2024
2 parents 11e7a7d + b5fb6ad commit f021004
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
22 changes: 17 additions & 5 deletions credential/source/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-x500</artifactId>
</dependency>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
Expand All @@ -70,17 +70,29 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<scope>provided</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
</dependency>
</dependency>

<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
</dependency>

<!-- Test Scope -->
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-password-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.wildfly.security.password.Password;
import org.wildfly.security.password.interfaces.ClearPassword;

// has dependency on wildfly-credential-source-deprecated
public class CommandCredentialSourceTest {
@Test
public void testCommand() throws GeneralSecurityException, IOException {
Expand Down Expand Up @@ -66,19 +65,4 @@ private static void addCommand(final CommandCredentialSource.Builder builder) {
builder.addCommand("-cp").addCommand(System.getProperty("java.class.path")).addCommand(CredentialCommand.class.getName());
}

private static String buildExternalCommand(final String extOption, final String delimiter, final String argument) {
// First check for java.exe or java as the binary
File java = new File(System.getProperty("java.home"), "/bin/java");
File javaExe = new File(System.getProperty("java.home"), "/bin/java.exe");
String jre;
if (java.exists())
jre = java.getAbsolutePath();
else
jre = javaExe.getAbsolutePath();
// Build the command to run this jre
String cmd = jre + delimiter + "-cp" + delimiter + System.getProperty("java.class.path") + delimiter
+ CredentialCommand.class.getName() + (argument != null ? delimiter + argument : "");
return extOption + cmd;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
* Class that simulates credential command for tests.
* @author <a href="mailto:[email protected]">Peter Skopek</a>
*/
public class CredentialCommand {
class CredentialCommand {

private CredentialCommand() {
CredentialCommand() {

}

Expand Down

0 comments on commit f021004

Please sign in to comment.