[
https://issues.apache.org/jira/browse/OLIO-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mandy Waite updated OLIO-36:
----------------------------
Attachment: Rails_RandomUtil_main.patch
Rails_UIDriver_main.patch
The fixes in the attached patches for com.sun.web20.driver.UIDriver and
com.sun.web20.util.RandomUtil have been used in testing for a month now and
they fix all of the problems associated with this issue. They may need some
fine tuning, for example currently we use a single httpclient for each
simulated user, as opposed to creating a new one every time a user logs in. The
patches are based on svn revision 738549.
The fixes also require changes to the Rails application as the Apache
httpclient can not generate useful content_type headers without including
'charset=<some encoding>" as part of the content type. The changes made include
adding charset='8859-1' to the end of the 'image/jpeg' and 'application/pdf'
which is the default if no encoding is specified when adding the files to the
PostMethod in the code. The changes are:
diff -r -u olioapp/app/models/document.rb olioapp-working/app/models/document.rb
--- olioapp/app/models/document.rb 2008-10-20 12:32:04.000000000 -0700
+++ olioapp-working/app/models/document.rb 2008-12-30 10:09:28.372724723 -0
800
@@ -11,7 +11,7 @@
class Document < ActiveRecord::Base
- has_attachment :content_type => ['application/pdf', 'application/msword',
'text/plain'],
+ has_attachment :content_type => ['application/pdf', 'application/pdf;
charset=ISO-8859-1', 'application/msword', 'text/plain'],
:storage => :file_system,
:path_prefix => DOCUMENT_STORE_PATH
=============================================================================
diff -r -u
olioapp/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb
olioapp-working/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb
--- olioapp/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb
2008-10-20 12:32:14.000000000 -0700
+++
olioapp-working/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb
2009-01-01 06:10:33.836562068 -0800
@@ -2,7 +2,7 @@
module AttachmentFu # :nodoc:
@@default_processors = %w(ImageScience Rmagick MiniMagick Gd2 CoreImage)
@@tempfile_path = File.join(RAILS_ROOT, 'tmp', 'attachment_fu')
- @@content_types = ['image/jpeg', 'image/pjpeg', 'image/gif',
'image/png', 'image/x-png', 'image/jpg']
+ @@content_types = ['image/jpeg; charset=ISO-8859-1', 'image/jpeg',
'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg']
mattr_reader :content_types, :tempfile_path, :default_processors
mattr_writer :tempfile_path
Apache HttpClient also doesn't handle redirects for Post (nor should it), but
it emits a warning when a redirect was received. This can be suppressed by
adding:
org.apache.commons.httpclient.HttpMethodBase.level=SEVERE
to $FABAN_HOME/config/logging.properties
> Olio Rails driver causes no data to be added to the DB due to Session
> management issues
> ---------------------------------------------------------------------------------------
>
> Key: OLIO-36
> URL: https://issues.apache.org/jira/browse/OLIO-36
> Project: Olio
> Issue Type: Bug
> Components: rails-driver
> Environment: OpenSolaris 2008.11 for SUT, DB and Faban
> Reporter: Mandy Waite
> Assignee: Mandy Waite
> Attachments: Rails_RandomUtil_main.patch, Rails_UIDriver_main.patch
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> This by necessity is a meta-bug as all of the described issues were fixed in
> order to make the driver work correctly during testing.
> When running tests on the Olio Rails Driver, the following issues were
> observed (some were masked by others):
> - doAddEvent() is always called in a new and separate session and so fails
> - doPersonDetail() is always called in a new and separate session and so fails
> - doAddAttendee() is always called in a new and separate session and so fails
> - Olio Rails application requires use of authenticity_token exchange between
> it and client for many ops
> - Post Parameters for event_image and event_document are incorrectly specified
> - Post Parameters added with the correct 'content_type' so as to be
> acceptable to the Rails app
> - Rails app needs changing to accept content_typeS with '; charset=..." (Side
> effect of using Apache HttpClient Parts)
> - Phone numbers generated by RandomUtil don't work with the Rails App
> - Scraping of event page results in some invalid event ids being used to view
> events
> - Timing for doAddEvent() is measured even if the op isn't run (no-op'd
> because user not logged on)
> - Parsing of images from responseBuffer fails as it expects the
> responseBuffer to be the same as with the PHP app
> - Error message when trying to view user but not logged on due to state
> transition from addPerson to PersonDetail
> - EventDetailImages metric target is set to > 9 when there is only 1 image on
> each event page
> - Had to change Timing to manual in several ops because of the use of Apache
> HttpClient
> - FileLoader.java uses wrong names for thumbnails
> Most of the fixes involve using the Apache HttpClient instead of the Faban
> HttpTransport which allows better support for Session management and for the
> uploading of files within a User Session. Others come about because parts of
> the driver are still looking for the app to behave as per the PHP App.
> Particular in terms of what data the app will accept and what data it
> returns.
> I'm willing to break this out in to separate bugs, but it would be difficult
> to address them all separately so it's better to deliver the fixes as a
> single patch. There are also some additions required on the app side, as the
> Apache HttpClient insists on adding 'charset=' to the content_type field
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.