Skip to content

Commit 429f5cb

Browse files
committed
poi integration test. and fix for issue joeferner#30
1 parent b39222d commit 429f5cb

6 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/javaObject.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
std::string fieldNameStr = javaToString(env, fieldNameJava);
6666

6767
v8::Handle<v8::String> fieldName = v8::String::New(fieldNameStr.c_str());
68-
funcTemplate->PrototypeTemplate()->SetAccessor(fieldName, fieldGetter, fieldSetter);
68+
funcTemplate->InstanceTemplate()->SetAccessor(fieldName, fieldGetter, fieldSetter);
6969
}
7070

7171
sFunctionTemplates[className] = persistentFuncTemplate = v8::Persistent<v8::FunctionTemplate>::New(funcTemplate);
@@ -227,7 +227,6 @@ JavaObject::~JavaObject() {
227227
JNIEnv *env = self->m_java->getJavaEnv();
228228

229229
PUSH_LOCAL_JAVA_FRAME();
230-
231230
jobject newValue = v8ToJava(env, value);
232231

233232
v8::String::AsciiValue propertyCStr(property);
1.78 MB
Binary file not shown.
1.17 MB
Binary file not shown.

testIntegration/poi/poiTest.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var java = require('../../');
2+
java.classpath.push("poi-3.9-20121203.jar");
3+
java.classpath.push("poi-scratchpad-3.9-20121203.jar");
4+
5+
var stream = java.newInstanceSync("java.io.FileInputStream", 'presentation.ppt');
6+
var ppt = java.newInstanceSync('org.apache.poi.hslf.usermodel.SlideShow', stream);
7+
stream.close();
8+
9+
var pgsize = ppt.getPageSizeSync();
10+
11+
var slides = ppt.getSlidesSync();
12+
13+
var TYPE_INT_RGB = java.getStaticFieldValue("java.awt.image.BufferedImage", "TYPE_INT_RGB");
14+
15+
var img, graphics;
16+
for (i = 0; i < slides.length; i++) {
17+
img = java.newInstanceSync('java.awt.image.BufferedImage', pgsize.width, pgsize.height, TYPE_INT_RGB);
18+
graphics = img.createGraphicsSync();
19+
}
20+
console.log('done');

testIntegration/poi/poiTest.js~

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
70 KB
Binary file not shown.

0 commit comments

Comments
 (0)