--- a/src/java/libjava-tests/.classpath Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="lib" path="/usr/share/java/log4j-1.2.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/junit4-4.8.1.jar" sourcepath="/usr/src/junit4-4.8.1"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
--- a/src/java/libjava-tests/.project Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>libjava-tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
--- a/src/java/libjava-tests/.settings/org.eclipse.jdt.core.prefs Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#Tue Dec 21 11:29:35 CET 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
--- a/src/java/libjava-tests/build.xml Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- WARNING: Eclipse auto-generated file.
- Any modifications will be overwritten.
- To include a user specific buildfile here, simply create one in the same
- directory with the processing instruction <?eclipse.ant.import?>
- as the first entry and export the buildfile again. -->
-<project basedir="." default="build" name="libjava-tests">
- <property environment="env"/>
- <property name="ECLIPSE_HOME" value="/usr/lib/eclipse"/>
- <property name="debuglevel" value="source,lines,vars"/>
- <property name="target" value="1.6"/>
- <property name="source" value="1.6"/>
- <path id="libjava-tests.classpath">
- <pathelement location="bin"/>
- <pathelement location="/usr/share/java/log4j-1.2.jar"/>
- <pathelement location="/usr/share/java/junit4.jar"/>
- </path>
- <target name="init">
- <mkdir dir="bin"/>
- <copy includeemptydirs="false" todir="bin">
- <fileset dir="src">
- <exclude name="**/*.launch"/>
- <exclude name="**/*.java"/>
- </fileset>
- </copy>
- </target>
- <target name="clean">
- <delete dir="bin"/>
- </target>
- <target depends="clean" name="cleanall"/>
- <target depends="build-subprojects,build-project" name="build"/>
- <target name="build-subprojects"/>
- <target depends="init" name="build-project">
- <echo message="${ant.project.name}: ${ant.file}"/>
- <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
- <src path="src"/>
- <classpath refid="libjava-tests.classpath"/>
- </javac>
- </target>
- <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
- <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
- <copy todir="${ant.library.dir}">
- <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
- </copy>
- <unzip dest="${ant.library.dir}">
- <patternset includes="jdtCompilerAdapter.jar"/>
- <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
- </unzip>
- </target>
- <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
- <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
- <antcall target="build"/>
- </target>
- <target name="AnnotationTests">
- <java classname="stx.libjava.tests.annotations.AnnotationTests" failonerror="true" fork="yes">
- <classpath refid="libjava-tests.classpath"/>
- </java>
- </target>
- <target name="JUnit4Tests">
- <java classname="stx.libjava.tests.junit.JUnit4Tests" failonerror="true" fork="yes">
- <classpath refid="libjava-tests.classpath"/>
- </java>
- </target>
-</project>
--- a/src/java/libjava-tests/src/gnu/testlet/TestHarness.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,335 +0,0 @@
-// Copyright (c) 1998, 1999, 2001 Cygnus Solutions
-// Written by Tom Tromey <tromey@cygnus.com>
-// Copyright (c) 2005 Mark J. Wielaard <mark@klomp.org>
-
-// This file is part of Mauve.
-
-// Mauve is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// Mauve is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Mauve; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-package gnu.testlet;
-
-import java.awt.AWTException;
-import java.awt.Robot;
-
-import java.io.File;
-import java.io.Reader;
-import java.io.InputStream;
-
-/**
- * This base class defines the API that test cases can report against. This
- * code has been lifted from the Mauve project (and reformatted and
- * commented).
- */
-public abstract class TestHarness
-{
- /**
- * Records the result of a boolean check.
- *
- * @param result the result.
- */
- public abstract void check (boolean result);
-
- /**
- * Checks the two objects for equality and records the result of
- * the check.
- *
- * @param result the actual result.
- * @param expected the expected result.
- */
- public void check(Object result, Object expected)
- {
- boolean ok = (result == null ? expected == null : result.equals(expected));
- check(ok);
- // This debug message may be misleading, depending on whether
- // string conversion produces same results for unequal objects.
- if (! ok)
- debug("got " + result + " but expected " + expected);
- }
-
- /**
- * Checks two booleans for equality and records the result of the check.
- *
- * @param result the actual result.
- * @param expected the expected result.
- */
- public void check(boolean result, boolean expected)
- {
- boolean ok = (result == expected);
- check(ok);
- if (! ok)
- debug("got " + result + " but expected " + expected);
- }
-
- /**
- * Checks two ints for equality and records the result of the check.
- *
- * @param result the actual result.
- * @param expected the expected result.
- */
- public void check(int result, int expected)
- {
- boolean ok = (result == expected);
- check(ok);
- if (! ok)
- debug("got " + result + " but expected " + expected);
- }
-
- /**
- * Checks two longs for equality and records the result of the check.
- *
- * @param result the actual result.
- * @param expected the expected result.
- */
- public void check(long result, long expected)
- {
- boolean ok = (result == expected);
- check(ok);
- if (! ok)
- debug("got " + result + " but expected " + expected);
- }
-
- /**
- * Checks two doubles for equality and records the result of the check.
- *
- * @param result the actual result.
- * @param expected the expected result.
- */
- public void check(double result, double expected)
- {
- // This triple check overcomes the fact that == does not
- // compare NaNs, and cannot tell between 0.0 and -0.0;
- // and all without relying on java.lang.Double (which may
- // itself be buggy - else why would we be testing it? ;)
- // For 0, we switch to infinities, and for NaN, we rely
- // on the identity in JLS 15.21.1 that NaN != NaN is true.
- boolean ok = (result == expected ? (result != 0)
- || (1 / result == 1 / expected)
- : (result != result)
- && (expected != expected));
- check(ok);
- if (! ok)
- // If Double.toString() is buggy, this debug statement may
- // accidentally show the same string for two different doubles!
- debug("got " + result + " but expected " + expected);
- }
-
- /**
- * Checks if <code>result</code> is equal to <code>expected</code> and
- * take a rounding delta into account.
- *
- * @param result the actual result
- * @param expected the expected value
- * @param delta the rounding delta
- */
- public void check(double result, double expected, double delta)
- {
- boolean ok = true;
- if (Double.isInfinite(expected))
- {
- if (result != expected)
- ok = false;
- }
- else if (! (Math.abs(expected - result) <= delta))
- ok = false;
-
- check(ok);
- if (! ok)
- // If Double.toString() is buggy, this debug statement may
- // accidentally show the same string for two different doubles!
- debug("got " + result + " but expected " + expected);
- }
-
- // These methods are like the above, but checkpoint first.
- public void check(boolean result, String name)
- {
- checkPoint(name);
- check(result);
- }
-
- public void check(Object result, Object expected, String name)
- {
- checkPoint(name);
- check(result, expected);
- }
-
- public void check(boolean result, boolean expected, String name)
- {
- checkPoint(name);
- check(result, expected);
- }
-
- public void check(int result, int expected, String name)
- {
- checkPoint(name);
- check(result, expected);
- }
-
- public void check(long result, long expected, String name)
- {
- checkPoint(name);
- check(result, expected);
- }
-
- public void check(double result, double expected, String name)
- {
- checkPoint(name);
- check(result, expected);
- }
-
- public Robot createRobot()
- {
- Robot r = null;
-
- try
- {
- r = new Robot();
- }
- catch (AWTException e)
- {
- fail("TestHarness: couldn't create Robot: " + e.getMessage());
- }
-
- return r;
- }
-
- /**
- * A convenience method that sets a checkpoint with the specified name
- * then records a failed check.
- *
- * @param name the checkpoint name.
- */
- public void fail(String name)
- {
- checkPoint(name);
- check(false);
- }
-
- // Given a resource name, return a Reader on it. Resource names are
- // just like file names. They are relative to the top level Mauve
- // directory, but '#' characters are used in place of directory
- // separators.
- public abstract Reader getResourceReader (String name);
-
- public abstract InputStream getResourceStream (String name);
-
- public abstract File getResourceFile (String name);
-
- /**
- * Records a check point. This can be used to mark a known place in a
- * testlet. It is useful if you have a large number of tests -- it makes
- * it easier to find a failing test in the source code.
- *
- * @param name the check point name.
- */
- public abstract void checkPoint (String name);
-
- /**
- * This will print a message when in verbose mode.
- *
- * @param message the message.
- */
- public abstract void verbose (String message);
-
- /**
- * Writes a message to the debug log.
- *
- * @param message the message.
- */
- public abstract void debug (String message);
-
- /**
- * Writes a message to the debug log with or without a newline.
- *
- * @param message the message.
- * @param newline a flag to control whether or not a newline is added.
- */
- public abstract void debug (String message, boolean newline);
- /**
- * Writes a stack trace for the specified exception to a log.
- *
- * @param ex the exception.
- */
- public abstract void debug (Throwable ex);
-
- /**
- * Writes the contents of an array to the log.
- *
- * @param o the array of objects.
- * @param desc the description.
- */
- public abstract void debug (Object[] o, String desc);
-
- // Default config interface methods.
- public String getSourceDirectory ()
- {
- return null;
- }
-
- public String getBuildDirectory ()
- {
- return null;
- }
-
- /**
- * Provide a directory name for writing temporary files.
- *
- * @return The temporary directory name.
- */
-
- public String getTempDirectory ()
- {
- return null;
- }
-
- public String getPathSeparator ()
- {
- return null;
- }
-
- public String getSeparator ()
- {
- return null;
- }
-
- public String getMailHost ()
- {
- return null;
- }
- public String getAutoCompile()
- {
- return null;
- }
-
- public String getCpInstallDir()
- {
- return null;
- }
-
- public String getEcjJar()
- {
- return null;
- }
-
- public String getEmmaString()
- {
- return null;
- }
-
- public String getTestJava()
- {
- return null;
- }
-}
\ No newline at end of file
--- a/src/java/libjava-tests/src/gnu/testlet/Testlet.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package gnu.testlet;
-
-public interface Testlet
-{
- // This runs the test.
- public abstract void test (TestHarness harness);
-}
\ No newline at end of file
--- a/src/java/libjava-tests/src/stx/libjava/tests/AnnotationTests.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-package stx.libjava.tests;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-import stx.libjava.tests.mocks.EnumValueAnnotation;
-import stx.libjava.tests.mocks.HeavilyAnnotatedClass;
-import stx.libjava.tests.mocks.Weather;
-
-public class AnnotationTests extends TestCase {
-
- public void testClassAnnotations() {
- Annotation[] annotations = HeavilyAnnotatedClass.class.getAnnotations();
- for (Annotation a : annotations) {
- System.out.println(a.annotationType());
- }
- assertTrue(annotations.length == 4);
- }
-
- public void testFieldAnnotations() throws Exception {
- Field field = new HeavilyAnnotatedClass().getClass().getDeclaredField("heavilyAnnotatedField");
- Annotation[] annotations = field.getAnnotations();
- for (Annotation a : annotations) {
- System.out.println(a.annotationType());
- }
- assertTrue(annotations.length == 4);
- }
-
- public void testMethodAnnotations() throws Exception {
- Method method = new HeavilyAnnotatedClass().getClass().getDeclaredMethod("heavilyAnnotatedMethod", String.class);
- Annotation[] annotations = method.getAnnotations();
- for (Annotation a : annotations) {
- System.out.println(a.annotationType());
- }
- assertTrue(annotations.length == 4);
- }
-
- public void testMethodParamAnnotations() throws Exception {
- Method method = new HeavilyAnnotatedClass().getClass().getDeclaredMethod("heavilyAnnotatedMethod", String.class);
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- Class[] parameterTypes = method.getParameterTypes();
-
- int i=0;
- for(Annotation[] annotations : parameterAnnotations){
- Class parameterType = parameterTypes[i++];
-
- for(Annotation annotation : annotations){
-
- assertTrue(annotation instanceof EnumValueAnnotation);
-
- EnumValueAnnotation myAnnotation = (EnumValueAnnotation) annotation;
-
- assertTrue(myAnnotation.value().equals(Weather.SUNNY));
- }
- }
-
- }
-
- public static void main(String[] args) {
- System.out.println("Expected output: 4 run, 0 failed");
- Result result = runAllTests();
- System.out.println("getRunCount() = " + result.getRunCount());
- System.out.println("getFailureCount() = " + result.getFailureCount());
- for (Failure f : result.getFailures()) {
- System.out.println("Failure: " + f.toString());
- }
- }
-
- public static Result runAllTests() {
- return JUnitCore.runClasses(AnnotationTests.class);
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/JUnit3Tests.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-package stx.libjava.tests;
-
-import junit.framework.TestCase;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-public class JUnit3Tests extends TestCase {
-
- public final void testSayHi() {
- assertEquals("hi", sayHi());
- }
-
- private String sayHi() {
- return "hi";
- }
-
- public void testPass() {
- assertEquals(10,10);
- }
-
- public void testFailure() {
- assertEquals(10,0);
- }
-
- public void testError() {
- float a = 10 / 0;
- assertEquals(a, 0.0);
- }
-
- public static void main(String [] args) {
- System.out.println("Expected output: 4 run, 2 failed");
- Result result = runAllTests();
- System.out.println("getRunCount() = " + result.getRunCount());
- System.out.println("getFailureCount() = " + result.getFailureCount());
- for (Failure f : result.getFailures()) {
- System.out.println("Failure: " + f.toString());
- }
- }
-
- public static Result runAllTests() {
- return JUnitCore.runClasses(JUnit3Tests.class);
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/JUnit4Tests.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-package stx.libjava.tests;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-public class JUnit4Tests {
-
- @Test
- public void helloWorld() {
- assertEquals("Is zero equal 5-5 test",0, (5-5));
- }
-
- @Test
- public void stringEquality() {
- assertEquals("String equality test", "hello", "hello");
- }
-
- @Test
- public void helloWorldWillNotPass() {
- assertEquals("Is zero equal 5 test", 0, 5);
- }
-
- public static void main(String [] args) {
- System.out.println("Expected output: 3 run, 1 failed");
- Result result = JUnitCore.runClasses(JUnit4Tests.class);
- System.out.println("getRunCount() = " + result.getRunCount());
- System.out.println("getFailureCount() = " + result.getFailureCount());
- for (Failure f : result.getFailures()) {
- System.out.println("Failure: " + f.toString());
- }
- }
-
- public static Result runAllTests() {
- return JUnitCore.runClasses(JUnit4Tests.class);
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/Log4JTests.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-package stx.libjava.tests;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.BasicConfigurator;
-import org.apache.log4j.Logger;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-
-import static org.junit.Assert.assertEquals;
-
-public class Log4JTests extends TestCase {
-
- public void testLoadAndLogSomething() {
- //assertTrue("Test disabled since it crashes the VM (#9 bug)", false);
- /**/
- BasicConfigurator.configure();
- Logger logger = Logger.getRootLogger();
- logger.debug("Sample debug message");
- logger.error("Sample error message");
- logger.fatal("Sample fatal message");
- /**/
-
- }
-
- public static void main(String[] args) {
- Result result = runAllTests();
- System.out.println("getRunCount() = " + result.getRunCount());
- System.out.println("getFailureCount() = " + result.getFailureCount());
- for (Failure f : result.getFailures()) {
- System.out.println("Failure: " + f.toString());
- }
- System.out.println("End of output");
- }
-
- public static Result runAllTests() {
- return JUnitCore.runClasses(Log4JTests.class);
- }
-
-}
-
--- a/src/java/libjava-tests/src/stx/libjava/tests/RegexTests.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-package stx.libjava.tests;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Result;
-import org.junit.runner.notification.Failure;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-
-public class RegexTests extends TestCase {
-
- public void testSimpleRegex() {
- Assert.assertTrue("Simple text matching","foo@foo.org".matches("[a-z]*@[a-z]*.[a-z]*"));
- }
-
- public void testNotSoSimpleRegex() {
- Pattern p = Pattern.compile("[a-z]*@[a-z]*.[a-z]*");
- Matcher m = p.matcher("foo@foo.org");
- Assert.assertTrue("Not so simple text matching",m.matches());
- }
-
- public static void main(String[] args) {
- System.out.println("Expected output: 2 run, 0 failed");
- Result result = runAllTests();
- System.out.println("getRunCount() = " + result.getRunCount());
- System.out.println("getFailureCount() = " + result.getFailureCount());
- for (Failure f : result.getFailures()) {
- System.out.println("Failure: " + f.toString());
- }
- }
-
- public static Result runAllTests() {
- return JUnitCore.runClasses(RegexTests.class);
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ArrayValueAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ArrayValueAnnotation {
-String[] whatILikeInSTX();
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ClassAnnotatedWithInvisibleAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-package stx.libjava.tests.mocks;
-
-
-@RuntimeInvisibleAnnotation
-public class ClassAnnotatedWithInvisibleAnnotation {
-
-
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ClassValueAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ClassValueAnnotation {
- Class myFavouriteJavaLangClass();
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ClassWithInnerClasses.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class ClassWithInnerClasses {
-
- class Inner {
- public String helloWorldFromInner() {
- return "hello world from inner";
- }
- };
-
- static class InnerStatic {
- public String helloWorldFromInnerStatic() {
- return "hello world from inner static";
- }
- };
-
- public static InnerStatic getInnerStatic() {
- return new InnerStatic();
- }
-
- public Inner getInner() {
- return new Inner();
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/Crate.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class Crate {
-
- private int intVar;
- private double doubleVar;
- private long longVar;
- private String stringVar;
-
-
-
- public int getIntVar() {
-
- return intVar;
- }
- public void setIntVar(int intVar) {
- this.intVar = intVar;
- }
- public double getDoubleVar() {
- return doubleVar;
- }
- public void setDoubleVar(double doubleVar) {
- this.doubleVar = doubleVar;
- }
- public long getLongVar() {
- return longVar;
- }
- public void setLongVar(long longVar) {
- this.longVar = longVar;
- }
- public String getStringVar() {
- return stringVar;
- }
- public void setStringVar(String stringVar) {
- this.stringVar = stringVar;
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/EnumValueAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface EnumValueAnnotation {
- Weather value() default Weather.TORNADO;
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/HeavilyAnnotatedClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-package stx.libjava.tests.mocks;
-
-
-@EnumValueAnnotation(Weather.SUNNY)
-@ArrayValueAnnotation(whatILikeInSTX={"SVN" , "SVN.. Really :)"})
-@PrimitiveValueAnnotation(ratio=5.5, size=5, value="Hello world")
-@ClassValueAnnotation(myFavouriteJavaLangClass=java.lang.ArrayIndexOutOfBoundsException.class)
-public class HeavilyAnnotatedClass {
-
-
- @EnumValueAnnotation(Weather.CLOUDY)
- @ArrayValueAnnotation(whatILikeInSTX="Changeset")
- @PrimitiveValueAnnotation(ratio=5.5, size=5, value="Hello world")
- @ClassValueAnnotation(myFavouriteJavaLangClass=java.lang.String.class)
- public String heavilyAnnotatedField;
-
-
- @EnumValueAnnotation()
- @ArrayValueAnnotation(whatILikeInSTX={})
- @PrimitiveValueAnnotation(ratio = 0, size = 0, value = "")
- @ClassValueAnnotation(myFavouriteJavaLangClass = java.lang.instrument.Instrumentation.class)
- public void heavilyAnnotatedMethod(@EnumValueAnnotation(Weather.SUNNY) String howAboutWeather) {
- heavilyAnnotatedField = "Annotation madness spreading..";
- heavilyAnnotatedField += "And that weather.. " + howAboutWeather;
- System.out.println(heavilyAnnotatedField);
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ImplementorOfNonPublicInterface.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class ImplementorOfNonPublicInterface implements NonPublicInterface{
- @Override
- public String publicMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String abstractMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String publicAbstractMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String packagePrivateMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/ImplementorOfPublicInterface.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class ImplementorOfPublicInterface implements PublicInterface {
-
- @Override
- public String publicMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String abstractMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String publicAbstractMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String packagePrivateMethod() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/NonPublicClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-package stx.libjava.tests.mocks;
-
-class NonPublicClass {
-
- private String privateField;
- protected String protectedField;
- public String publicField;
-
- private static String privateStaticField;
- protected static String protectedStaticField;
- public static String publicStaticField;
-
- private static String privateStaticMethod() {
- return "privateStatic";
- }
-
- protected static String protectedStaticMethod() {
- return "protectedStatic";
- }
-
- public static String publicStaticMethod() {
- return "publicStatic";
- }
-
- private String privateMethod() {
- return "private";
- }
-
- protected String protectedMethod() {
- return "protected";
- }
-
- public String publicMethod() {
- return "public";
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/NonPublicInterface.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package stx.libjava.tests.mocks;
-
-interface NonPublicInterface {
-
-
- public String publicMethod();
-
- abstract String abstractMethod();
-
- public abstract String publicAbstractMethod();
-
- String packagePrivateMethod();
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/PrimitiveValueAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.sql.Date;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PrimitiveValueAnnotation {
-String value();
-int size();
-double ratio();
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/PublicClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-package stx.libjava.tests.mocks;
-
-
-public class PublicClass {
-
- private String privateField;
- protected String protectedField;
- public String publicField;
- String packagePrivateField;
-
- private static String privateStaticField;
- protected static String protectedStaticField;
- public static String publicStaticField;
- static String packagePrivateStaticField;
-
- private static String privateStaticMethod() {
- return "privateStatic";
- }
-
- protected static String protectedStaticMethod() {
- return "protectedStatic";
- }
-
- public static String publicStaticMethod() {
- return "publicStatic";
- }
-
- static String packagePrivateStaticMethod() {
- return "packagePrivateStatic";
- }
-
- private String privateMethod() {
- return "private";
- }
-
- protected String protectedMethod() {
- return "protected";
- }
-
- public String publicMethod() {
- return "public";
- }
-
- String packagePrivateMethod() {
- return "packagePrivate";
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/PublicInterface.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public interface PublicInterface {
-
- public String publicMethod();
-
- abstract String abstractMethod();
-
- public abstract String publicAbstractMethod();
-
- String packagePrivateMethod();
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/RuntimeInvisibleAnnotation.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.CLASS)
-public @interface RuntimeInvisibleAnnotation {
- String value() default "hidden";
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SimpleAbstractClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public abstract class SimpleAbstractClass {
-
- public final static String name ="SimpleAbstractClass";
-
- public String foo() {
- return "foo";
- }
-
- public abstract String bar();
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SimpleClassWithManyReferences.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.util.Date;
-
-public class SimpleClassWithManyReferences {
-
- private Object[] values;
-
- public SimpleClassWithManyReferences() {
- values = new Object[10];
- values[0] = "hello";
- values[1] = 1;
- values[2] = 1.1;
- values[3] = 'a';
- values[4] = 10l;
- values[5] = new Integer[5];
- values[6] = new Short("1");
- values[7] = new Byte("11");
- values[8] = new Date[3];
- values[9] = Boolean.TRUE;
- }
-
- public String getString() {
- return (String) values[0];
- }
-
- public int getInt() {
- return (Integer) values[1];
- }
-
- public Double getDouble() {
- return (Double) values[2];
- }
-
- public char getChar() {
- return (Character) values[3];
- }
-
- public long getLong() {
- return (Long) values[4];
- }
-
- public int[] getIntArray() {
- return (int[]) values[5];
- }
-
- public short getShort() {
- return (Short) values[6];
- }
-
- public byte getByte() {
- return (Byte) values[7];
- }
-
- public Date[] getDateArray() {
- return (Date[]) values[8];
- }
-
- public boolean getBoolean() {
- return (Boolean) values[9];
- }
-
- public void setBoolean(int i) {
- if (i % 2 == 0) {
- values[9] = Boolean.TRUE;
- } else {
- values[9] = false;
- }
- }
-
- public void setDate(long milis) {
- ((Date[]) values[8])[0] = new Date(milis);
- }
-
- public void setByte(byte b) {
- values[7] = b;
- }
-
- public void setIntArray(int[] array) {
- values[5] = array;
- }
-
- public void setDouble(double d) {
- values[2] = d;
- }
-
- public void setShort(short s) {
- values[6] = s;
- }
-
- public void setChar(char c) {
- values[3] = c;
- }
-
- public void setLong(long l) {
- values[4] = l;
- }
- public void setString(String s) {
- values[0] = s;
- }
-
- public void setInt(int i) {
- values[1] = i;
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SimpleInheritingClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class SimpleInheritingClass extends SimpleAbstractClass implements SimpleInterface {
-
- @Override
- public String bar() {
- return "bar";
- }
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SimpleInterface.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public interface SimpleInterface {
-
- public String foo();
- public String bar();
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SimpleMath.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class SimpleMath {
-
- public static int add2To2000Expect2002() {
- int a = 2;
- int b = 2000;
- int result = a + b;
- return result;
- }
-
- public static int addMinus5ToArg(int arg) {
- return arg + (-5);
- }
-
- public static int multiply(int a, int b) {
- return a * b;
- }
-
- public static int power(int base, int exp) {
- return powerAcc(base, exp, 1);
- }
-
- public static int powerAcc(int base, int exp, int accumulator) {
- if (exp == 0) {
- return accumulator;
- }
- return powerAcc(base, exp - 1, accumulator * base);
- }
-
- public static int div(int num, int mod) {
- return num % mod;
- }
-
- public static int negateInt(int num) {
- return ~num;
- }
-
- public static int bitShiftLeft(int num, int degree) {
- return num << degree;
- }
-
- public static int bitShiftRight(int num, int degree) {
- return num >> degree;
- }
-
- public static int division(int nom, int denom) {
- return nom/denom;
- }
-
- public static int inc2(int num) {
- num++;
- ++num;
- return num;
- }
-
- public static int dec2(int num) {
- num--;
- --num;
- return num;
- }
-
- public static int unsignedBitShiftRight(int num, int degree) {
- return num >>> degree;
- }
-
- public static int and(int first, int second) {
- return first & second;
- }
-
- public static int or(int first, int second) {
- return first | second;
- }
-
- public static int xor(int first, int second) {
- return first ^ second;
- }
-
- public static void justUseConstants() {
- long l0 = 0l;
- long l1 = 1l;
- float f0 = 0;
- float f1 = 1;
- float f2 = 2;
- double d0 = 0;
- double d1 = 1;
- }
-
- public static int isYourStackCreatedCorrectly() {
- int a = 0;
- int b = 1;
- a = 2;
- b = 3;
- a = 4;
- a = 5;
- b = 6;
- a = 7;
- b = 8;
- b = 9;
- return a;
- }
-
- public static double isYourStackCreatedCorrectlyEvenWithDoublesAndLongs() {
- double a = 0;
- long b = 1;
- a = 2;
- b = 3;
- a = 4;
- a = 5;
- b = 6;
- a = 7;
- b = 8;
- b = 9;
- return a;
- }
-
- public static int sumArray(int[] array) {
- int result = 0;
- for (int i = 0; i < array.length; i++) {
- result += array[i];
- }
- return result;
- }
-
- public static double sumArrayOfDoubles(double[] array) {
- double result = 0;
- for (int i = 0; i < array.length; i++) {
- result += array[i];
- }
- return result;
- }
-
- public static long[] giveMeArrayOfLongs() {
-
- return new long[100];
- }
-
- public static void main(String[] args) {
- System.out.println("add2To2000Expect2002 returned: " + add2To2000Expect2002());
- System.out.println("addMinus5ToArg with 10 returned: " + addMinus5ToArg(10));
- System.out.println("multiply with 10 and 20 returned: " + multiply(10, 20));
- System.out.println("power with 2 and 10 returned: " + power(2, 10));
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SubclassOfNonPublicClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-package stx.libjava.tests.mocks;
-
-
-public class SubclassOfNonPublicClass extends NonPublicClass {
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SubclassOfPublicClass.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class SubclassOfPublicClass extends PublicClass {
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/SwitchExamples.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public class SwitchExamples {
-
- public int switchChar(char c) {
- switch (c) {
- case 'a':
- return 0;
- case 'b':
- return 1;
- case 'c':
- return 2;
- default:
- return 3;
- }
- }
-
- public int switchInt(int c) {
- switch (c) {
- case 0:
- return 0;
- case 1000:
- return 1;
- case -1000:
- return -1;
- default:
- return 2;
- }
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/TestletHarnessMock.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-
-import gnu.testlet.TestHarness;
-import gnu.testlet.Testlet;
-
-public class TestletHarnessMock extends TestHarness {
-
- private boolean passed;
- private Testlet testlet;
-
- public TestletHarnessMock(Testlet t, boolean verbose)
- {
- super();
- testlet = t;
- }
-
- public void check(boolean result)
- {
- passed = result;
- }
-
- public boolean passed() {
- return passed;
- }
-
- @Override
- public Reader getResourceReader(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public InputStream getResourceStream(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public File getResourceFile(String name) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void checkPoint(String name) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void verbose(String message) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void debug(String message) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void debug(String message, boolean newline) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void debug(Throwable ex) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void debug(Object[] o, String desc) {
- // TODO Auto-generated method stub
-
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/TranslucentObjectTestsHelper.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-package stx.libjava.tests.mocks;
-
-import java.util.ArrayList;
-
-public class TranslucentObjectTestsHelper {
- public ArrayList<Object> createArrayList() {
- return new ArrayList<Object>();
- }
-
- public boolean isEmpty(String s) {
- return s.isEmpty();
- }
-
-}
--- a/src/java/libjava-tests/src/stx/libjava/tests/mocks/Weather.java Sat Jul 23 13:48:07 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-package stx.libjava.tests.mocks;
-
-public enum Weather {
- SUNNY, CLOUDY, RAINING, TORNADO
-}
--- a/tests/build.xml Sat Jul 23 13:48:07 2011 +0000
+++ b/tests/build.xml Tue Jul 26 15:57:15 2011 +0000
@@ -1,9 +1,12 @@
<project name="tests" default="build">
+
<target name="build">
+<!--
<subant target="build">
<fileset dir="." includes="*/build.xml"/>
</subant>
+-->
</target>
<target name="clean">
--- a/tests/libjava/.classpath Sat Jul 23 13:48:07 2011 +0000
+++ b/tests/libjava/.classpath Tue Jul 26 15:57:15 2011 +0000
@@ -3,7 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="/usr/share/java/log4j-1.2.jar"/>
- <classpathentry kind="lib" path="/usr/share/java/junit4-4.8.1.jar" sourcepath="/usr/src/junit4-4.8.1"/>
+ <classpathentry kind="lib" path="/usr/share/java/junit4.jar"/>
<classpathentry kind="lib" path="/usr/share/java/asm3-all.jar">
</classpathentry>
<classpathentry kind="output" path="bin"/>