Skip to content

Commit

Permalink
PR: Tests cleanup - round 1 (javaee#22530)
Browse files Browse the repository at this point in the history
* Remove old Junit
* Updating JUnit APIs
* Remove unwanted target directory
* Removing unwanted jars and adding missing classes
  • Loading branch information
yaminikb authored Jun 19, 2018
1 parent c3e7dfd commit 1b1a5ed
Show file tree
Hide file tree
Showing 47 changed files with 3,434 additions and 112 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017-2018 Oracle and/or its affiliates. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -63,7 +63,7 @@
<property name="customtasks.src" value="${testsRoot}/util/customAntTasks"/>
<property name="customtasks.dest" value="${testsRoot}/util/build/customAntTasks"/>
<property name="customtasks.jar" value="${customtasks.dest}/customAntTasks.jar"/>
<property name="junit.jar" value="${env.APS_HOME}/devtests/deployment/extlib/junit-4.3.1.jar" />
<property name="junit.jar" value="${env.APS_HOME}/devtests/deployment/junit-4.12.jar" />
<property name="annotation.report.dir" value="${testsRoot}/annotation/report"/>
<property name="testDomain" value="depltest-domain"/>
<property name="testServer" value="depltest-server"/>
Expand Down Expand Up @@ -103,6 +103,7 @@


<target name="init" depends="init.os,init.tools,setAsadminArgs">
<get src="http://central.maven.org/maven2/junit/junit/4.12/junit-4.12.jar" dest="${env.APS_HOME}/devtests/deployment/junit-4.12.jar" usetimestamp="true"/>
<property name="root" value="${basedir}"/>

<available property="cluster.exists" file="${s1as.home}/domains/${testDomain}"/>
Expand Down
Binary file not shown.
14 changes: 12 additions & 2 deletions appserver/tests/appserv-tests/devtests/deployment/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017-2018 Oracle and/or its affiliates. All rights reserved.
#
# The contents of this file are subject to the terms of either the GNU
# General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -48,6 +48,17 @@ test_run(){
export HUDSON=true
export ROOT=`pwd`

PROXY_HOST=`echo ${http_proxy} | cut -d':' -f2 | ${SED} 's/\/\///g'`
PROXY_PORT=`echo ${http_proxy} | cut -d':' -f3 | ${SED} 's/\///g'`
ANT_OPTS="${ANT_OPTS} \
-Dhttp.proxyHost=${PROXY_HOST} \
-Dhttp.proxyPort=${PROXY_PORT} \
-Dhttp.noProxyHosts='127.0.0.1|localhost|*.oracle.com' \
-Dhttps.proxyHost=${PROXY_HOST} \
-Dhttps.proxyPort=${PROXY_PORT} \
-Dhttps.noProxyHosts='127.0.0.1|localhost|*.oracle.com'"
export ANT_OPTS

# The first command-line argument is the (optional) predecessor job from which
# to get the revision under test and the glassfish.zip file to expand.
# Default: gf-trunk-build-continuous
Expand Down Expand Up @@ -174,4 +185,3 @@ case $OPT in
trap post_test_run EXIT
run_test_id $TEST_ID ;;
esac

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005-2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -59,8 +59,8 @@
import org.glassfish.hk2.api.ServiceLocator;

import junit.extensions.TestSetup;
import junit.framework.Assert;
import junit.framework.Test;
import org.junit.Assert;
import org.junit.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
Expand Down
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_run(){
popd

# Workaround for JDK7 and OpenDS
cp $APS_HOME/devtests/security/ldap/opends/X500Signer.jar $OPENDS_HOME/lib
# cp $APS_HOME/devtests/security/ldap/opends/X500Signer.jar $OPENDS_HOME/lib
rm -rf $OPENDS_HOME/lib/set-java-home
export OPENDS_JAVA_HOME=/gf-hudson-tools/jdk/7/latest

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/

package valves;

import java.io.IOException;
import javax.servlet.ServletException;
import org.apache.catalina.Request;
import org.apache.catalina.Response;
import org.glassfish.web.valve.GlassFishValve;

public class TestValve1 implements GlassFishValve {

private String testProperty = null;

public String getInfo() {
return getClass().getName();
}

public int invoke(Request req, Response resp) throws IOException, ServletException {
if (testProperty == null) {
req.getRequest().setAttribute("valve3", "null_value");
}
else if ("".equals(testProperty)) {
req.getRequest().setAttribute("valve2", "empty_value");
}
else {
req.getRequest().setAttribute("valve1", testProperty);
}
return GlassFishValve.INVOKE_NEXT;
}

public void postInvoke(Request req, Response resp) throws IOException, ServletException {
}

public void setTestProperty(String val) {
testProperty = val;
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/

package foo;

public class Bar {
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/

package foo;

public class Bar {
}
Binary file not shown.
Loading

0 comments on commit 1b1a5ed

Please sign in to comment.