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

Add coverage and refactor tests #1751

Merged
merged 30 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2c58291
Cover Color
sualeh Nov 12, 2024
8bf4f5f
Add convertForComparison test
sualeh Nov 12, 2024
7a2a5c6
Add test cases
sualeh Nov 13, 2024
fa5cf46
Add coverage tests
sualeh Nov 13, 2024
cce2c97
Move directed edge test to utility
sualeh Nov 13, 2024
1434c45
Add base product version test
sualeh Nov 13, 2024
cb715ee
Add tests
sualeh Nov 13, 2024
613d3f2
Tests for NonCloseableWriter
sualeh Nov 13, 2024
687dfdd
Add coverage for circular list
sualeh Nov 13, 2024
2aae08f
Add graph tests
sualeh Nov 13, 2024
c173832
Add task definition test
sualeh Nov 14, 2024
16e8f12
Add task result test
sualeh Nov 14, 2024
cd6e19d
Inject clock for testing
sualeh Nov 15, 2024
626abfc
Add task runner tests
sualeh Nov 15, 2024
a7675d2
Refactor out common code
sualeh Nov 15, 2024
b345650
Add task runner tests
sualeh Nov 15, 2024
53ca376
Add coverage
sualeh Nov 15, 2024
bef245d
Simplify test code by using an arguments source for a parameterized test
sualeh Nov 16, 2024
b57b754
Simplify test
sualeh Nov 17, 2024
c5736d5
Simplify test code by using an arguments source for a parameterized test
sualeh Nov 17, 2024
28a9685
Simplify test code by using an arguments source for a parameterized test
sualeh Nov 17, 2024
1c28abf
Simplify test code by using an arguments source for a parameterized test
sualeh Nov 17, 2024
92ebda0
Use parameterized tests
sualeh Nov 17, 2024
475a97f
Explicitly mention that values that are being tested
sualeh Nov 17, 2024
7d568f9
Change order of arguments to be more logical
sualeh Nov 17, 2024
c6d62be
Reduce number of arguments
sualeh Nov 17, 2024
7f58cbb
Reduce number of arguments
sualeh Nov 17, 2024
0149e12
Reduce number of arguments
sualeh Nov 17, 2024
970d418
Use parameterized tests
sualeh Nov 17, 2024
a3a474e
Refactor Cartesian arguments
sualeh Nov 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import schemacrawler.schema.TableType;
import schemacrawler.schemacrawler.SchemaInfoLevel;
import schemacrawler.schemacrawler.SchemaReference;
import us.fatehi.utility.graph.DirectedEdge;
import us.fatehi.utility.graph.Vertex;
import us.fatehi.utility.property.AbstractProperty;

Expand Down Expand Up @@ -74,11 +73,6 @@ class TestDatabaseObject extends AbstractDatabaseObject {
.verify();
}

@Test
public void directedEdge() {
EqualsVerifier.forClass(DirectedEdge.class).verify();
}

@Test
public void grants() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,31 @@

package schemacrawler.integration.test;

import static schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat.htmlx;
import static schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat.scdot;

import java.util.Arrays;
import java.util.stream.Stream;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import schemacrawler.test.AbstractAlternateKeysTest;
import schemacrawler.test.utility.ResolveTestContext;
import schemacrawler.test.utility.TestContext;
import schemacrawler.test.utility.WithTestDatabase;
import schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat;
import schemacrawler.tools.options.OutputFormat;
import us.fatehi.utility.datasource.DatabaseConnectionSource;

@WithTestDatabase
@ResolveTestContext
public class DiagramAlternateKeysTest extends AbstractAlternateKeysTest {

@Override
protected Stream<OutputFormat> outputFormats() {
return Arrays.stream(new OutputFormat[] {scdot, htmlx});
@DisplayName("Alternate keys loaded from catalog attributes file")
@ParameterizedTest(name = "with output to {0}")
@EnumSource(
value = DiagramOutputFormat.class,
names = {"scdot", "htmlx"})
public void alternateKeys_01(
final OutputFormat outputFormat,
final TestContext testContext,
final DatabaseConnectionSource dataSource)
throws Exception {
assertAlternateKeys(testContext, dataSource, outputFormat);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,74 @@

package schemacrawler.integration.test;

import static schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat.htmlx;
import static schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat.scdot;

import java.util.Arrays;
import java.util.stream.Stream;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import schemacrawler.test.AbstractWeakAssociationsTest;
import schemacrawler.test.utility.ResolveTestContext;
import schemacrawler.test.utility.TestContext;
import schemacrawler.test.utility.WithTestDatabase;
import schemacrawler.tools.command.text.diagram.options.DiagramOutputFormat;
import schemacrawler.tools.options.OutputFormat;
import us.fatehi.utility.datasource.DatabaseConnectionSource;

@WithTestDatabase
@ResolveTestContext
public class DiagramWeakAssociationsTest extends AbstractWeakAssociationsTest {

@Override
protected Stream<OutputFormat> outputFormats() {
return Arrays.stream(new OutputFormat[] {scdot, htmlx});
@DisplayName("Inferred weak associations")
@ParameterizedTest(name = "with output to {0}")
@EnumSource(
value = DiagramOutputFormat.class,
names = {"scdot", "htmlx"})
public void weakAssociations_00(
final OutputFormat outputFormat,
final TestContext testContext,
final DatabaseConnectionSource dataSource)
throws Exception {
super.weakAssociations_00(outputFormat, testContext, dataSource);
}

@Override
@DisplayName("Weak associations loaded from catalog attributes file")
@ParameterizedTest(name = "with output to {0}")
@EnumSource(
value = DiagramOutputFormat.class,
names = {"scdot", "htmlx"})
public void weakAssociations_01(
final OutputFormat outputFormat,
final TestContext testContext,
final DatabaseConnectionSource dataSource)
throws Exception {
super.weakAssociations_01(outputFormat, testContext, dataSource);
}

@Override
@DisplayName("Weak associations loaded with remarks")
@ParameterizedTest(name = "with output to {0}")
@EnumSource(
value = DiagramOutputFormat.class,
names = {"scdot", "htmlx"})
public void weakAssociations_02(
final OutputFormat outputFormat,
final TestContext testContext,
final DatabaseConnectionSource dataSource)
throws Exception {
super.weakAssociations_02(outputFormat, testContext, dataSource);
}

@Override
@DisplayName("Weak associations loaded with remarks, but hiding remarks")
@ParameterizedTest(name = "with output to {0}")
@EnumSource(
value = DiagramOutputFormat.class,
names = {"scdot", "htmlx"})
public void weakAssociations_03(
final OutputFormat outputFormat,
final TestContext testContext,
final DatabaseConnectionSource dataSource)
throws Exception {
super.weakAssociations_03(outputFormat, testContext, dataSource);
}
}
Loading
Loading