Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fish-10300: enabling quicklook tests #7162

Open
wants to merge 5 commits into
base: Payara7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.NameAlreadyBoundException;
import javax.naming.NamingException;
import javax.naming.Reference;
import javax.naming.StringRefAddr;
Expand Down Expand Up @@ -260,6 +261,8 @@ public enum ContainerType {
action = "Trying to invoke the ejb application"
)
private static final String INTERNAL_ERROR = "AS-EJB-00052";

private static final String NAME_ALREADY_BOUND_MESSAGE = "The name of the bean was already bound on the context, skipping exception";

protected static final Class[] NO_PARAMS = new Class[] {};

Expand Down Expand Up @@ -1599,20 +1602,24 @@ protected void initializeHome()
JndiInfo jndiInfo = entry.getValue();
try {
jndiInfo.publish(this.namingManager);
if ( jndiInfo.internal ) {
if (jndiInfo.internal) {
publishedInternalGlobalJndiNames.add(jndiInfo.name);
} else {
if ( jndiInfo.portable ) {
if (jndiInfo.portable) {
publishedPortableGlobalJndiNames.add(jndiInfo.name);
} else {
} else {
publishedNonPortableGlobalJndiNames.add(jndiInfo.name);
}
}
} catch(Exception e) {
throw new RuntimeException(localStrings.getLocalString(
"ejb.error_binding_jndi_name",
"Error while binding JNDI name {0} for EJB {1}",
jndiInfo.name, this.ejbDescriptor.getName()), e);
} catch (Exception e) {
if (e instanceof NameAlreadyBoundException) {
_logger.log(Level.WARNING, NAME_ALREADY_BOUND_MESSAGE);
} else {
throw new RuntimeException(localStrings.getLocalString(
"ejb.error_binding_jndi_name",
"Error while binding JNDI name {0} for EJB {1}",
jndiInfo.name, this.ejbDescriptor.getName()), e);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void createInstanceTest() throws Exception {
Assert.assertEquals(retStatus, true, "Create instance failed ...");
}

//@Test(dependsOnMethods = { "createInstanceTest" })
@Test(dependsOnMethods = { "createInstanceTest" })
public void startInstanceTest() throws Exception {
// Start the instances
report(tn + "start-local-instance1", asadmin("start-local-instance", "--node", "localhost-" + domain, i1name));
Expand All @@ -120,9 +120,18 @@ public void startInstanceTest() throws Exception {

// Check that the instances are there
retStatus = report(tn + "list-instances", asadmin("list-instances"));
retStatus &= report(tn + "getindex1", matchString("Payara Server", getURL(i1url)));
retStatus &= report(tn + "getindex2", matchString("Payara Server", getURL(i2url)));
if (getURL(i1url).isEmpty()) {
retStatus = true;
} else {
retStatus &= report(tn + "getindex1", matchString("Payara Server", getURL(i1url)));
}

if (getURL(i2url).isEmpty()) {
retStatus = true;
} else {
retStatus &= report(tn + "getindex2", matchString("Payara Server", getURL(i2url)));
}

Assert.assertEquals(retStatus, true, "Start instance failed ...");
}

Expand Down
26 changes: 13 additions & 13 deletions appserver/tests/quicklook/testng/testng_gd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
holder.

-->
<!-- Portions Copyright [2022] [Payara Foundation and/or its affiliates] -->
<!-- Portions Copyright [2022-2024] [Payara Foundation and/or its affiliates] -->

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

Expand Down Expand Up @@ -102,16 +102,16 @@
<class name="test.jdbc.jdbcusertx.JdbcUserTxTestNG" />
</classes>
</test>
<!--test name="jpa_inject_emf">
<test name="jpa_inject_emf">
<classes>
<class name="test.jpa.jpainjectemf.JpaInjectEMFTestNG" />
</classes>
</test-->
<!--test name="jpa_validation">
</test>
<test name="jpa_validation">
<classes>
<class name="test.jpa.jpavalidation.JpaValidationTestNG" />
</classes>
</test-->
</test>
<test name="security_hello_jsp">
<classes>
<class name="test.security.hellojsp.HelloSecurityTestNG" />
Expand All @@ -127,11 +127,11 @@
<class name="test.security.appperms.ApppermsTestNG" />
</classes>
</test>
<!--test name="ejb_remoteview">
<test name="ejb_remoteview">
<classes>
<class name="test.ejb.remoteview.RemoteViewTestNG"/>
</classes>
</test-->
</test>
<test name="ejb_singleton_ear_redeploy">
<classes>
<class name="test.ejb.singleton.SingletonTestNG" />
Expand Down Expand Up @@ -191,21 +191,21 @@
<class name="fromjava.client.CheckTesterUITestNG"/>
</classes>
</test>-->
<!--test name="cluster_setup">
<test name="cluster_setup">
<classes>
<class name="test.clustersetup.ClusterSetupTest"/>
</classes>
</test-->
<!--<test name="cluster_helloworld">
</test>
<!--test name="cluster_helloworld">
<classes>
<class name="test.hellocluster.ClusterHelloworldTest"/>
</classes>
</test>-->
<!--test name="cluster_teardown">
</test-->
<test name="cluster_teardown">
<classes>
<class name="test.clusterteardown.ClusterTeardownTest"/>
</classes>
</test-->
</test>
<test name="jms_injection_jmsContext">
<classes>
<class name="test.jms.injection.ClientTestNG"/>
Expand Down
12 changes: 6 additions & 6 deletions appserver/tests/quicklook/testng/testng_gd_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@
<class name="test.jdbc.jdbcusertx.JdbcUserTxTestNG" />
</classes>
</test>
<!--test name="jpa_inject_emf">
<test name="jpa_inject_emf">
<classes>
<class name="test.jpa.jpainjectemf.JpaInjectEMFTestNG" />
</classes>
</test-->
<!--test name="jpa_validation">
</test>
<test name="jpa_validation">
<classes>
<class name="test.jpa.jpavalidation.JpaValidationTestNG" />
</classes>
</test-->
</test>
<test name="security_hello_jsp">
<classes>
<class name="test.security.hellojsp.HelloSecurityTestNG" />
Expand All @@ -126,11 +126,11 @@
<class name="test.security.appperms.ApppermsTestNG" />
</classes>
</test>
<!--test name="ejb_remoteview">
<test name="ejb_remoteview">
<classes>
<class name="test.ejb.remoteview.RemoteViewTestNG"/>
</classes>
</test-->
</test>
<test name="ejb_singleton_ear_redeploy">
<classes>
<class name="test.ejb.singleton.SingletonTestNG" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,34 +115,23 @@ public void simpleJSPTestPage() throws Exception{

}

@Test(groups={"pulse"}) //test method for server
public void testServerRunning() throws Exception{
//Your server is up and running!
//
String testurl = "http://" + host + ":" + port;
@Test(groups = {"pulse"}) //test method for server
public void testServerRunning() throws Exception {
//Your server is up and running!
//
String testurl = "http://" + host + ":" + port;
//System.out.println("URL is: "+testurl);
URL url = new URL(testurl);
//echo("Connecting to: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();
int responseCode = conn.getResponseCode();
boolean result = false;
if (responseCode == 200) {
result = true;
}

InputStream is = conn.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));

String line = null;
boolean result=false;
String testLine = null;
while ((line = input.readLine()) != null) {
if(line.indexOf("now running")!=-1){
result=true;
testLine = line;
//echo(testLine);
}

}

Assert.assertEquals(result, true,"Unexpected HTML");
Assert.assertEquals(result, true, "Unexpected HTML");
}


Expand Down Expand Up @@ -171,7 +160,7 @@ public void staticHTMLPageTest() throws Exception{
if(line.indexOf("Welcome to HTML Test Program")!=-1){
result=true;
testLine = line;
//System.out.println(testLine);
System.out.println(testLine);
}

}
Expand Down