Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25134

NPE in TestHiveCli.java

    XMLWordPrintableJSON

Details

    • Test
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Beeline, Test

    Description

      @Before
      public void setup() throws IOException, URISyntaxException {
        System.setProperty("datanucleus.schema.autoCreateAll", "true");
        cli = new HiveCli();
        initFromFile();
        redirectOutputStream();
      }
      

      In setup(), initFromFile() may access err before initialization

       

       

      [ERROR] org.apache.hive.beeline.cli.TestHiveCli.testSetPromptValue  Time elapsed: 1.167 s  <<< ERROR!
      java.lang.NullPointerException
              at org.apache.hive.beeline.cli.TestHiveCli.executeCMD(TestHiveCli.java:249)
              at org.apache.hive.beeline.cli.TestHiveCli.initFromFile(TestHiveCli.java:315)
              at org.apache.hive.beeline.cli.TestHiveCli.setup(TestHiveCli.java:288)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
              at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
              at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
              at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
      
      

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lalapala gaozhan ding
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m