Skip to content

Commit

Permalink
Merge pull request #6 from eclipse-ee4j/master
Browse files Browse the repository at this point in the history
pull
  • Loading branch information
gerdogdu authored Jun 17, 2020
2 parents 99ff47a + bd34dd8 commit 59dc4d5
Show file tree
Hide file tree
Showing 49 changed files with 88 additions and 51,022 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ public String deploy(DeploymentInfo info) throws TSDeploymentException {
// if either are not ture, then don't get stubs from server

String javaeeLevel = propMgr.getProperty("javaee.level", "full");

if (javaeeLevel.contains("full")) {
getClientClassPath(info);
}

return "";

}
Expand Down Expand Up @@ -566,6 +569,81 @@ private String getAppNameFromApplicationXML(String archivePathAndName) {
return appName;
}

private void getClientClassPath(DeploymentInfo info)
throws TSDeploymentException {
String sAppName = null;
String sEarFile = info.getEarFile();
String sTSDeploymentDir = sEarFile.substring(0,
sEarFile.lastIndexOf(File.separator) + 1) + "ts_dep";

if (sEarFile.endsWith(".ear")) { // Check for an application-name in the
// application.xml
sAppName = getAppNameFromApplicationXML(sEarFile);
}

if (sAppName == null) { // if we didn't have an ear or there was no
// application-name use the old scheme
sAppName = sEarFile.substring(sEarFile.lastIndexOf(File.separator) + 1,
sEarFile.lastIndexOf("."));
}

if (sAppName.startsWith("vi_built_")) {
sAppName = sAppName.substring(9);
sTSDeploymentDir = sEarFile.substring(0,
sEarFile.lastIndexOf(File.separator) + 1) + "ts_dep_vi_built";
}

File ctsDeployDir = new File(sTSDeploymentDir);

// we should only be calling this method with archives that contain an
// appclient

if (!ctsDeployDir.exists()) {
if (!ctsDeployDir.mkdir()) {
throw new TSDeploymentException(
"Failed to create the RI deployment working directory: "
+ sTSDeploymentDir);
}
}

String sStubJar = sTSDeploymentDir;
TestUtil.logHarnessDebug(
"$$$$$$$$$$$ getClientClassPath() sStubJar = \"" + sStubJar + "\"");

try {
String sDeploymentHost = info.getProperty("deployment_host");
String sPropNum = info.getProperty("deployment.props.number");
String sUname = propMgr.getProperty("deployManageruname." + sPropNum);
String sPassword = propMgr.getProperty("deployManagerpasswd." + sPropNum,
"");
int iPort = Integer.parseInt(info.getProperty("deployment_port"));
// TODO: delete the commented out Jakarta Deployment class references
//DeploymentFacility df = DeploymentFacilityFactory.getDeploymentFacility();
//ServerConnectionIdentifier sci = new ServerConnectionIdentifier();
//sci.setHostName(sDeploymentHost);
//sci.setHostPort(iPort);
//sci.setUserName(sUname);
//sci.setPassword(sPassword);

TestUtil.logHarness("V3Deployment sPropNum = " + sPropNum);
TestUtil.logHarness("V3Deployment uname: " + sUname);
TestUtil.logHarness("V3Deployment passwd: " + sPassword);
TestUtil.logHarness("V3Deployment host: " + sDeploymentHost);
TestUtil.logHarness("V3Deployment port: " + iPort);

// sci.setHostName("localhost");
// sci.setHostPort(4848); // 8080 for the REST client
// sci.setUserName("admin");
// sci.setPassword("adminadmin");

// TODO: Delete the commented out Jakarta Deployment class references
//df.connect(sci);
//df.getClientStubs(sTSDeploymentDir, sAppName);
} catch (Exception e) {
e.printStackTrace();
}
}

private void log(String s) {
log.println("GF Deployment: " + s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ public void getRegistrationNameTest() throws Fault {
*/
public void getRegistrationClassNameTest() throws Fault {
TEST_PROPS.setProperty(APITEST, "getRegistrationClassNameTest");
TEST_PROPS.setProperty(SEARCH_STRING, "REGISTRION_CLASS_NAME:"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDSERVLETSTRING"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDFILTERSTRING"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDSERVLETCLASS"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDFILTERCLASS"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.CREATESERVLET"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.CREATEFILTER"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDSERVLETNOTFOUND"
+ "|com.sun.ts.tests.servlet.api.jakarta_servlet.SERVLETCONTEXT30.ADDFILTERNOTFOUND");
TEST_PROPS.setProperty(SEARCH_STRING, "REGISTRATION_CLASS_NAME:"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDSERVLETSTRING"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDFILTERSTRING"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDSERVLETCLASS"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDFILTERCLASS"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.CREATESERVLET"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.CREATEFILTER"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDSERVLETNOTFOUND"
+ "|COM.SUN.TS.TESTS.SERVLET.API.JAKARTA_SERVLET.SERVLETCONTEXT30.ADDFILTERNOTFOUND");
invoke();
}

Expand Down
Loading

0 comments on commit 59dc4d5

Please sign in to comment.