Browse Source

some simple tests for the issigned condition

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277069 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
ea0d1cd08b
5 changed files with 108 additions and 0 deletions
  1. +61
    -0
      src/etc/testcases/taskdefs/conditions/issigned.xml
  2. BIN
      src/etc/testcases/taskdefs/conditions/jars/apassword.jar
  3. BIN
      src/etc/testcases/taskdefs/conditions/jars/nosign.jar
  4. BIN
      src/etc/testcases/taskdefs/conditions/jars/pass.jar
  5. +47
    -0
      src/testcases/org/apache/tools/ant/taskdefs/condition/IsSignedTest.java

+ 61
- 0
src/etc/testcases/taskdefs/conditions/issigned.xml View File

@@ -0,0 +1,61 @@
<project default="all">
<target name="pass" description="check if a name of pass is ok">
<fail message="name of pass not seen in the signed pass.jar">
<condition>
<not>
<issigned file="jars/pass.jar" name="pass"/>
</not>
</condition>
</fail>
</target>

<target name="password" description="check if a name of password is *not* ok">
<fail message="name of password is seen in the signed pass.jar">
<condition>
<issigned file="jars/pass.jar" name="password"/>
</condition>
</fail>
</target>

<target name="apassword" description="check if the 8 letter shorting works">
<fail message="8 letter shorting does not work 1">
<condition>
<not>
<issigned file="jars/apassword.jar" name="apasswor"/>
</not>
</condition>
</fail>
<fail message="8 letter shorting does not work 2">
<condition>
<not>
<issigned file="jars/apassword.jar" name="apassword"/>
</not>
</condition>
</fail>
</target>

<target name="allsigned" description="check the signed / not signed status">
<fail message="pass.jar should be signed">
<condition>
<not>
<issigned file="jars/pass.jar"/>
</not>
</condition>
</fail>
<fail message="nosign.jar should not be signed">
<condition>
<issigned file="jars/nosign.jar"/>
</condition>
</fail>

<fail message="apassword.jar should be signed">
<condition>
<not>
<issigned file="jars/apassword.jar"/>
</not>
</condition>
</fail>
</target>

</project>

BIN
src/etc/testcases/taskdefs/conditions/jars/apassword.jar View File


BIN
src/etc/testcases/taskdefs/conditions/jars/nosign.jar View File


BIN
src/etc/testcases/taskdefs/conditions/jars/pass.jar View File


+ 47
- 0
src/testcases/org/apache/tools/ant/taskdefs/condition/IsSignedTest.java View File

@@ -0,0 +1,47 @@
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.tools.ant.taskdefs.condition;

import org.apache.tools.ant.BuildFileTest;

/**
* Testcase for the &lt;issigned&gt; condition.
*
*/
public class IsSignedTest extends BuildFileTest {

public IsSignedTest(String name) {
super(name);
}
public void setUp() {
configureProject("src/etc/testcases/taskdefs/conditions/issigned.xml");
}

public void testPass() {
executeTarget("pass");
}
public void testPassword() {
executeTarget("password");
}
public void testAPassword() {
executeTarget("apassword");
}
public void testAllSigned() {
executeTarget("allsigned");
}
}

Loading…
Cancel
Save