db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-1115) Write a test that ensures that code that translates a message id into a message does so correctly
Date Sat, 17 Aug 2013 00:25:48 GMT

    [ https://issues.apache.org/jira/browse/DERBY-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742752#comment-13742752

ASF subversion and git services commented on DERBY-1115:

Commit 1514927 from [~bryanpendleton] in branch 'code/trunk'
[ https://svn.apache.org/r1514927 ]

DERBY-6299: Improve code coverage of org.apache.derby.iapi.services.sanity

This patch was contributed by Ahsan Shamsudeen (ahsan dot competition at gmail dot com)

This patch removes the classes SanityManager and AssertFailure from the
org.apache.derby.iapi.services.sanity package, replacing all uses of those
classes with references to the same-named classes in the
org.apache.derby.shared.common.sanity package.

This change is a follow-on to DERBY-1115, which moved the body of these
classes to the new location, but left the old classes around as wrappers.

Removing the wrapper classes simplifies the code, but is not intended to have
any other effect. There are no known bugs fixed by these changes, although
as pointed out during review, there may be behavior changes as a result of
this change. For example, code which specifies

	if (re instanceof AssertFailure)

may have different behavior now, since it is testing for an instance of the
underlying type, not an instance of the wrapper type.

This change affects a large set of files, but the change itself is quite simple.

Each of the files has a diff roughly like:

-import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.shared.common.sanity.SanityManager;
In addition to modifying the import statement in all such .java files, we are
also deleting the two files

D       java\engine\org\apache\derby\iapi\services\sanity\AssertFailure.java
D       java\engine\org\apache\derby\iapi\services\sanity\SanityManager.java

These two files, left over from DERBY-1115, are trivial wrappers around the
same-named classes in o.a.d.shared.common.sanity package.

So all we're doing, then, is following up on DERBY-1115 by fixing the import
statements and removing the two wrapper classes.

So it's a big change, but conceptually quite simple.
> Write a test that ensures that code that translates a message id into a message does
so correctly
> -------------------------------------------------------------------------------------------------
>                 Key: DERBY-1115
>                 URL: https://issues.apache.org/jira/browse/DERBY-1115
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions:
>            Reporter: David Van Couvering
>            Priority: Minor
>             Fix For:
>         Attachments: genClient1.sed, genClient2.sed, generateClientMessageTest.sh, README,
> After finding, in my and others' code, a number of situations where we used a message
id with no matching message, or used the incorrect number of parameters for an internationalized
message, I became determined to write a test that tries to track down these bugs, a kind of
"i18n lint".  
> It's very hard, almost impossible, to test these invocations of message formatting through
a normal  unit test, because basically you have to write a full suite of negative tests.
> This bug is a placeholder for some work I am doing to accomplish this task using code
parsing rather than trying to execute negative tests.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message