Skip to content

Commit

Permalink
delete some permision checking tests that overlap with removal of web…
Browse files Browse the repository at this point in the history
… services

Signed-off-by: Scott Marlow <[email protected]>
  • Loading branch information
scottmarlow committed Aug 20, 2024
1 parent e0d3e28 commit 2ebf1cb
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 1,426 deletions.
21 changes: 0 additions & 21 deletions appclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<id>hello-service-testapp</id>
<goals>
<goal>wsimport</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/java/com/sun/ts/tests/appclient/deploy/metadatacomplete/testapp/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>HelloService.wsdl</wsdlFile>
</wsdlFiles>
<packageName>com.sun.ts.tests.appclient.deploy.metadatacomplete.testapp</packageName>
<sourceDestDir>${project.build.directory}/generated-sources/</sourceDestDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ public PermissionDDWorkManager(BootstrapContext val) {
public void runTests() {
debug("enterred runTests");

validateCustomPermFromAppServer();
validateRequiredPermSet();
validateMissingPermFails();
validateRestrictedLocalPerm();
validateLocalPermsInvalidName();

// doWork();
// doTCWork();
Expand Down Expand Up @@ -109,35 +106,6 @@ public void validateRequiredPermSet() {
return;
}

public void validateMissingPermFails() {
try {
// call a non-priviledged method
WebServicePermission perm = new WebServicePermission(
"CTSPermission3_name");
doCheckPermission(perm);

// we do NOT have perms for this perm with name "CTSPermission3_name" so
// should NOT get here
ConnectorStatus.getConnectorStatus()
.logState("FAILURE: CTSPermission3_name permission okay");
} catch (AccessControlException ex) {
debug("SUCCESS: CTSPermission3_name doesnt exist and was caught.");
ConnectorStatus.getConnectorStatus().logState(
"SUCCESS: CTSPermission3_name doesnt exist and was caught.");
ConnectorStatus.getConnectorStatus()
.logState("SUCCESS: validateMissingPermFails passed.");
Debug.printDebugStack(ex);
} catch (Exception ex) {
debug("FAILURE: validateMissingPermFails threw unexpected exception.");
ConnectorStatus.getConnectorStatus().logState(
"FAILURE: validateMissingPermFails threw unexpected exception.");
Debug.printDebugStack(ex);
}

debug("returning from validateMissingPermFails()");
return;
}

public void validateRestrictedLocalPerm() {
try {
// call a priviledged method
Expand Down Expand Up @@ -173,71 +141,6 @@ public void validateRestrictedLocalPerm() {
return;
}

public void validateLocalPermsInvalidName() {
try {
// call a priviledged method that does not exist
WebServicePermission secPerm = new WebServicePermission(
"NonExistingName");

try {
doCheckPermission(secPerm);
// should NOT get here
debug(
"FAILURE: validateLocalPermsInvalidName() did not throw expected AccessControlException.");
ConnectorStatus.getConnectorStatus()
.logState("FAILURE: validateLocalPermsInvalidName().");
return;
} catch (AccessControlException ex) {
// should get here.
ConnectorStatus.getConnectorStatus().logState(
"SUCCESS: validateLocalPermsInvalidName() threw expected AccessControlException");
}
// next call a priviledged method that does exist
try {
// call a priviledged method - that exists only in permissions.xml
WebServicePermission perm = new WebServicePermission(
"CTSPermission_second_name");
doCheckPermission(perm);

// should get here.
// we have locally defined grant/perms (thru permissions.xml) so we
// should get here
debug(
"CTSPermission_second_name permission property granted AccessControlException.");
} catch (AccessControlException ex) {
// should NOT get here
debug(
"FAILURE: validateLocalPermsInvalidName() threw unexpected exception.");
ConnectorStatus.getConnectorStatus().logState(
"FAILURE: validateLocalPermsInvalidName() threw unexpected exception.");
Debug.printDebugStack(ex);
return;
} catch (Exception ex) {
// should NOT get here
debug(
"FAILURE: validateLocalPermsInvalidName had unexpeted exception.");
ConnectorStatus.getConnectorStatus().logState(
"FAILURE: validateLocalPermsInvalidName had unexpeted exception.");
Debug.printDebugStack(ex);
return;
}

debug("SUCCESS: validateLocalPermsInvalidName passed.");
ConnectorStatus.getConnectorStatus()
.logState("SUCCESS: validateLocalPermsInvalidName passed.");

} catch (Exception ex) {
debug(
"FAILURE: validateLocalPermsInvalidName had unexpected exception.");
ConnectorStatus.getConnectorStatus().logState(
"FAILURE: validateLocalPermsInvalidName had unexpected exception.");
ex.printStackTrace();
}

debug("returning from validateLocalPermsInvalidName()");
return;
}

public void doCheckPermission(Permission pp) throws Exception {
final Permission perm = pp;
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
Expand Down
Loading

0 comments on commit 2ebf1cb

Please sign in to comment.