|
From: <tre...@us...> - 2007-10-15 13:04:49
|
Revision: 493
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=493&view=rev
Author: trevorolio
Date: 2007-10-15 06:04:48 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Added a body texture web resource, backed by the media service. This is used in conjunction with body configurations to provide users with skin customization.
Still to come in texture land:
the body editor UI needs some design love to incorporate the texture upload form
body loading takes too long and shows no progress information
a base skin texture with decal textures baked on top
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-10-15 13:04:46 UTC (rev 492)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-10-15 13:04:48 UTC (rev 493)
@@ -37,7 +37,7 @@
public class AppletTestWindow extends Frame {
Dimension appDimension = new Dimension(500, 500);
-
+
public ViewerApplet applet = null;
EnvironmentStub clientStub1 = null;
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-15 13:04:46 UTC (rev 492)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-10-15 13:04:48 UTC (rev 493)
@@ -15,6 +15,7 @@
import java.awt.Dimension;
import java.awt.Shape;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -90,6 +91,8 @@
WebAPIDescriptor descriptor1 = null;
+ String mikeBodyTextureResourcePath = "sample-art3d/TestBodyTexture-Mike.jpg";
+
public void setUp() {
try {
PropStorage ps=new PropStorage();
@@ -102,6 +105,7 @@
linkURI1 = new URI("http://example.com/");
wire1 = new WebAPIClientWire();
descriptor1 = new WebAPIDescriptor(serviceURI1);
+
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
@@ -255,6 +259,14 @@
assertEquals(0, configDoc.getBodySettingDocuments().length);
configDoc = basicWebClient.updateBodyConfiguration(configDoc);
assertEquals(0, configDoc.getBodySettingDocuments().length);
+
+ InputStream textureData = UIConstants.getResource(mikeBodyTextureResourcePath);
+ assertNotNull(textureData);
+ basicWebClient.setBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID(), textureData, "image/jpeg");
+ textureData = basicWebClient.getBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID());
+ assertStreamsEqual(UIConstants.getResource(mikeBodyTextureResourcePath), textureData);
+ basicWebClient.deleteBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID());
+ assertNull(basicWebClient.getBodyTexture(basicAuthenticator.getUsername(), configDoc.getBodyConfigurationID()));
}
public void testWebAPIClient() throws IOException {
@@ -912,6 +924,20 @@
return newTemplateDoc;
}
+ private void assertStreamsEqual(InputStream input1, InputStream input2) throws IOException {
+ if(input1 == null || input2 == null){
+ fail("Not equal, null inputs: " + input1 + ", " + input2);
+ return;
+ }
+ while(true){
+ int read = input1.read();
+ assertEquals(read, input2.read());
+ if(read == -1){
+ return;
+ }
+ }
+ }
+
private void consume(InputStream input) throws IOException {
byte[] buffer = new byte[2048];
while (input.read(buffer) != -1) {
Added: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestBodyTexture-Mike.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|