You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by GodenYao <gi...@git.apache.org> on 2015/12/01 01:10:47 UTC

[GitHub] incubator-hawq pull request: HAWQ-120. Descriptive error message i...

Github user GodenYao commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/123#discussion_r46224008
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/utilities/UtilitiesTest.java ---
    @@ -45,4 +48,26 @@ public void byteArrayToOctalString() throws Exception {
             assertEquals(orig.length() + (octal.length() * 5), sb.length());
             assertEquals(expected, sb.toString());
         }
    +
    +    @Test
    +    public void createAnyInstanceOldPackageName() throws Exception {
    +
    +        InputData metaData = mock(InputData.class);
    +        String className = "com.pivotal.pxf.Lucy";
    +        ClassNotFoundException exception = new ClassNotFoundException(className);
    +        PowerMockito.mockStatic(Class.class);
    +        when(Class.forName(className)).thenThrow(exception);
    +
    +        try {
    +            Utilities.createAnyInstance(InputData.class,
    +                    className, metaData);
    +            fail("creating an instance should fail because the class doesn't exist in classpath");
    +        } catch (Exception e) {
    +            assertEquals(e.getClass(), Exception.class);
    +            assertEquals(
    +                    e.getMessage(),
    +                    "Class " + className + " doesn't not appear in classpath. "
    --- End diff --
    
    typo: "doesn't not"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---