hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GodenYao <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-120. Descriptive error message i...
Date Tue, 01 Dec 2015 00:10:47 GMT
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.
---

Mime
View raw message