How do you create your own DataTypeFactory and have DBUnit accept it?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you create your own DataTypeFactory and have DBUnit accept it?

Christopher Maier-2
According to http://www.dbunit.org/faq.html#typefactory, I can easily substitute my own implementation of DataTypeFactory to take advantage of any custom data types I have.  I have done this and everything works fine, except for the fact that DBUnit keeps complaining with messages like this:

WARN  [o.d.d.AbstractTableMetaData] : Potential problem found: The configured data type factory 'class org.foo.FooDataTypeFactory' might cause problems with the current database 'PostgreSQL' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=null). If so please request a java-class update via the forums.

How can I get rid of this message?  Looking at AbstractTableMetaData, it seems that unless DBUnit statically knows about your DataTypeFactory, it's going to throw this message.

Thanks,
Chris

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: How do you create your own DataTypeFactory and have DBUnit accept it?

John Hurst-2
Hi,

We fixed this in 2.4.6.

You can now implement the IDbProductRelatable interface in your IDataTypeFactory class. The method getValidDbProducts() returns a list of Strings for the JDBC drivers supported. For PostgreSQL for example, return a list containing the String "PostgreSQL".

Hope this helps.

John Hurst
Wellington, New Zealand

On Tue, Jan 26, 2010 at 5:24 AM, Christopher Maier <[hidden email]> wrote:
According to http://www.dbunit.org/faq.html#typefactory, I can easily substitute my own implementation of DataTypeFactory to take advantage of any custom data types I have.  I have done this and everything works fine, except for the fact that DBUnit keeps complaining with messages like this:

WARN  [o.d.d.AbstractTableMetaData] : Potential problem found: The configured data type factory 'class org.foo.FooDataTypeFactory' might cause problems with the current database 'PostgreSQL' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=null). If so please request a java-class update via the forums.

How can I get rid of this message?  Looking at AbstractTableMetaData, it seems that unless DBUnit statically knows about your DataTypeFactory, it's going to throw this message.

Thanks,
Chris

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




--
Life is interfering with my game

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: How do you create your own DataTypeFactory and have DBUnit accept it?

Christopher Maier-2
Ah, we're on 2.4.5... I'll give this a shot when we upgrade.

Thanks for the help.

Chris

On Mon, Jan 25, 2010 at 12:51 PM, John Hurst <[hidden email]> wrote:
Hi,

We fixed this in 2.4.6.

You can now implement the IDbProductRelatable interface in your IDataTypeFactory class. The method getValidDbProducts() returns a list of Strings for the JDBC drivers supported. For PostgreSQL for example, return a list containing the String "PostgreSQL".

Hope this helps.

John Hurst
Wellington, New Zealand

On Tue, Jan 26, 2010 at 5:24 AM, Christopher Maier <[hidden email]> wrote:
According to http://www.dbunit.org/faq.html#typefactory, I can easily substitute my own implementation of DataTypeFactory to take advantage of any custom data types I have.  I have done this and everything works fine, except for the fact that DBUnit keeps complaining with messages like this:

WARN  [o.d.d.AbstractTableMetaData] : Potential problem found: The configured data type factory 'class org.foo.FooDataTypeFactory' might cause problems with the current database 'PostgreSQL' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=null). If so please request a java-class update via the forums.

How can I get rid of this message?  Looking at AbstractTableMetaData, it seems that unless DBUnit statically knows about your DataTypeFactory, it's going to throw this message.

Thanks,
Chris

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user




--
Life is interfering with my game

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: How do you create your own DataTypeFactory and have DBUnit accept it?

Dr. Chandra Gupta
In reply to this post by John Hurst-2
Hi John Hurst,

Would you know of a way to suppress this annoying warning (because everything else works just fine even though the warning shows up making it a pointless warning) in an xml file? I tried different values for datatypeWarning but to no avail. It would also be great to put an xml section in the dbunit how-to documentation.

Here's the configuration:
 <dbunit driver="${gc.jdbc}"
          url="${CONNECT_URL}"
          userid="${gc.gps.user}"
          password="${gc.gps.password}">
          <dbconfig >
              <property name="datatypeWarning" value="false"/>
          </dbconfig>

All help is much appreciated and the earlier I get a reply the better!! Hope you can resolve this because I don't want to explain why a warning is showing up when I demo this.

Thanks,
Chandra

John Hurst-2 wrote
Hi,

We fixed this in 2.4.6.

You can now implement the IDbProductRelatable interface in your
IDataTypeFactory class. The method getValidDbProducts() returns a list of
Strings for the JDBC drivers supported. For PostgreSQL for example, return a
list containing the String "PostgreSQL".

Hope this helps.

John Hurst
Wellington, New Zealand

On Tue, Jan 26, 2010 at 5:24 AM, Christopher Maier <maier@med.unc.edu>wrote:

> According to http://www.dbunit.org/faq.html#typefactory, I can easily
> substitute my own implementation of DataTypeFactory to take advantage of any
> custom data types I have.  I have done this and everything works fine,
> except for the fact that DBUnit keeps complaining with messages like this:
>
> WARN  [o.d.d.AbstractTableMetaData] : Potential problem found: The
> configured data type factory 'class org.foo.FooDataTypeFactory' might cause
> problems with the current database 'PostgreSQL' (e.g. some datatypes may not
> be supported properly). In rare cases you might see this message because the
> list of supported database products is incomplete (list=null). If so please
> request a java-class update via the forums.
>
> How can I get rid of this message?  Looking at AbstractTableMetaData, it
> seems that unless DBUnit statically knows about your DataTypeFactory, it's
> going to throw this message.
>
> Thanks,
> Chris
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>


--
Life is interfering with my game

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
dbunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: How do you create your own DataTypeFactory and have DBUnit accept it?

Dr. Chandra Gupta
BTW, I am using dbunit-2.4.7.jar

Dr. Chandra Gupta wrote
Hi John Hurst,

Would you know of a way to suppress this annoying warning (because everything else works just fine even though the warning shows up making it a pointless warning) in an xml file? I tried different values for datatypeWarning but to no avail. It would also be great to put an xml section in the dbunit how-to documentation.

Here's the configuration:
 <dbunit driver="${gc.jdbc}"
          url="${CONNECT_URL}"
          userid="${gc.gps.user}"
          password="${gc.gps.password}">
          <dbconfig >
              <property name="datatypeWarning" value="false"/>
          </dbconfig>

All help is much appreciated and the earlier I get a reply the better!! Hope you can resolve this because I don't want to explain why a warning is showing up when I demo this.

Thanks,
Chandra

John Hurst-2 wrote
Hi,

We fixed this in 2.4.6.

You can now implement the IDbProductRelatable interface in your
IDataTypeFactory class. The method getValidDbProducts() returns a list of
Strings for the JDBC drivers supported. For PostgreSQL for example, return a
list containing the String "PostgreSQL".

Hope this helps.

John Hurst
Wellington, New Zealand

On Tue, Jan 26, 2010 at 5:24 AM, Christopher Maier <maier@med.unc.edu>wrote:

> According to http://www.dbunit.org/faq.html#typefactory, I can easily
> substitute my own implementation of DataTypeFactory to take advantage of any
> custom data types I have.  I have done this and everything works fine,
> except for the fact that DBUnit keeps complaining with messages like this:
>
> WARN  [o.d.d.AbstractTableMetaData] : Potential problem found: The
> configured data type factory 'class org.foo.FooDataTypeFactory' might cause
> problems with the current database 'PostgreSQL' (e.g. some datatypes may not
> be supported properly). In rare cases you might see this message because the
> list of supported database products is incomplete (list=null). If so please
> request a java-class update via the forums.
>
> How can I get rid of this message?  Looking at AbstractTableMetaData, it
> seems that unless DBUnit statically knows about your DataTypeFactory, it's
> going to throw this message.
>
> Thanks,
> Chris
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>


--
Life is interfering with my game

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
dbunit-user mailing list
dbunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbunit-user