harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r660326 [15/17] - in /harmony/enhanced/microemulator: ./ microemu-android/ microemu-android/src/ microemu-android/src/org/ microemu-android/src/org/microemu/ microemu-android/src/org/microemu/android/ microemu-android/src/org/microemu/andro...
Date Mon, 26 May 2008 22:21:57 GMT
Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/DynamicallyLoadedStatus.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/DynamicallyLoadedStatus.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/DynamicallyLoadedStatus.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/DynamicallyLoadedStatus.java Mon May 26 15:20:19 2008
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+/**
+ * @author vlads
+ *
+ */
+public class DynamicallyLoadedStatus {
+
+	static boolean runnerSuccess = false;
+	
+	static {
+		runnerSuccess = false;
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/DynamicallyLoadedStatus.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/OverrideMicroeditionClient.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/OverrideMicroeditionClient.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/OverrideMicroeditionClient.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/OverrideMicroeditionClient.java Mon May 26 15:20:19 2008
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+import javax.microedition.NotAccessible;
+
+/**
+ * @author vlads
+ *
+ */
+public class OverrideMicroeditionClient implements Runnable {
+
+	public void run() {
+		NotAccessible.doStuff();
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/OverrideMicroeditionClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestMain.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestMain.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestMain.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestMain.java Mon May 26 15:20:19 2008
@@ -0,0 +1,110 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+public class TestMain implements Runnable {
+
+	public static boolean verbose = false;
+	
+	public static void main(String[] args) {
+		(new TestMain()).run();
+	}
+
+	public void run() {
+		
+		if (System.getProperty("test.verbose") != null) {
+			verbose = true;
+		}
+		
+		if (verbose) {
+			System.out.println("ClassLoader " + this.getClass().getClassLoader().hashCode() +  " TestMain");
+		}
+		
+		assertProperty("test.property1", "1");
+		assertProperty("microedition.platform", null);
+		
+		if (verbose) {
+			System.out.println("System.getProperty OK");
+		}
+		
+		(new TestResourceLoad()).run();
+		(new TestStaticInitializer()).run();
+		
+		try {
+			(new OverrideMicroeditionClient()).run();
+			throw new RuntimeException("Can execute OverrideMicroeditionClient");
+		} catch (Throwable e) {
+			if (e instanceof NoClassDefFoundError) {
+				if (verbose) {
+					System.out.println("no acess to java.microedition in MIDlet jar OK " + e.toString());
+				}
+			} else {
+				throw new RuntimeException("Can acess java.microedition from MIDlet jar " + e.toString());
+			}
+		}
+		
+		try {
+			Class.forName("javax.microedition.NotAccessible");
+			throw new RuntimeException("Can acess java.microedition from MIDlet jar using Class.forName");
+		} catch (ClassNotFoundException e) {
+			if (verbose) {
+				System.out.println("no acess to java.microedition in MIDlet jar OK " + e.toString());
+			}
+		} 
+		
+		String runnerName = "org.DynamicallyLoadedRunner";
+		Class drunner;
+		try {
+			drunner = Class.forName(runnerName);
+			if (verbose) {
+				System.out.println("Class.forName("+ runnerName +") OK ");
+			}
+		} catch (ClassNotFoundException e) {
+			throw new RuntimeException("Can't load "+ runnerName +" from MIDlet jar using Class.forName", e);
+		}
+		Object r;
+		try {
+			r = drunner.newInstance();
+			if (verbose) {
+				System.out.println("Class.forName("+ runnerName +").newInstance() OK ");
+			}
+		} catch (Exception e) {
+			throw new RuntimeException("Can't create "+ runnerName +" from MIDlet jar using Class.forName", e);
+		}
+		
+		((Runnable)r).run();
+		if (!DynamicallyLoadedStatus.runnerSuccess) {
+			throw new RuntimeException("Can execute DynamicallyLoadedRunner from MIDlet jar" );
+		}
+		
+		
+		System.out.println("All tests OK");
+	}
+	
+	private void assertProperty(String key, String expected) {
+		String value = System.getProperty(key);
+		if (verbose) {
+			System.out.println("Got System.getProperty " + key + " value [" + value + "]");
+		}
+		if (((expected == null) && (value != null)) || ((expected != null) && (!expected.equals(value)))) {
+			throw new RuntimeException("Unexpected property value " + value + " expected " + expected);
+		}
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestMain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestResourceLoad.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestResourceLoad.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestResourceLoad.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestResourceLoad.java Mon May 26 15:20:19 2008
@@ -0,0 +1,119 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * This class illustrate Resource usage paterns commonly used in MIDlet and not aceptable in Java SE application 
+ * @author vlads
+ */
+
+public class TestResourceLoad implements Runnable {
+
+	public void loadStringsUsingSystemClassLoaded() {
+		String resourceName;
+		String expected;
+		
+		resourceName = "/app-data.txt";
+		expected = "private app-data";
+		verifyLoadStrings("".getClass().getResourceAsStream(resourceName), "\"\".getClass() " +  resourceName, expected);
+		verifyLoadStrings(String.class.getResourceAsStream(resourceName), "String.class. " +  resourceName, expected);
+		
+	}
+	
+	public void accessTest() {
+		String resourceName;
+		String expected;
+		
+		resourceName = "/container-internal.txt";
+		verifyLoadStrings(this.getClass().getResourceAsStream(resourceName), "this.getClass() " + resourceName, null);
+		verifyLoadStrings("".getClass().getResourceAsStream(resourceName), "\"\".getClass() " +  resourceName, null);
+		
+		resourceName = "/app-data.txt";
+		expected = "private app-data";
+		verifyLoadStrings(this.getClass().getResourceAsStream(resourceName), "this.getClass() " + resourceName, expected);
+		verifyLoadStrings("".getClass().getResourceAsStream(resourceName), "\"\".getClass() " +  resourceName, expected);
+	}
+
+	public void multipleResources() {
+		
+		String resourceName = "/strings.txt";
+		String expected = "proper MIDlet resources strings";
+		verifyLoadStrings(this.getClass().getResourceAsStream(resourceName), "this.getClass() " + resourceName, expected);
+		verifyLoadStrings("".getClass().getResourceAsStream(resourceName), "\"\".getClass() " +  resourceName, expected);
+		
+	}
+
+	public void packageResources() {
+
+        String resourceName = "resource-package.txt";
+        String expected = "package relative";
+        verifyLoadStrings(TestResourceLoad.class.getResourceAsStream(resourceName), "this.class " + resourceName,
+                expected);
+    }
+	
+	private void verifyLoadStrings(InputStream inputstream, String resourceName, String expected) {	
+		if (inputstream == null) {
+			if (expected == null) {
+				if (TestMain.verbose) {
+					System.out.println("OK - Resource not found " + resourceName);
+				}
+				return;
+			}
+			throw new RuntimeException("Resource not found " + resourceName);
+		} else {
+			if (expected == null) {
+				throw new RuntimeException("Can access resource " + resourceName);
+			}
+		}
+		try {
+			BufferedReader r = new BufferedReader(new InputStreamReader(inputstream));
+			String value = r.readLine();
+			if (!expected.equals(value)) {
+				throw new RuntimeException("Unexpected resource " + resourceName + " value [" + value + "]\nexpected [" + expected + "]");
+			}
+		} catch (IOException e) {
+			throw new RuntimeException("Resource read error " + resourceName, e);
+		} finally {
+			try {
+				inputstream.close();
+			} catch (IOException ignore) {
+			}
+		}
+	}
+
+	public void run() {
+		
+		if (TestMain.verbose) {
+			System.out.println("ClassLoader " + this.getClass().getClassLoader().hashCode() +  " TestResourceLoad");
+		}
+		
+		loadStringsUsingSystemClassLoaded();
+		multipleResources();
+		accessTest();
+		packageResources();
+		
+	}
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestResourceLoad.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestStaticInitializer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestStaticInitializer.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestStaticInitializer.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestStaticInitializer.java Mon May 26 15:20:19 2008
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+/**
+ * @author vlads
+ *
+ */
+public class TestStaticInitializer implements Runnable {
+
+	private static int count = 0;
+	
+	static {
+		count = 1;
+	}
+	
+	
+	public void run() {
+		
+		if (count != 1) {
+			throw new RuntimeException("Same class is used again " + count);
+		}
+		
+		if (TestMain.verbose) {
+			System.out.println("Static initializer OK");
+		}
+		
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/TestStaticInitializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/CatchThrowable.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/CatchThrowable.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/CatchThrowable.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/CatchThrowable.java Mon May 26 15:20:19 2008
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.catchBlock;
+
+/**
+ * @author vlads
+ *
+ */
+public class CatchThrowable extends RunnableBase {
+
+	public void run() {
+		try {
+			Object o = null;
+			o.getClass();
+		} catch (Throwable e) {
+			if (verbose) {
+				System.out.println("caught " + e.getClass().getName());
+			}
+		}
+		
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/CatchThrowable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/RunnableBase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/RunnableBase.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/RunnableBase.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/RunnableBase.java Mon May 26 15:20:19 2008
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.catchBlock;
+
+/**
+ * @author vlads
+ *
+ */
+public abstract class RunnableBase implements Runnable {
+
+	public boolean verbose = false;
+	
+	public RunnableBase() {
+		if (System.getProperty("test.verbose") != null) {
+			verbose = true;
+		}
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/java/org/catchBlock/RunnableBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/app-data.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/app-data.txt?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/app-data.txt (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/app-data.txt Mon May 26 15:20:19 2008
@@ -0,0 +1 @@
+private app-data
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/app-data.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/org/resource-package.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/org/resource-package.txt?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/org/resource-package.txt (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/org/resource-package.txt Mon May 26 15:20:19 2008
@@ -0,0 +1 @@
+package relative
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/org/resource-package.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/strings.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/strings.txt?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/strings.txt (added)
+++ harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/strings.txt Mon May 26 15:20:19 2008
@@ -0,0 +1 @@
+proper MIDlet resources strings
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/bytecode-test-app/src/main/resources/strings.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests JUnit.launch
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2%20tests%20JUnit.launch?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests JUnit.launch (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests JUnit.launch Mon May 26 15:20:19 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/microemu-test-midlet"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="microemu-test-midlet"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="org.microemu.tests.UnitTestsMIDLet"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.microemu.app.Main"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+</launchConfiguration>

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests manual.launch
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2%20tests%20manual.launch?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests manual.launch (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/me-2 tests manual.launch Mon May 26 15:20:19 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/microemu-javase-swing/src/main/java/org/microemu/app/Main.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.microemu.app.Main"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="org.microemu.tests.MainTestMIDlet"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="microemu-test-midlet"/>
+</launchConfiguration>

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/microemu-test-midlet.jad
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/microemu-test-midlet.jad?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/microemu-test-midlet.jad (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/microemu-test-midlet.jad Mon May 26 15:20:19 2008
@@ -0,0 +1,8 @@
+MIDlet-Jar-URL: microemu-test-midlet.jar
+MIDlet-Jar-Size: 13146
+MIDlet-Name: microemu-test
+MIDlet-Vendor: MicroEmulator Team
+MIDlet-Version: 2.0.0
+MIDlet-1: MainTest, , org.microemu.tests.MainTestMIDlet
+MicroEdition-Configuration: CLDC-1.1
+MicroEdition-Profile: MIDP-2.0

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/pom.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/pom.xml?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/pom.xml (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/pom.xml Mon May 26 15:20:19 2008
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="http://maven.apache.org/POM/4.0.0">
+    <!-- @version $Revision: 1626 $ ($Author: vlads $) $Date: 2008-03-04 21:47:36 -0500 (Tue, 04 Mar 2008) $ -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.microemu</groupId>
+        <artifactId>microemu-tests</artifactId>
+        <version>2.0.3-SNAPSHOT</version><!--me-version-->
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>microemu-test-midlet</artifactId>
+    <name>microemu-test-midlet</name>
+
+    <description>microemu-test-midlet</description>
+
+    <repositories>
+
+        <repository>
+            <id>pyx4me-web</id>
+            <url>http://www.pyx4me.com/maven2</url>
+        </repository>
+
+    </repositories>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.microemu</groupId>
+            <artifactId>microemu-javase-swing</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.pyx4me</groupId>
+            <artifactId>cldcunit</artifactId>
+            <version>${pyx4meVersion}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.pyx4me</groupId>
+            <artifactId>cldcunit-se</artifactId>
+            <version>${pyx4meVersion}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.3</source>
+                    <target>1.1</target>
+                    <compilerArguments>
+                        <bootclasspath>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar${path.separator}${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</bootclasspath>
+                   </compilerArguments>
+                </configuration>
+            </plugin>
+
+            <!-- Add EclipseME nature to the generated project-->
+            <!--
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <configuration>
+                    <buildcommands>
+                        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+                        <buildcommand>eclipseme.core.preverifier</buildcommand>
+                    </buildcommands>
+                    <projectnatures>
+                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+                        <projectnature>eclipseme.core.nature</projectnature>
+                    </projectnatures>
+                    <classpathContainers>
+                        <classpathContainer>J2MELIB</classpathContainer>
+                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+            -->
+
+            <plugin>
+                <groupId>net.sf.jour</groupId>
+                <artifactId>jour-maven-plugin</artifactId>
+                <version>${jourVersion}</version>
+                <executions>
+                    <execution>
+                        <phase>test-compile</phase>
+                        <goals>
+                            <goal>instrument</goal>
+                        </goals>
+                        <configuration>
+                            <jourConfig>${basedir}/process-test-classes.jour.xml</jourConfig>
+                            <classesDirectory>${project.build.testOutputDirectory}</classesDirectory>
+                            <output>test-classes</output>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                   <dependency>
+                        <groupId>com.pyx4me</groupId>
+                        <artifactId>cldcunit-instrument</artifactId>
+                       <version>${pyx4meVersion}</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+
+            <!-- Create application loadable on the phone -->
+            <plugin>
+                <groupId>com.pyx4me</groupId>
+                <artifactId>j2me-maven-plugin</artifactId>
+                <version>${pyx4meVersion}</version>
+                <executions>
+                   <execution>
+                        <goals>
+                            <goal>package</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!--wtkHome>${env.WTK_HOME}</wtkHome-->
+                    <useWtkLibs>false</useWtkLibs>
+                    <proguard>true</proguard>
+                    <obfuscate>false</obfuscate>
+                    <proguardPreverify>true</proguardPreverify>
+                    <proguardOptions>
+                        <options>
+                            <option>-overloadaggressively</option>
+                            <option>-dontoptimize</option>
+                            <option>-allowaccessmodification</option>
+                            <option>-dontusemixedcaseclassnames</option>
+                            <option>-keep public interface javax.microedition.*</option>
+                        </options>
+                    </proguardOptions>
+                    <test>true</test>
+                    <midlets>
+                        <MIDlet>
+                            <name>MainTest</name>
+                            <class>org.microemu.tests.MainTestMIDlet</class>
+                        </MIDlet>
+                        <MIDlet>
+                            <name>UnitTests</name>
+                            <class>org.microemu.tests.UnitTestsMIDLet</class>
+                            <test>true</test>
+                        </MIDlet>
+                    </midlets>
+                    <libs>
+                        <lib>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar</lib>
+                        <lib>${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</lib>
+                    </libs>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.microemu</groupId>
+                            <artifactId>microemu-javase-swing</artifactId>
+                            <exclude>true</exclude>
+                            <withTrail>true</withTrail>
+                        </dependency>
+                    </dependencies>
+                </configuration>
+                <!--
+                <dependencies>
+                    <dependency>
+                        <groupId>net.sf.proguard</groupId>
+                        <artifactId>proguard</artifactId>
+                        <version>3.10.1</version>
+                        <scope>runtime</scope>
+                    </dependency>
+                </dependencies>
+                -->
+            </plugin>
+
+            <!-- install jar in project site -->
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>site-copy-artifacts</id>
+                        <phase>site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy overwrite="true"
+                                      file="${project.build.directory}/${artifactId}-${version}-test.jar"
+                                      tofile="${project.build.directory}/site/${artifactId}-${version}-test.jar"/>
+                                <copy overwrite="true"
+                                      file="${project.build.directory}/${artifactId}-${version}-test.jad"
+                                      tofile="${project.build.directory}/site/${artifactId}-${version}-test.jad"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+
+</project>
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/process-test-classes.jour.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/process-test-classes.jour.xml?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/process-test-classes.jour.xml (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/process-test-classes.jour.xml Mon May 26 15:20:19 2008
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<jour xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jour.xsd" debug="false">
+    <aspect descr="TestCaseReflectionData" type="com.pyx4me.cldcunit.TestCaseReflectionDataInstrumentor" enabled="true">
+        <typedef>*.*Test</typedef>
+        <!--pointcut expr="* junit.framework.TestCase=>test*()"/-->
+        <pointcut expr="* test*()"/>
+        <pointcut expr="junit.framework.Test suite()"/>
+    </aspect>
+</jour>

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/process-test-classes.jour.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRFacade.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRFacade.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRFacade.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRFacade.java Mon May 26 15:20:19 2008
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 javax.microedition.io.newjsr;
+
+/**
+ * @author vlads
+ *
+ * To test if MIDlet can override javax.microedition package on the device.
+ */
+public class NewJSRFacade {
+
+	private static class WorkerImpl implements NewJSRInterface {
+
+		public String doStuff(String data) {
+			System.out.println("Working on " + data);
+			return data;
+		}
+		
+	}
+	
+	public static NewJSRInterface createWorker() {
+		return new WorkerImpl();
+	}
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRFacade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRInterface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRInterface.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRInterface.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRInterface.java Mon May 26 15:20:19 2008
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 javax.microedition.io.newjsr;
+
+/**
+ * @author vlads
+ * 
+ * To test if MIDlet can override javax.microedition package on the device.
+ * 
+ */
+public interface NewJSRInterface {
+
+	public String doStuff(String data);
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/io/newjsr/NewJSRInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Facade.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Facade.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Facade.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Facade.java Mon May 26 15:20:19 2008
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 javax.microedition.newjsr2;
+
+/**
+ * @author vlads
+ *
+ * To test if MIDlet can override javax.microedition package on the device.
+ */
+public class NewJSR2Facade {
+
+	private static class WorkerImpl implements NewJSR2Interface {
+
+		public String doStuff(String data) {
+			System.out.println("Working on " + data);
+			return data;
+		}
+		
+	}
+	
+	public static NewJSR2Interface createWorker() {
+		return new WorkerImpl();
+	}
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Facade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Interface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Interface.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Interface.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Interface.java Mon May 26 15:20:19 2008
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 javax.microedition.newjsr2;
+
+/**
+ * @author vlads
+ * 
+ * To test if MIDlet can override javax.microedition package on the device.
+ * 
+ */
+public interface NewJSR2Interface {
+
+	public String doStuff(String data);
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/javax/microedition/newjsr2/NewJSR2Interface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsCanvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsCanvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsCanvas.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsCanvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,64 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Canvas;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Graphics;
+
+public abstract class BaseTestsCanvas extends Canvas implements CommandListener, DisplayableUnderTests {
+
+	protected boolean fullScreenMode = false;
+	
+	protected static final Command fullScreenModeCommand = new Command("Full Screen", Command.ITEM, 5);
+	
+	public BaseTestsCanvas(String title) {
+		super();
+		super.setTitle(title);
+		
+		addCommand(DisplayableUnderTests.backCommand);
+		addCommand(fullScreenModeCommand);
+		setCommandListener(this);
+	}
+
+	public int writeln(Graphics g, int line, String s) {
+		int y = (g.getFont().getHeight() + 1) * line;
+		g.drawString(s, 0, y, Graphics.LEFT | Graphics.TOP);
+		return y;
+	}
+	
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == DisplayableUnderTests.backCommand) {
+				Manager.midletInstance.showMainPage();
+			} else if (c == fullScreenModeCommand) {
+				setFullScreenMode(!fullScreenMode);
+				repaint();
+			}
+		}
+	}
+	
+	public void setFullScreenMode(boolean mode) {
+		fullScreenMode = mode;
+		super.setFullScreenMode(mode);
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsCanvas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsForm.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsForm.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsForm.java Mon May 26 15:20:19 2008
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+
+public abstract class BaseTestsForm extends Form implements CommandListener, DisplayableUnderTests {
+
+	public BaseTestsForm(String title) {
+		super(title);
+
+		addCommand(DisplayableUnderTests.backCommand);
+		setCommandListener(this);
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == backCommand) {
+				Manager.midletInstance.showMainPage();
+			}
+		}
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/BaseTestsForm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/DisplayableUnderTests.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/DisplayableUnderTests.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/DisplayableUnderTests.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/DisplayableUnderTests.java Mon May 26 15:20:19 2008
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Command;
+
+public interface DisplayableUnderTests {
+
+	public static final Command backCommand = new Command("MainMenu", Command.BACK, 1);
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/DisplayableUnderTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingCanvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingCanvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingCanvas.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingCanvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,76 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Graphics;
+
+public class ErrorHandlingCanvas extends BaseTestsCanvas {
+	
+	boolean makeErrorInPaint = false;
+	
+	int lastKeyCode = 0;
+	
+	public ErrorHandlingCanvas() {
+		super("Canvas with Errors");
+	}
+
+	protected void paint(Graphics g) {
+		int width = getWidth();
+        int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+		
+		g.setColor(0);
+		int line = 0;
+		writeln(g, line++, "Make Error Canvas");
+		if (fullScreenMode) {
+			writeln(g, line++, "0 - Normal Mode");
+		}
+		writeln(g, line++, "1 - Error in keyPressed");
+		writeln(g, line++, "2 - Error in pain");
+		if (makeErrorInPaint) {
+			makeErrorInPaint = false;
+			writeln(g, line++, "Making error");
+			throw new IllegalArgumentException("Emulator Should still work");
+		}
+		if (lastKeyCode != 0) {
+			writeln(g, line++, "KeyCode: " + lastKeyCode);
+		}
+		
+	}
+	
+	protected void keyPressed(int keyCode) {
+		switch (keyCode) {
+		case '0':
+			if (fullScreenMode) {
+				setFullScreenMode(false);
+			}
+			break;
+		case '1':
+			throw new IllegalArgumentException("Emulator Should still work");
+		case '2':
+			makeErrorInPaint = true;
+			break;
+		}
+		lastKeyCode = keyCode;
+		repaint();
+	}
+}
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingCanvas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingForm.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingForm.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingForm.java Mon May 26 15:20:19 2008
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+
+public class ErrorHandlingForm extends BaseTestsForm {
+
+	static final Command makeErrorCommand = new Command("make error", Command.ITEM, 1);
+	
+	static final Command catchExceptionCommand = new Command("catch Exception", Command.ITEM, 2);
+	
+	public ErrorHandlingForm() {
+		super("Form with Errors");
+		addCommand(makeErrorCommand);
+		addCommand(catchExceptionCommand);
+    }
+	
+	
+	private void tryCatchTest() {
+		System.out.println("test Exception catch bytcode injection");
+		try {
+			throwExceptionFunction();		
+		} catch (IllegalArgumentException e) {
+			handleCatchIllegalArgumentException(e);
+		}
+		try {
+			throwExceptionFunction();		
+		} catch (Throwable e) {
+			handleCatchThrowable(e);
+		}
+	}
+
+	public static Throwable handleCatchIllegalArgumentException(Throwable t) {
+		System.out.println("App caught " + t.toString());
+		return t;
+	}
+	
+	public static Throwable handleCatchThrowable(Throwable t) {
+		System.out.println("App caught " + t.toString());
+		return t;
+	}
+	
+	private void throwExceptionFunction() {
+		System.out.println("App will throw new IllegalArgumentException");
+		throw new IllegalArgumentException("Emulator should print stack trace");
+	}
+
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == makeErrorCommand) {
+				throw new IllegalArgumentException("Emulator Should still work");
+			} else if (c == catchExceptionCommand) {
+				tryCatchTest();
+			}
+		}
+		super.commandAction(c, d);
+	}
+}
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ErrorHandlingForm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ItemsOnForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ItemsOnForm.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ItemsOnForm.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ItemsOnForm.java Mon May 26 15:20:19 2008
@@ -0,0 +1,54 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Item;
+import javax.microedition.lcdui.StringItem;
+
+public class ItemsOnForm extends Form implements CommandListener, DisplayableUnderTests {
+
+	public static final Command addCommand = new Command("add", Command.ITEM, 1);
+	
+	public ItemsOnForm(Item[] items) {
+		super("Form with Items", items);
+		addCommand(addCommand);
+		addCommand(DisplayableUnderTests.backCommand);
+		setCommandListener(this);
+    }
+	
+	public ItemsOnForm() {
+		this(null);
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == DisplayableUnderTests.backCommand) {
+				Manager.midletInstance.showMainPage();
+			} if (c == addCommand) {
+				append(new StringItem("si:", "StringItem" + Manager.sequenceNext()));
+			}
+		}
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/ItemsOnForm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MIDletUnderTests.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MIDletUnderTests.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MIDletUnderTests.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MIDletUnderTests.java Mon May 26 15:20:19 2008
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+
+public interface MIDletUnderTests {
+
+	public static final Command exitCommand = new Command("Exit", Command.EXIT, 1);
+
+	public void showMainPage();
+	
+	public void setCurrentDisplayable(Displayable nextDisplayable);
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MIDletUnderTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MainTestMIDlet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MainTestMIDlet.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MainTestMIDlet.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MainTestMIDlet.java Mon May 26 15:20:19 2008
@@ -0,0 +1,114 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+public class MainTestMIDlet extends MIDlet implements CommandListener, MIDletUnderTests {
+
+	// static final Command exitCommand = MIDletUnderTests.exitCommand;
+
+	List menuList = null;
+
+	Vector testPanels;
+
+	static {
+		System.out.println("MainTestMIDlet static init");
+		ThreadTestsForm.onMIDletInit();
+	}
+
+	public MainTestMIDlet() {
+
+	}
+
+	protected void startApp() throws MIDletStateChangeException {
+		Manager.midletInstance = this;
+
+		if (menuList == null) {
+			testPanels = new Vector();
+			testPanels.addElement(new ItemsOnForm());
+			testPanels.addElement(new ErrorHandlingForm());
+			testPanels.addElement(new ErrorHandlingCanvas());
+			testPanels.addElement(new RecordStoreForm());
+			testPanels.addElement(new ThreadTestsForm());
+			if (OverrideNewJSRCanvas.enabled) {
+				testPanels.addElement(new OverrideNewJSRCanvas());
+			}
+			if (OverrideNewJSR2Canvas.enabled) {
+				testPanels.addElement(new OverrideNewJSR2Canvas());
+			}
+			if (OverrideNewJSR2Canvas.enabled) {
+				testPanels.addElement(new OverrideNewJSR2Canvas());
+			}
+			if (PreporcessorTestCanvas.enabled) {
+				testPanels.addElement(new PreporcessorTestCanvas());
+			}
+
+			menuList = new List("Manual Tests", List.IMPLICIT);
+
+			for (Enumeration iter = testPanels.elements(); iter.hasMoreElements();) {
+				menuList.append(((Displayable) iter.nextElement()).getTitle(), null);
+			}
+			menuList.addCommand(exitCommand);
+			menuList.setCommandListener(this);
+		}
+		setCurrentDisplayable(menuList);
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == menuList) {
+			if (c == List.SELECT_COMMAND) {
+				setCurrentDisplayable((Displayable) testPanels.elementAt(menuList.getSelectedIndex()));
+			} else if (c == exitCommand) {
+				try {
+					destroyApp(true);
+				} catch (MIDletStateChangeException e) {
+				}
+				notifyDestroyed();
+			}
+		}
+	}
+
+	public void showMainPage() {
+		setCurrentDisplayable(menuList);
+	}
+
+	public void setCurrentDisplayable(Displayable nextDisplayable) {
+		Display display = Display.getDisplay(this);
+		// Displayable current = display.getCurrent();
+		display.setCurrent(nextDisplayable);
+	}
+
+	protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
+	}
+
+	protected void pauseApp() {
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/MainTestMIDlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/Manager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/Manager.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/Manager.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/Manager.java Mon May 26 15:20:19 2008
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+
+public abstract class Manager {
+
+	public static MIDletUnderTests midletInstance = null;
+
+	public static int sequence = 0;
+	
+	public static int sequenceNext() {
+		return (sequence++);
+	}
+	
+	public static int sequenceValue() {
+		return sequence;
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/Manager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Canvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Canvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Canvas.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Canvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Graphics;
+
+/**
+ * @author vlads
+ *
+ */
+public class OverrideNewJSR2Canvas  extends BaseTestsCanvas {
+
+		public static final boolean enabled = false;
+		
+		public OverrideNewJSR2Canvas() {
+			super("OverrideNewJSR2");
+		}
+
+		/* (non-Javadoc)
+		 * @see javax.microedition.lcdui.Canvas#paint(javax.microedition.lcdui.Graphics)
+		 */
+		protected void paint(Graphics g) {
+			int width = getWidth();
+	        int height = getHeight();
+
+			g.setGrayScale(255);
+			g.fillRect(0, 0, width, height);
+			
+			g.setColor(0);
+			int line = 0;
+			writeln(g, line++, "Override New JSR2");
+			
+			String result;
+			
+			try {
+				result = new OverrideNewJSR2Client().doJSR2Stuff("Can use new classes");
+				writeln(g, line++, "success");
+			} catch (Throwable e) {
+				writeln(g, line++, "failure");
+				result = e.toString();
+			}
+			
+			writeln(g, line++, result);
+		}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Canvas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Client.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Client.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Client.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Client.java Mon May 26 15:20:19 2008
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.newjsr2.NewJSR2Facade;
+
+/**
+ * @author vlads
+ *
+ */
+public class OverrideNewJSR2Client {
+	
+	public String doJSR2Stuff(String data) {
+		return NewJSR2Facade.createWorker().doStuff(data);
+	}
+	
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSR2Client.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRCanvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRCanvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRCanvas.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRCanvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,63 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.lcdui.Graphics;
+
+/**
+ * @author vlads
+ *  To test if MIDlet can override javax.microedition package on the device.
+ */
+public class OverrideNewJSRCanvas extends BaseTestsCanvas {
+
+	public static final boolean enabled = true;
+	
+	public OverrideNewJSRCanvas() {
+		super("OverrideNew IO JSR");
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.microedition.lcdui.Canvas#paint(javax.microedition.lcdui.Graphics)
+	 */
+	protected void paint(Graphics g) {
+		int width = getWidth();
+        int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+		
+		g.setColor(0);
+		int line = 0;
+		writeln(g, line++, "Override New JSR");
+		
+		String result;
+		
+		try {
+			result = new OverrideNewJSRClient().doJSRStuff("Can use new classes");
+			writeln(g, line++, "success");
+		} catch (Throwable e) {
+			writeln(g, line++, "failure");
+			result = e.toString();
+		}
+		
+		writeln(g, line++, result);
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRCanvas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRClient.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRClient.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRClient.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRClient.java Mon May 26 15:20:19 2008
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import javax.microedition.io.newjsr.NewJSRFacade;
+
+/**
+ * @author vlads
+ *  To test if MIDlet can override javax.microedition package on the device.
+ */
+public class OverrideNewJSRClient {
+
+	public String doJSRStuff(String data) {
+		return NewJSRFacade.createWorker().doStuff(data);
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/OverrideNewJSRClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/PreporcessorTestCanvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/PreporcessorTestCanvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/PreporcessorTestCanvas.java (added)
+++ harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/PreporcessorTestCanvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,134 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.microemu.tests;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import javax.microedition.lcdui.Graphics;
+
+/**
+ * @author vlads
+ * 
+ */
+public class PreporcessorTestCanvas extends BaseTestsCanvas {
+
+	public static final boolean enabled = true;
+
+	public PreporcessorTestCanvas() {
+		super("bytecode test");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.microedition.lcdui.Canvas#paint(javax.microedition.lcdui.Graphics)
+	 */
+	protected void paint(Graphics g) {
+		int width = getWidth();
+		int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+
+		g.setColor(0);
+		int line = 0;
+		writeln(g, line++, "bytecode test");
+
+		System.out.println("print data to console");
+
+		try {
+			String resourceName = "/app-data.txt";
+			String expected = "private app-data";
+
+			String result = verifyLoadStrings(String.class.getResourceAsStream(resourceName), "String.class. "
+					+ resourceName, expected);
+
+			writeln(g, line++, "loaded " + result);
+		} catch (Throwable e) {
+			writeln(g, line++, "failure");
+			writeln(g, line++, e.toString());
+		}
+
+		try {
+			String resourceName = "resource-path-text.txt";
+			String expected = null;
+
+			String result = verifyLoadStrings(PreporcessorTestCanvas.class.getResourceAsStream(resourceName),
+					"App.class. " + resourceName, expected);
+
+			writeln(g, line++, "loaded " + result);
+		} catch (Throwable e) {
+			writeln(g, line++, "failure");
+			writeln(g, line++, e.toString());
+		}
+
+		try {
+			String resourceName = "resource-package.txt";
+			String expected = "package relative";
+
+			String result = verifyLoadStrings(PreporcessorTestCanvas.class.getResourceAsStream(resourceName),
+					"App.class. " + resourceName, expected);
+
+			writeln(g, line++, "loaded " + result);
+		} catch (Throwable e) {
+			writeln(g, line++, "failure");
+			writeln(g, line++, e.toString());
+		}
+	}
+
+	private String verifyLoadStrings(InputStream inputstream, String resourceName, String expected) {
+		if (inputstream == null) {
+			if (expected == null) {
+				System.out.println("OK - Resource not found " + resourceName);
+				return "{not found}";
+			} else {
+				System.err.println("Resource not found " + resourceName);
+			}
+			throw new RuntimeException("Resource not found " + resourceName);
+		} else {
+			if (expected == null) {
+				throw new RuntimeException("Can access resource " + resourceName);
+			}
+		}
+		try {
+			InputStreamReader r = new InputStreamReader(inputstream);
+			StringBuffer value = new StringBuffer();
+			int b;
+			while ((b = r.read()) != -1) {
+				value.append((char) b);
+			}
+			if (!expected.equals(value.toString())) {
+				throw new RuntimeException("Unexpected resource " + resourceName + " value [" + value + "]\nexpected ["
+						+ expected + "]");
+			}
+			return value.toString();
+		} catch (IOException e) {
+			e.printStackTrace();
+			throw new RuntimeException("Resource read error " + resourceName + " " + e.getMessage());
+		} finally {
+			try {
+				inputstream.close();
+			} catch (IOException ignore) {
+			}
+		}
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-tests/microemu-test-midlet/src/main/java/org/microemu/tests/PreporcessorTestCanvas.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message