Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #204

Merged
merged 5 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,32 @@
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.0.0-beta-1b</version>
<version>4.6.3</version>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>${oracle.jdbc.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ucp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<groupId>com.oracle.database.nls</groupId>
<artifactId>orai18n</artifactId>
<version>${oracle.jdbc.version}</version>
<scope>compile</scope>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/utplsql/cli/Cli.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package org.utplsql.cli;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import picocli.CommandLine;

import java.util.List;

public class Cli {

private static final Logger logger = LoggerFactory.getLogger(Cli.class);

static final int DEFAULT_ERROR_CODE = 1;

public static void main(String[] args) {
Expand All @@ -17,6 +21,8 @@ public static void main(String[] args) {

static int runPicocliWithExitCode(String[] args) {

logger.debug("Args: "+String.join(", ", args));

CommandLine commandLine = new CommandLine(UtplsqlPicocliCommand.class);
commandLine.setTrimQuotes(true);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/utplsql/cli/RunPicocliCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class RunPicocliCommand implements IRunCommand {
private List<Format> reporters = new ArrayList<>();

static class Format {
@Option(names = {"-f", "--format"}, required = true, description = "Enables specified format reporting")
@Option(names = {"-f", "--format"}, description = "Enables specified format reporting")
String format;
@Option(names = {"-o"}, description = "Outputs format to file")
String outputFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ private void setThickOrThinJdbcUrl(OracleDataSource ds) throws SQLException {
ds.setPassword(config.getPassword());

for (ConnectStringPossibility possibility : possibilities) {
logger.debug("Try connecting {}", possibility.getMaskedConnectString(config));
ds.setURL(possibility.getConnectString(config));
try (Connection ignored = ds.getConnection()) {
logger.info("Use connection string {}", possibility.getMaskedConnectString(config));
return;
} catch (UnsatisfiedLinkError | Exception e) {
} catch (Error | Exception e) {
errors.add(possibility.getMaskedConnectString(config) + ": " + e.getMessage());
lastException = e;
}
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/org/utplsql/cli/PicocliRunCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,13 @@ void testFileMappingWithoutDetails() throws Exception {
assertNull( testMapperConfig.getTypeSubexpression());
assertNull( testMapperConfig.getNameSubexpression());
}

@Test
void negatedTag() throws Exception {
RunCommandConfig config = parseForConfig("run",
TestHelper.getConnectionString(),
"--tags=\"-dontwantit\"");

assertThat(config.getTags(), hasItemInArray("-dontwantit") );
}
}