Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
initial set up of test case for issue 35
  • Loading branch information
pmuellr committed Mar 3, 2011
1 parent 487714e commit 5aa805750c3375e08349d3c3dc1327d00cab1e2d
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 0 deletions.
@@ -0,0 +1,12 @@
<?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 combineaccessrules="false" kind="src" path="/weinre.application"/>
<classpathentry combineaccessrules="false" kind="src" path="/weinre.build"/>
<classpathentry combineaccessrules="false" kind="src" path="/weinre.doc"/>
<classpathentry combineaccessrules="false" kind="src" path="/weinre.server"/>
<classpathentry combineaccessrules="false" kind="src" path="/weinre.server.android"/>
<classpathentry combineaccessrules="false" kind="src" path="/weinre.web"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>weinre.test</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>
@@ -0,0 +1,12 @@
#Thu Mar 03 11:36:18 EST 2011
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
Binary file not shown.
@@ -0,0 +1,27 @@
#!/usr/bin/env node

var util = require("util")
var data = ""

process.stdin.setEncoding('utf8')

process.stdin.on('data', function (chunk) {
data = data + chunk
console.log("\nread: " + chunk + " (len: " + chunk.length + ")")
})

process.stdin.on('end', function () {
console.log("\ndone: " + data)
data = eval(data)
var object = JSON.parse(data)
var redo = JSON.stringify(object)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
var redo = JSON.stringify(redo)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
var redo = JSON.stringify(redo)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
console.log("\ndump:")
console.log(util.inspect(object,true,null))
})

process.stdin.resume()
@@ -0,0 +1 @@
"[\"{\\\"interface\\\":\\\"WeinreTargetCommands\\\",\\\"method\\\":\\\"registerTarget\\\",\\\"args\\\":\\\"[\\\\\\\"file:///Users/aktowns/Library/Application Support/iPhone Simulator/4.2/Applications/3A54251E-6728-4EC6-A019-14AC875FB8DA/Documents/issues/testfile/023-widg/L1-2.html\\\\\\\", \\\\\\\"???::1\\\\\\\"]\\\"}\"]"
@@ -0,0 +1,41 @@
/*
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
* Copyright (c) 2010, 2011 IBM Corporation
*/

package weinre.test.issues;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

import org.apache.wink.json4j.JSONArray;

//-------------------------------------------------------------------
public class Issue_35 {

//-------------------------------------------------------------------
static public void main(String[] args) throws Throwable {
new Issue_35().main();
}

//-------------------------------------------------------------------
private void main() throws Throwable {
InputStream iStream = getClass().getResourceAsStream("Issue_35.txt");

Reader reader = new InputStreamReader(iStream);

char buffer[] = new char[4096];
int len = reader.read(buffer,0,buffer.length);
// String data = String.valueOf(buffer, 0, len);
String data = String.valueOf(buffer, 1, len-2);

reader.close();

new JSONArray(data);

}

}
@@ -0,0 +1,27 @@
#!/usr/bin/env node

var util = require("util")
var data = ""

process.stdin.setEncoding('utf8')

process.stdin.on('data', function (chunk) {
data = data + chunk
console.log("\nread: " + chunk + " (len: " + chunk.length + ")")
})

process.stdin.on('end', function () {
console.log("\ndone: " + data)
data = eval(data)
var object = JSON.parse(data)
var redo = JSON.stringify(object)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
var redo = JSON.stringify(redo)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
var redo = JSON.stringify(redo)
console.log("\nredo: " + redo + " (len: " + redo.length + ")")
console.log("\ndump:")
console.log(util.inspect(object,true,null))
})

process.stdin.resume()
@@ -0,0 +1 @@
"[\"{\\\"interface\\\":\\\"WeinreTargetCommands\\\",\\\"method\\\":\\\"registerTarget\\\",\\\"args\\\":\\\"[\\\\\\\"file:///Users/aktowns/Library/Application Support/iPhone Simulator/4.2/Applications/3A54251E-6728-4EC6-A019-14AC875FB8DA/Documents/issues/testfile/023-widg/L1-2.html\\\\\\\", \\\\\\\"???::1\\\\\\\"]\\\"}\"]"

0 comments on commit 5aa8057

Please sign in to comment.