Skip to content

Commit

Permalink
Merge branch 'apichanges' of https://github.com/akeefer/Tosa into api…
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
Carson Gross committed Jan 20, 2012
2 parents a67be44 + b38ded3 commit 8379d0b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 37 deletions.
46 changes: 11 additions & 35 deletions pom.xml
Expand Up @@ -9,34 +9,20 @@


<name>Tosa</name> <name>Tosa</name>


<parent>
<groupId>org.gosu-lang</groupId>
<artifactId>gosu-project-parent</artifactId>
<version>2</version>
</parent>

<repositories> <repositories>
<repository> <repository>
<snapshots> <id>gosu-lang.org-releases</id>
<enabled>true</enabled> <name>Official Gosu website (releases)</name>
</snapshots> <url>http://gosu-lang.org/repositories/m2/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<id>gosu-lang.org</id>
<name>Official Gosu website</name>
<url>http://gosu-lang.org/m2</url>
</repository> </repository>
</repositories> </repositories>


<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
<id>gosu-lang.org</id>
<name>Official Gosu website</name>
<url>http://gosu-lang.org/m2</url>
</pluginRepository>
</pluginRepositories>

<dependencies> <dependencies>
<dependency> <dependency>
<groupId>commons-dbcp</groupId> <groupId>commons-dbcp</groupId>
Expand Down Expand Up @@ -96,15 +82,6 @@
<plugin> <plugin>
<groupId>org.gosu-lang</groupId> <groupId>org.gosu-lang</groupId>
<artifactId>maven-gosu-plugin</artifactId> <artifactId>maven-gosu-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>insert-gosu-artifact</goal>
</goals>
</execution>
</executions>
<configuration> <configuration>
<gosuVersion>0.9-SNAPSHOT</gosuVersion> <gosuVersion>0.9-SNAPSHOT</gosuVersion>
<includeImpl>true</includeImpl> <!-- TODO: naughty, naughty --> <includeImpl>true</includeImpl> <!-- TODO: naughty, naughty -->
Expand All @@ -113,16 +90,15 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration> <configuration>
<archive> <archive>
<manifest> <manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest> </manifest>
<manifestEntries> <manifestEntries>
<Gosu-Typeloaders>tosa.loader.DBTypeLoader</Gosu-Typeloaders> <Gosu-Typeloaders>tosa.loader.DBTypeLoader</Gosu-Typeloaders>
<Contains-Sources>gs, gsx</Contains-Sources> <Contains-Sources>gs, gsx</Contains-Sources>
</manifestEntries> </manifestEntries>
</archive> </archive>
</configuration> </configuration>
</plugin> </plugin>
Expand Down
4 changes: 4 additions & 0 deletions src/tosa/loader/DBTypeLoader.java
Expand Up @@ -294,4 +294,8 @@ public void init() {
public void uninit() { public void uninit() {
// TODO - AHK // TODO - AHK
} }

public List<IType> getTypesForFile(IFile file) {
return Collections.emptyList();
}
} }
4 changes: 4 additions & 0 deletions test/test/TestEnv.java
Expand Up @@ -2,6 +2,8 @@


import gw.lang.reflect.TypeSystem; import gw.lang.reflect.TypeSystem;
import gw.lang.shell.Gosu; import gw.lang.shell.Gosu;
import tosa.api.DBLocator;
import tosa.api.IDatabase;
import tosa.loader.DBTypeLoader; import tosa.loader.DBTypeLoader;


public class TestEnv { public class TestEnv {
Expand All @@ -10,6 +12,8 @@ public static synchronized void maybeInit() {
if (!_inited) { if (!_inited) {
Gosu.init(); Gosu.init();
TypeSystem.pushTypeLoader(new DBTypeLoader()); TypeSystem.pushTypeLoader(new DBTypeLoader());
IDatabase database = DBLocator.getDatabase("test.testdb");
database.setJdbcUrl("jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1");
_inited = true; _inited = true;
} }
} }
Expand Down
1 change: 0 additions & 1 deletion test/tosa/loader/SQLTypeInfoTest.gs
Expand Up @@ -115,7 +115,6 @@ class SQLTypeInfoTest {
function testBasicBetweenComparisonWorks() { function testBasicBetweenComparisonWorks() {
var result = test.query.SampleBetweenQuery.select("1/1/2001".toDate(), "1/1/2101".toDate()) var result = test.query.SampleBetweenQuery.select("1/1/2001".toDate(), "1/1/2101".toDate())
Assert.assertEquals(1, result.Count) Assert.assertEquals(1, result.Count)
test.testdb.Database.JdbcUrl = "blah"
result = test.query.SampleBetweenQuery.select("1/1/2101".toDate(), "1/1/2101".toDate()) result = test.query.SampleBetweenQuery.select("1/1/2101".toDate(), "1/1/2101".toDate())
Assert.assertEquals(0, result.Count) Assert.assertEquals(0, result.Count)
} }
Expand Down
3 changes: 2 additions & 1 deletion test/tosa/loader/TosaTestDBInit.gs
Expand Up @@ -8,7 +8,8 @@ class TosaTestDBInit {
static function createDatabase() { static function createDatabase() {
var dbTypeLoader = TypeSystem.getTypeLoader(DBTypeLoader) var dbTypeLoader = TypeSystem.getTypeLoader(DBTypeLoader)
var database = DBLocator.getDatabase( "test.testdb" ) var database = DBLocator.getDatabase( "test.testdb" )
database.JdbcUrl = "jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;TRACE_LEVEL_SYSTEM_OUT=2" // database.JdbcUrl = "jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;TRACE_LEVEL_SYSTEM_OUT=2"
database.JdbcUrl = "jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1"
database.DBUpgrader.recreateTables() database.DBUpgrader.recreateTables()
} }


Expand Down

0 comments on commit 8379d0b

Please sign in to comment.