protected void buildSchema() {
if (!buildSchemaExecuted) {
executeScript("file:src/test/generated/resources/dbunit/ddl.sql");
executeScript("file:src/test/generated/resources/dbunit/ddl_additional.sql");
buildSchemaExecuted = true;
}
};
Help appreciated.
I have searched GIT codebase for some hints as to what I could do but nothing really jumped out at me.
Thanks,
Richie.
--
You received this message because you are subscribed to a topic in the Google Groups "Sculptor Generator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sculptorgenerator/xL7UKQDg-Ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sculptorgenera...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class PropertiesOverride extends Properties{
@Inject extension PropertiesBase propertiesBase
override String databaseJpaTestCaseClass() {
"com.taskize.repository.AbstractDbUnitJpaTests"
}
}
However the Java code generated is coming up with some issues.
A java class called PropertiesOverride is created.
It seems to think that the following property should exist.
org.sculptor.generator.ext.PropertiesMethodIndexes.DATABASEJPATESTCASECLASS
And also that Properties should have a method called ._chained_databaseJpaTestCaseClass();
Also as its not a Tmpl class I am not sure if I should call my class PropertiesImplOverride or just PropertiesOverride.
I am trying to override the Base Test class from AbstractDbUnitJpaTests to be my own base test class. . Here is the code that I have overridden in the extension classes.@ChainOverrideclass PropertiesOverride extends Properties{
@Inject extension PropertiesBase propertiesBase
override String databaseJpaTestCaseClass() {
"com.taskize.repository.AbstractDbUnitJpaTests"
}
}
However the Java code generated is coming up with some issues.
A java class called PropertiesOverride is created.
It seems to think that the following property should exist.
org.sculptor.generator.ext.PropertiesMethodIndexes.DATABASEJPATESTCASECLASS
And also that Properties should have a method called ._chained_databaseJpaTestCaseClass();
Also as its not a Tmpl class I am not sure if I should call my class PropertiesImplOverride or just PropertiesOverride.
On 25 October 2015 at 14:16, Richard Walsh wrote:
Yes, makes sense, looking into all that now.I think I will also write extensions to migrate all tests onto annotations rather than XML as it will help me with some of the setup required.Now that I know how extensions work thats all actually pretty straight forward.
On 23 October 2015 at 19:04, Torsten Juergeleit wrote:How about overriding buildSchema() in your generated unit test class?
Or how about creating your own subclass of AbstractDUnitJpaTest which implements buildSchema() in a generic way (e.g. by requesting a list of schema files via an abstract method) and use this subclass with your unit tests?
/Torsten
On Thursday, October 22, 2015 at 7:55:21 PM UTC+2, richard.walsh wrote:Hi -I am trying to figure out how to add some SQL to the DDL that is run at Unit Test time to populate Hypersonic.We have a situation where we need to run a number of different schemas and we also have our own sequence_ ID generators. Once for each entity in each schema.So the setup required for tests wont work out of the box.How can we amend this behaviour?I have noticed that the AbstractDUnitJpaTest.class has a method that looks for additional sql in the generated directories, but as its looking under generated this sql gets wiped.protected void buildSchema() {
if (!buildSchemaExecuted) {
executeScript("file:src/test/generated/resources/dbunit/ddl.sql");
executeScript("file:src/test/generated/resources/dbunit/ddl_additional.sql");
buildSchemaExecuted = true;
}
};
Help appreciated.
I have searched GIT codebase for some hints as to what I could do but nothing really jumped out at me.
Thanks,
Richie.
--
You received this message because you are subscribed to a topic in the Google Groups "Sculptor Generator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sculptorgenerator/xL7UKQDg-Ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sculptorgenera...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Is that really all I have to do.
Having set framework.test.AbstractDbUnitJpaTests=com.taskize.repository.AbstractDbUnitJpaTests in sculptor.generator.properties the Test Classes are still pointing to the scultpor class of the same name!
Is that really all I have to do.Having set framework.test.AbstractDbUnitJpaTests=com.taskize.repository.AbstractDbUnitJpaTests in sculptor.generator.properties the Test Classes are still pointing to the scultpor class of the same name!
--
You received this message because you are subscribed to a topic in the Google Groups "Sculptor Generator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sculptorgenerator/xL7UKQDg-Ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sculptorgenera...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.