-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
how to use the library as a simple sql query catalog.
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/java/test/org/fugerit/java/query/export/tool/TestCatalogAlt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package test.org.fugerit.java.query.export.tool; | ||
|
||
import org.fugerit.java.core.cfg.ConfigRuntimeException; | ||
import org.fugerit.java.core.function.SafeFunction; | ||
import org.fugerit.java.core.util.collection.ListMapStringKey; | ||
import org.fugerit.java.query.export.catalog.QueryConfig; | ||
import org.fugerit.java.query.export.catalog.QueryConfigCatalog; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
public class TestCatalogAlt extends TestBase { | ||
|
||
@Test | ||
public void testCatalogAlt() throws IOException, SQLException { | ||
QueryConfigCatalog catalog = QueryConfigCatalog.loadQueryConfigCatalogSafe("cl://sample/query-catalog-sample-alt.xml"); | ||
QueryConfig queryConfig = catalog.getListMap( "sample-catalog-alt" ).get( "Q001ALT" ); | ||
logger.info( "query config : {}, sql : {}", queryConfig, queryConfig.getSql() ); | ||
Assert.assertEquals( "SELECT * FROM test_export", queryConfig.getSql() ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<query-catalog-config bean-mode="bean-xml-full"> | ||
|
||
<query-catalog id="sample-catalog-alt"> | ||
<query id="Q001ALT" outputFormat="csv" csvSeparator=";" outputFile="target/catalog_test_001.csv"> | ||
<sql>SELECT * FROM test_export</sql> | ||
</query> | ||
</query-catalog> | ||
|
||
</query-catalog-config> |