Comments (5)
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.
The archiveName is null issue should be fixed.
from jakartaee-tck-tools.
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.
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.
Closing as we aren't seeing the reported problems anymore.
from jakartaee-tck-tools.
Related Issues (20)
- Integrate the tck-rewrite-ant into the tck-rewrite-tools module HOT 2
- Need to handle non-vehicle deployment methods HOT 2
- Need to update ant lib deployment method generation to handle common archives HOT 1
- com.sun.ts.tests.ejb30.assembly.librarydirectory.custom.Client is throwing com.sun.ts.tests.ejb30.common.helper.TestFailedException HOT 6
- Getting `The pkg path does not contain a build.xml file` failure with latest changes HOT 6
- Non-javadoc comment associated with method that does not apply to the method HOT 3
- tck-rewrite-fx needs to update Java variable names derived from problematic TCK archive names like `4common-1.0.1.jar` HOT 2
- tck-rewrite-ant (TestPackageInfoBuilder) needs additional mappings for Mappings from EE11 to EE10 package prefixes
- Correct tck-rewrite-ant syntax error in output HOT 6
- Generate JsfClientEjblitejsfTest.java for input JsfClient.java instead of ClientEjblitejsfTest.java which conflicts with input Client.java
- Fix empty test method problem HOT 4
- tck-rewrite should also parse Javadoc testName and check for duplicate method names.
- Need to support more test properties
- The test_classname may need to be the test class
- Some additional code generation problems for the EE JPA tests with nested class references HOT 6
- Incorrect class name is used when the generated test class requires a number to be added (e.g. Client.class in EE 10 but was split into Client1/2/3/4 in EE 11) HOT 9
- Missing ear lib that leads to compile error in generated code for unknown jpa_ee_propagation_cm_ext variable HOT 6
- Follow up on `Closed Missing ear lib that leads to compile error in generated code for unknown jpa_ee_propagation_cm_ext variable` HOT 5
- EE11toEE10Mapping#getEE11Name(String ee10Name) needs to handle correcting nested classes in base test class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jakartaee-tck-tools.