Giter Site home page Giter Site logo

Comments (5)

scottmarlow avatar scottmarlow commented on August 10, 2024

Call stack for "archiveName" is null issue is below:

Jul 19, 2024 3:31:49 PM tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe$testClassVisitor visitClassDeclaration
INFO: due to Cannot invoke "String.endsWith(String)" because "archiveName" is null classcom.sun.ts.tests.ejb30.zombie.Client couldn't be processed.
java.lang.NullPointerException: Cannot invoke "String.endsWith(String)" because "archiveName" is null
at tck.jakarta.platform.ant.Lib.setArchiveName(Lib.java:14)
at tck.jakarta.platform.ant.Ear.addJarResources(Ear.java:34)
at tck.jakarta.platform.ant.TsTaskListener.targetFinished(TsTaskListener.java:69)
at org.apache.tools.ant.Project.fireTargetFinished(Project.java:2180)
at org.apache.tools.ant.Target.performTasks(Target.java:475)
at tck.jakarta.platform.ant.PackageTarget.execute(PackageTarget.java:409)
at tck.jakarta.platform.ant.api.TestPackageInfoBuilder.parseNonVehiclePackage(TestPackageInfoBuilder.java:203)
at tck.jakarta.platform.ant.api.TestPackageInfoBuilder.buildTestClients(TestPackageInfoBuilder.java:142)
at tck.jakarta.platform.ant.api.TestPackageInfoBuilder.buildTestPackgeInfo(TestPackageInfoBuilder.java:97)
at tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe$testClassVisitor.visitClassDeclaration(GenerateNewTestClassRecipe.java:184)
at tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe$testClassVisitor.visitClassDeclaration(GenerateNewTestClassRecipe.java:97)

from jakartaee-tck-tools.

starksm64 avatar starksm64 commented on August 10, 2024

The archiveName is null issue should be fixed.

from jakartaee-tck-tools.

starksm64 avatar starksm64 commented on August 10, 2024

For the compilation errors, you need to be picking up the test class from the tckrefactor branch, not the tck dist.

The tckrefactor source (ejb30/src/main/java/com/sun/ts/tests/ejb30/misc/threebeans/Client.java) throws Exception:

/*
 * Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

/*
 * $Id$
 */
package com.sun.ts.tests.ejb30.misc.threebeans;

import java.util.Properties;

import com.sun.javatest.Status;
import com.sun.ts.lib.harness.EETest;
import com.sun.ts.tests.ejb30.common.helper.TLogger;
import com.sun.ts.tests.ejb30.common.helper.TestFailedException;

import jakarta.ejb.EJB;
import jakarta.ejb.EJBException;

public class Client extends EETest {

  @EJB
  private static OneRemoteIF oneRemote;

  @EJB
  private static TwoRemoteIF twoRemote;

  @EJB(beanName = "ThreeBean")
  private static ThreeRemoteIF threeRemote;

  @EJB(beanName = "FourBean")
  private static ThreeRemoteIF fourRemote;

  public static void main(String[] args) {
    Client theTests = new Client();
    Status s = theTests.run(args, System.out, System.err);
    s.exit();
  }

  /*
   * @class.setup_props:
   */
  public void setup(String[] args, Properties p) throws Exception {
  }

  public void cleanup() throws Exception {

  }

  /*
   * @testName: testOne
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testOne() throws Exception {
    final String expected = "OneBean";
    String beanName = oneRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testException
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testException() throws TestFailedException {
    final String expected = "testException";
    String result = oneRemote.testException();
    if (expected.equals(result)) {
      TLogger.log("Got expected result: " + expected);
    } else {
      throw new TestFailedException(
          "Expecting " + expected + ", but got " + result);
    }
    result = twoRemote.testException();
    if (expected.equals(result)) {
      TLogger.log("Got expected result: " + expected);
    } else {
      throw new TestFailedException(
          "Expecting " + expected + ", but got " + result);
    }
  }

  /*
   * @testName: testNumber
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testNumber() throws Exception {
    String expected = int.class.getName();
    String result = oneRemote.testNumber(2);
    if (expected.equals(result)) {
      TLogger.log(
          "Got expected return value from method testNumber(int):" + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + result);
    }
    expected = Integer.class.getName();
    result = oneRemote.testNumber(new Integer(2));
    if (expected.equals(result)) {
      TLogger.log("Got expected return value from method testNumber(Integer):"
          + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + result);
    }
    expected = double.class.getName();
    result = oneRemote.testNumber(2D);
    if (expected.equals(result)) {
      TLogger.log("Got expected return value from method testNumber(double):"
          + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + result);
    }
    try {
      result = oneRemote.testNumber(new Double(2D));
      throw new Exception(
          "Expecting EJBException, but got return value: " + result);
    } catch (EJBException e) {
      TLogger.log("Got expected EJBException", e.toString());
    }
  }

  /*
   * @testName: testTwo
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testTwo() throws Exception {
    final String expected = "TwoBean";
    String beanName = twoRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testThree
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testThree() throws Exception {
    final String expected = "ThreeBean";
    String beanName = threeRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testFour
   * 
   * @assertion_ids:
   * 
   * @test_Strategy: FourBean and ThreeBean implement the same interfaces, and
   * inject each other.
   */
  public void testFour() throws Exception {
    final String expected = "FourBean";
    String beanName = fourRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Exception("Expecting " + expected + ", but got " + beanName);
    }
  }
}

The tck dist src (src/com/sun/ts/tests/ejb30/misc/threebeans/Client.java) and throws Fault:

/*
 * Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0, which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the
 * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
 * version 2 with the GNU Classpath Exception, which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 */

/*
 * $Id$
 */
package com.sun.ts.tests.ejb30.misc.threebeans;

import java.util.Properties;

import com.sun.javatest.Status;
import com.sun.ts.lib.harness.EETest;
import com.sun.ts.tests.ejb30.common.helper.TLogger;
import com.sun.ts.tests.ejb30.common.helper.TestFailedException;

import jakarta.ejb.EJB;
import jakarta.ejb.EJBException;

public class Client extends EETest {

  @EJB
  private static OneRemoteIF oneRemote;

  @EJB
  private static TwoRemoteIF twoRemote;

  @EJB(beanName = "ThreeBean")
  private static ThreeRemoteIF threeRemote;

  @EJB(beanName = "FourBean")
  private static ThreeRemoteIF fourRemote;

  public static void main(String[] args) {
    Client theTests = new Client();
    Status s = theTests.run(args, System.out, System.err);
    s.exit();
  }

  /*
   * @class.setup_props:
   */
  public void setup(String[] args, Properties p) throws Fault {
  }

  public void cleanup() throws Fault {

  }

  /*
   * @testName: testOne
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testOne() throws Fault {
    final String expected = "OneBean";
    String beanName = oneRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testException
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testException() throws TestFailedException {
    final String expected = "testException";
    String result = oneRemote.testException();
    if (expected.equals(result)) {
      TLogger.log("Got expected result: " + expected);
    } else {
      throw new TestFailedException(
          "Expecting " + expected + ", but got " + result);
    }
    result = twoRemote.testException();
    if (expected.equals(result)) {
      TLogger.log("Got expected result: " + expected);
    } else {
      throw new TestFailedException(
          "Expecting " + expected + ", but got " + result);
    }
  }

  /*
   * @testName: testNumber
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testNumber() throws Fault {
    String expected = int.class.getName();
    String result = oneRemote.testNumber(2);
    if (expected.equals(result)) {
      TLogger.log(
          "Got expected return value from method testNumber(int):" + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + result);
    }
    expected = Integer.class.getName();
    result = oneRemote.testNumber(new Integer(2));
    if (expected.equals(result)) {
      TLogger.log("Got expected return value from method testNumber(Integer):"
          + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + result);
    }
    expected = double.class.getName();
    result = oneRemote.testNumber(2D);
    if (expected.equals(result)) {
      TLogger.log("Got expected return value from method testNumber(double):"
          + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + result);
    }
    try {
      result = oneRemote.testNumber(new Double(2D));
      throw new Fault(
          "Expecting EJBException, but got return value: " + result);
    } catch (EJBException e) {
      TLogger.log("Got expected EJBException", e.toString());
    }
  }

  /*
   * @testName: testTwo
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testTwo() throws Fault {
    final String expected = "TwoBean";
    String beanName = twoRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testThree
   * 
   * @assertion_ids:
   * 
   * @test_Strategy:
   */
  public void testThree() throws Fault {
    final String expected = "ThreeBean";
    String beanName = threeRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + beanName);
    }
  }

  /*
   * @testName: testFour
   * 
   * @assertion_ids:
   * 
   * @test_Strategy: FourBean and ThreeBean implement the same interfaces, and
   * inject each other.
   */
  public void testFour() throws Fault {
    final String expected = "FourBean";
    String beanName = fourRemote.getShortName();
    if (expected.equals(beanName)) {
      TLogger.log("Got expected beanName: " + expected);
    } else {
      throw new Fault("Expecting " + expected + ", but got " + beanName);
    }
  }
}

from jakartaee-tck-tools.

starksm64 avatar starksm64 commented on August 10, 2024

For this error:

[ERROR] platformtck/ejb30/src/main/java/com/sun/ts/tests/ejb30/misc/sameejbclass/ClientTest.java:[109,18] method setTestDir in class com.sun.ts.tests.common.webclient.BaseUrlClient cannot be applied to given types;
[ERROR] required: java.lang.String
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length

you must be pulling in method names that do not have the @testname tag. The BaseUrlClient#setTestDir(String) method is not a test method.

from jakartaee-tck-tools.

scottmarlow avatar scottmarlow commented on August 10, 2024

Closing as we aren't seeing the reported problems anymore.

from jakartaee-tck-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.