Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #807 from jeffgbutler/ui-tests
Add UI Test Fragment
- Loading branch information
Showing
11 changed files
with
118 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
9 changes: 9 additions & 0 deletions
9
eclipse/org.mybatis.generator.eclipse.ui.tests/META-INF/MANIFEST.MF
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 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Tests | ||
Bundle-SymbolicName: org.mybatis.generator.eclipse.ui.tests | ||
Bundle-Version: 1.4.1.qualifier | ||
Fragment-Host: org.mybatis.generator.eclipse.ui;bundle-version="1.4.1" | ||
Automatic-Module-Name: org.mybatis.generator.eclipse.ui.tests | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: org.junit;bundle-version="4.12.0" |
4 changes: 4 additions & 0 deletions
4
eclipse/org.mybatis.generator.eclipse.ui.tests/build.properties
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,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
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,25 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>org.mybatis.generator.eclipse.ui.tests</artifactId> | ||
<packaging>eclipse-test-plugin</packaging> | ||
<parent> | ||
<groupId>org.mybatis.generator</groupId> | ||
<artifactId>org.mybatis.generator.eclipse.parent</artifactId> | ||
<version>1.4.1-SNAPSHOT</version> | ||
<relativePath>../org.mybatis.generator.eclipse.parent</relativePath> | ||
</parent> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-surefire-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<argLine>${jacoco.agent.arg}</argLine> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<name>Core UI Tests</name> | ||
</project> |
30 changes: 30 additions & 0 deletions
30
...tor.eclipse.ui.tests/src/org/mybatis/generator/eclipse/ui/content/ConfigVerifyerTest.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,30 @@ | ||
package org.mybatis.generator.eclipse.ui.content; | ||
|
||
import static org.hamcrest.core.Is.is; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
import java.io.File; | ||
import java.io.InputStream; | ||
|
||
import org.junit.Test; | ||
|
||
public class ConfigVerifyerTest { | ||
|
||
@Test | ||
public void testValidFile() { | ||
ConfigVerifyer cf = new ConfigVerifyer((File) null); | ||
InputStream resource = getClass() | ||
.getResourceAsStream("/org/mybatis/generator/eclipse/ui/content/GoodConfigFile.xml"); | ||
|
||
assertThat(cf.isConfigFile(resource), is(true)); | ||
} | ||
|
||
@Test | ||
public void testInvalidFile() { | ||
ConfigVerifyer cf = new ConfigVerifyer((File) null); | ||
InputStream resource = getClass() | ||
.getResourceAsStream("/org/mybatis/generator/eclipse/ui/content/NotAConfigFile.xml"); | ||
|
||
assertThat(cf.isConfigFile(resource), is(false)); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...enerator.eclipse.ui.tests/src/org/mybatis/generator/eclipse/ui/content/GoodConfigFile.xml
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,36 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE generatorConfiguration | ||
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" | ||
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > | ||
<generatorConfiguration> | ||
<context id="context1" targetRuntime="MyBatis3Simple" > | ||
<jdbcConnection driverClass="org.hsqldb.jdbcDriver" | ||
connectionURL="${jdbcUrl}" | ||
userId="sa" > | ||
</jdbcConnection> | ||
<javaModelGenerator targetPackage="gen.model" targetProject="MBGTest" > | ||
<!-- | ||
<property name="rootClass" value="base.BaseModel" /> | ||
--> | ||
</javaModelGenerator> | ||
<sqlMapGenerator targetPackage="gen.mapper" targetProject="MBGTest" /> | ||
<javaClientGenerator targetPackage="gen.mapper" targetProject="MBGTest" type="XMLMAPPER" /> | ||
<table tableName="a" /> | ||
</context> | ||
|
||
<context id="context2" targetRuntime="MyBatis3Simple" > | ||
<commentGenerator> | ||
<property name="suppressAllComments" value="false"/> | ||
</commentGenerator> | ||
|
||
<connectionFactory type="DEFAULT" > | ||
<property name="driverClass" value="org.hsqldb.jdbcDriver" /> | ||
<property name="connectionURL" value="jdbc:hsqldb:mem:aname" /> | ||
<property name="userId" value="sa" /> | ||
</connectionFactory> | ||
<javaModelGenerator targetPackage="gen.src.model" targetProject="MBGTest/generatedsrc" /> | ||
<sqlMapGenerator targetPackage="gen.src.mapper" targetProject="MBGTest/generatedsrc" /> | ||
<javaClientGenerator targetPackage="gen.src.mapper" targetProject="MBGTest/generatedsrc" type="XMLMAPPER" /> | ||
<table schema="mbgtest" tableName="%" /> | ||
</context> | ||
</generatorConfiguration> |
4 changes: 4 additions & 0 deletions
4
...enerator.eclipse.ui.tests/src/org/mybatis/generator/eclipse/ui/content/NotAConfigFile.xml
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,4 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<baseElement> | ||
<subElement name="fred" /> | ||
</baseElement> |
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