chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r936943 [1/4] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-test: chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/ chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit...
Date Thu, 22 Apr 2010 16:34:54 GMT
Author: dcaruana
Date: Thu Apr 22 16:34:53 2010
New Revision: 936943

URL: http://svn.apache.org/viewvc?rev=936943&view=rev
Log:
Replace tabs with spaces

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractBindingIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractSimpleBindingIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AtomPubSimpleBindingIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/WebServicesSimpleBindingIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSessionParameter.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyAclCapabilityIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyContentStreamIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyCreateSessionIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyDiscoverIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyNavigationIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyObjectIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyRepositoryInfoIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlySessionIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyTypeIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/WriteObjectIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/suite/SuiteWebServiceIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AbstractSampleIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/AtomPubSampleIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/WebServicesSampleIT.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Command.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/Commander.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/DeleteCommand.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/InfosCommand.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tools/src/main/java/org/apache/chemistry/opencmis/commander/ListCommand.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/MultiThreadedObjectGenerator.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjGenApp.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/TimeLogger.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-browser/src/main/java/org/apache/chemistry/opencmis/browser/BrowseServlet.java Thu Apr 22 16:34:53 2010
@@ -58,340 +58,340 @@ import org.w3c.dom.Document;
  */
 public class BrowseServlet extends HttpServlet {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	private static Log log = LogFactory.getLog(BrowseServlet.class);
+    private static Log log = LogFactory.getLog(BrowseServlet.class);
 
-	private static final String CONTEXT_PREFIX = "{ctx}";
-	private static final String PARAM_URL = "url";
-	private static final String INIT_PARAM_AUXROOT = "auxroot";
-	private static final String INIT_PARAM_ALLOW = "allow";
-	private static final String INIT_PARAM_STYLESHEET = "stylesheet:";
-
-	private static final int BUFFER_SIZE = 64 * 1024;
-
-	private String fAuxRoot = "";
-	private String fAllow = ".*";
-	private Map<String, Source> fStyleSheets;
-
-	/**
-	 * Initializes the browser servlet.
-	 */
-	@SuppressWarnings("unchecked")
-	@Override
-	public void init(ServletConfig config) throws ServletException {
-		fStyleSheets = new HashMap<String, Source>();
-
-		DocumentBuilder builder = null;
-		try {
-			DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-			builderFactory.setNamespaceAware(true);
-			builder = builderFactory.newDocumentBuilder();
-		} catch (Exception e) {
-			e.printStackTrace();
-			return;
-		}
-
-		Enumeration<String> initParams = config.getInitParameterNames();
-		while (initParams.hasMoreElements()) {
-			String param = initParams.nextElement();
-			if (param.startsWith(INIT_PARAM_STYLESHEET)) {
-				String contentType = param.substring(INIT_PARAM_STYLESHEET.length());
-				String stylesheetFileName = config.getInitParameter(param);
-
-				InputStream stream = config.getServletContext().getResourceAsStream(stylesheetFileName);
-				if (stream != null) {
-					try {
-						Document xslDoc = builder.parse(stream);
-						addStylesheet(contentType, new DOMSource(xslDoc));
-
-						log.info("Stylesheet: '" + contentType + "' -> '" + stylesheetFileName + "'");
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-			}
-		}
-
-		String initAuxRoot = config.getInitParameter(INIT_PARAM_AUXROOT);
-		if (initAuxRoot != null) {
-			fAuxRoot = initAuxRoot;
-			log.info("Auxiliary root: " + fAuxRoot);
-		}
-
-		String initAllow = config.getInitParameter(INIT_PARAM_ALLOW);
-		if (initAllow != null) {
-			fAllow = initAllow;
-			log.info("Allow pattern: " + fAllow);
-		}
-	}
-
-	/**
-	 * Handles GET requests.
-	 */
-	@Override
-	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-		if (req.getParameter(PARAM_URL) == null) {
-			printInput(req, resp);
-			return;
-		}
-
-		doBrowse(req, resp);
-	}
-
-	/**
-	 * Main method of the browser.
-	 */
-	protected void doBrowse(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-		String browseUrl = req.getParameter(PARAM_URL);
-
-		// check URL
-		if (!browseUrl.matches(fAllow)) {
-			printError(req, resp, "Prohibited URL!", null);
-			return;
-		}
-
-		// re-encode parameters
-		int qm = browseUrl.indexOf('?');
-		if ((qm > -1) && (browseUrl.length() > qm + 1)) {
-			StringBuilder urlSb = new StringBuilder(browseUrl.substring(0, qm + 1));
-			StringBuilder paramSb = new StringBuilder();
-
-			for (int i = qm + 1; i < browseUrl.length(); i++) {
-				char c = browseUrl.charAt(i);
-				if ((c == '=') || (c == '&')) {
-					urlSb.append(URLEncoder.encode(paramSb.toString(), "UTF-8"));
-					urlSb.append(c);
-					paramSb = new StringBuilder();
-				} else {
-					paramSb.append(c);
-				}
-			}
-
-			if (paramSb.length() > 0) {
-				urlSb.append(URLEncoder.encode(paramSb.toString(), "UTF-8"));
-			}
-
-			browseUrl = urlSb.toString();
-		}
-
-		try {
-			// get content
-			URL url = new URL(browseUrl);
-			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-			conn.setDoInput(true);
-			conn.setDoOutput(false);
-			conn.setRequestMethod("GET");
-			String authHeader = req.getHeader("Authorization");
-			if (authHeader != null) {
-				conn.setRequestProperty("Authorization", authHeader);
-			}
-			conn.connect();
-
-			// ask for login
-			if (conn.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
-				resp.setHeader("WWW-Authenticate", conn.getHeaderField("WWW-Authenticate"));
-				resp.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authorization Required");
-				return;
-			}
-
-			// debug messages
-			if (log.isDebugEnabled()) {
-				log.debug("'" + browseUrl + "' -> '" + conn.getContentType() + "'");
-			}
-
-			// find stylesheet
-			Source stylesheet = getStylesheet(conn.getContentType());
-
-			OutputStream out = null;
-			InputStream in = new BufferedInputStream(conn.getInputStream(), BUFFER_SIZE);
-
-			if (stylesheet == null) {
-				// no stylesheet found -> conduct content
-				resp.setContentType(conn.getContentType());
-				out = new BufferedOutputStream(resp.getOutputStream(), BUFFER_SIZE);
-
-				byte[] buffer = new byte[BUFFER_SIZE];
-				int b;
-				while ((b = in.read(buffer)) > -1) {
-					out.write(buffer, 0, b);
-				}
-			} else {
-				// apply stylesheet
-				TransformerFactory f = TransformerFactory.newInstance();
-				Transformer t = f.newTransformer(stylesheet);
-				t.setParameter("browseUrl", getServletUrl(req) + "?url=");
-				t.setParameter("auxRoot", getAuxRoot(req, fAuxRoot));
-
-				resp.setContentType("text/html");
-				out = new BufferedOutputStream(resp.getOutputStream(), BUFFER_SIZE);
-
-				Source s = new StreamSource(in);
-				Result r = new StreamResult(out);
-				t.transform(s, r);
-			}
-
-			try {
-				out.flush();
-				out.close();
-			} catch (Exception e) {
-			}
-
-			try {
-				in.close();
-			} catch (Exception e) {
-			}
-		} catch (Exception e) {
-			printError(req, resp, e.getMessage(), e);
-			return;
-		}
-	}
-
-	// ---- utilities ----
-
-	/**
-	 * Assigns a stylesheet to a content type.
-	 */
-	private void addStylesheet(String contentType, Source source) {
-		if ((contentType == null) || (source == null)) {
-			return;
-		}
-
-		fStyleSheets.put(contentType.trim().toLowerCase(), source);
-	}
-
-	/**
-	 * Returns the stylesheet for the given content type or <code>null</code> if
-	 * no stylesheet is assigned to content type.
-	 */
-	private Source getStylesheet(String contentType) {
-		if (contentType == null) {
-			return null;
-		}
-
-		String[] ctp = contentType.trim().toLowerCase().split(";");
-		Source source = null;
-
-		StringBuilder match = new StringBuilder();
-		int i = 0;
-		while (source == null && i < ctp.length) {
-			if (i > 0) {
-				match.append(";");
-			}
-			match.append(ctp[i]);
-			source = fStyleSheets.get(match.toString());
-			i++;
-		}
-
-		return source;
-	}
-
-	/**
-	 * Returns the context URL of this servlet.
-	 */
-	private String getContextUrl(HttpServletRequest request) {
-		String scheme = request.getScheme();
-		int port = request.getServerPort();
-
-		if ("http".equals(scheme) && (port == 80)) {
-			port = -1;
-		}
-		if ("https".equals(scheme) && (port == 443)) {
-			port = -1;
-		}
-
-		return scheme + "://" + request.getServerName() + (port > 0 ? ":" + port : "") + request.getContextPath();
-	}
-
-	/**
-	 * Returns the URL of this servlet.
-	 */
-	private String getServletUrl(HttpServletRequest request) {
-		return getContextUrl(request) + request.getServletPath();
-	}
-
-	/**
-	 * Returns the root URL of auxiliary files.
-	 */
-	private String getAuxRoot(HttpServletRequest request, String auxRoot) {
-		if (auxRoot == null) {
-			return getContextUrl(request);
-		} else if (auxRoot.startsWith(CONTEXT_PREFIX)) {
-			return getContextUrl(request) + auxRoot.substring(CONTEXT_PREFIX.length());
-		} else {
-			return auxRoot;
-		}
-	}
-
-	// --- HTML methods ----
-
-	/**
-	 * Prints a HTML header with styles.
-	 */
-	private void printHeader(PrintWriter pw, String title) {
-		pw.print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"");
-		pw.println("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
-		pw.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
-		pw.println("<head>");
-		pw.println("<title>" + title + "</title>");
-		pw.println("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />");
-		pw.println("<style type=\"text/css\">");
-		pw.println("body { font-family: arial,sans-serif; font-size: 10pt; }");
-		pw.println("div.box { background-color: #f6f1de; margin-top: 10px;"
-				+ " margin-bottom: 10px; margin-left: 0px; margin-right: 0px;"
-				+ " padding: 5px; border-style: solid; border-width: 1px; border-color: #888a85; }");
-		pw.println("</style>");
-		pw.println("</head>");
-		pw.println("<body>");
-	}
-
-	/**
-	 * Prints a HTML footer.
-	 */
-	private void printFooter(PrintWriter pw) {
-		pw.println("</body>");
-		pw.println("</html>");
-	}
-
-	/**
-	 * Prints a HTML error message.
-	 */
-	private void printError(HttpServletRequest req, HttpServletResponse resp, String message, Exception e)
-			throws ServletException, IOException {
-		resp.setContentType("text/html;charset=utf-8");
-		PrintWriter pw = resp.getWriter();
-
-		printHeader(pw, "Error");
-		pw.println("<div class=\"box\">");
-		pw.println("<h3>" + message + "</h3>");
-
-		if (e != null) {
-			pw.print("<pre>");
-			e.printStackTrace(pw);
-			pw.println("</pre>");
-		}
-
-		pw.println("</div>");
-		printFooter(pw);
-	}
-
-	/**
-	 * Prints an HTML input box.
-	 */
-	private void printInput(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-		resp.setContentType("text/html;charset=utf-8");
-		PrintWriter pw = resp.getWriter();
-
-		printHeader(pw, "OpenCMIS Browser");
-		pw.println("<img src=\"" + getAuxRoot(req, fAuxRoot) + "cmis.png\" " + "style=\"float: right;\" />");
-		pw.println("<h1 style=\"font-family: Georgia;\">OpenCMIS Browser</h1>");
-		pw.println("<div class=\"box\">");
-		pw.println("<form action=\"\" method=\"GET\">");
-		pw.println("CMIS AtomPub URL: ");
-		pw.println("<input name=\"url\" type=\"text\" size=\"100\" value=\"\"/>");
-		pw.println("<input type=\"submit\" value=\" GO \"/>");
-		pw.println("</form>");
-		pw.println("</div>");
-		printFooter(pw);
-	}
+    private static final String CONTEXT_PREFIX = "{ctx}";
+    private static final String PARAM_URL = "url";
+    private static final String INIT_PARAM_AUXROOT = "auxroot";
+    private static final String INIT_PARAM_ALLOW = "allow";
+    private static final String INIT_PARAM_STYLESHEET = "stylesheet:";
+
+    private static final int BUFFER_SIZE = 64 * 1024;
+
+    private String fAuxRoot = "";
+    private String fAllow = ".*";
+    private Map<String, Source> fStyleSheets;
+
+    /**
+     * Initializes the browser servlet.
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void init(ServletConfig config) throws ServletException {
+        fStyleSheets = new HashMap<String, Source>();
+
+        DocumentBuilder builder = null;
+        try {
+            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+            builderFactory.setNamespaceAware(true);
+            builder = builderFactory.newDocumentBuilder();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return;
+        }
+
+        Enumeration<String> initParams = config.getInitParameterNames();
+        while (initParams.hasMoreElements()) {
+            String param = initParams.nextElement();
+            if (param.startsWith(INIT_PARAM_STYLESHEET)) {
+                String contentType = param.substring(INIT_PARAM_STYLESHEET.length());
+                String stylesheetFileName = config.getInitParameter(param);
+
+                InputStream stream = config.getServletContext().getResourceAsStream(stylesheetFileName);
+                if (stream != null) {
+                    try {
+                        Document xslDoc = builder.parse(stream);
+                        addStylesheet(contentType, new DOMSource(xslDoc));
+
+                        log.info("Stylesheet: '" + contentType + "' -> '" + stylesheetFileName + "'");
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+
+        String initAuxRoot = config.getInitParameter(INIT_PARAM_AUXROOT);
+        if (initAuxRoot != null) {
+            fAuxRoot = initAuxRoot;
+            log.info("Auxiliary root: " + fAuxRoot);
+        }
+
+        String initAllow = config.getInitParameter(INIT_PARAM_ALLOW);
+        if (initAllow != null) {
+            fAllow = initAllow;
+            log.info("Allow pattern: " + fAllow);
+        }
+    }
+
+    /**
+     * Handles GET requests.
+     */
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        if (req.getParameter(PARAM_URL) == null) {
+            printInput(req, resp);
+            return;
+        }
+
+        doBrowse(req, resp);
+    }
+
+    /**
+     * Main method of the browser.
+     */
+    protected void doBrowse(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        String browseUrl = req.getParameter(PARAM_URL);
+
+        // check URL
+        if (!browseUrl.matches(fAllow)) {
+            printError(req, resp, "Prohibited URL!", null);
+            return;
+        }
+
+        // re-encode parameters
+        int qm = browseUrl.indexOf('?');
+        if ((qm > -1) && (browseUrl.length() > qm + 1)) {
+            StringBuilder urlSb = new StringBuilder(browseUrl.substring(0, qm + 1));
+            StringBuilder paramSb = new StringBuilder();
+
+            for (int i = qm + 1; i < browseUrl.length(); i++) {
+                char c = browseUrl.charAt(i);
+                if ((c == '=') || (c == '&')) {
+                    urlSb.append(URLEncoder.encode(paramSb.toString(), "UTF-8"));
+                    urlSb.append(c);
+                    paramSb = new StringBuilder();
+                } else {
+                    paramSb.append(c);
+                }
+            }
+
+            if (paramSb.length() > 0) {
+                urlSb.append(URLEncoder.encode(paramSb.toString(), "UTF-8"));
+            }
+
+            browseUrl = urlSb.toString();
+        }
+
+        try {
+            // get content
+            URL url = new URL(browseUrl);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setDoInput(true);
+            conn.setDoOutput(false);
+            conn.setRequestMethod("GET");
+            String authHeader = req.getHeader("Authorization");
+            if (authHeader != null) {
+                conn.setRequestProperty("Authorization", authHeader);
+            }
+            conn.connect();
+
+            // ask for login
+            if (conn.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
+                resp.setHeader("WWW-Authenticate", conn.getHeaderField("WWW-Authenticate"));
+                resp.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authorization Required");
+                return;
+            }
+
+            // debug messages
+            if (log.isDebugEnabled()) {
+                log.debug("'" + browseUrl + "' -> '" + conn.getContentType() + "'");
+            }
+
+            // find stylesheet
+            Source stylesheet = getStylesheet(conn.getContentType());
+
+            OutputStream out = null;
+            InputStream in = new BufferedInputStream(conn.getInputStream(), BUFFER_SIZE);
+
+            if (stylesheet == null) {
+                // no stylesheet found -> conduct content
+                resp.setContentType(conn.getContentType());
+                out = new BufferedOutputStream(resp.getOutputStream(), BUFFER_SIZE);
+
+                byte[] buffer = new byte[BUFFER_SIZE];
+                int b;
+                while ((b = in.read(buffer)) > -1) {
+                    out.write(buffer, 0, b);
+                }
+            } else {
+                // apply stylesheet
+                TransformerFactory f = TransformerFactory.newInstance();
+                Transformer t = f.newTransformer(stylesheet);
+                t.setParameter("browseUrl", getServletUrl(req) + "?url=");
+                t.setParameter("auxRoot", getAuxRoot(req, fAuxRoot));
+
+                resp.setContentType("text/html");
+                out = new BufferedOutputStream(resp.getOutputStream(), BUFFER_SIZE);
+
+                Source s = new StreamSource(in);
+                Result r = new StreamResult(out);
+                t.transform(s, r);
+            }
+
+            try {
+                out.flush();
+                out.close();
+            } catch (Exception e) {
+            }
+
+            try {
+                in.close();
+            } catch (Exception e) {
+            }
+        } catch (Exception e) {
+            printError(req, resp, e.getMessage(), e);
+            return;
+        }
+    }
+
+    // ---- utilities ----
+
+    /**
+     * Assigns a stylesheet to a content type.
+     */
+    private void addStylesheet(String contentType, Source source) {
+        if ((contentType == null) || (source == null)) {
+            return;
+        }
+
+        fStyleSheets.put(contentType.trim().toLowerCase(), source);
+    }
+
+    /**
+     * Returns the stylesheet for the given content type or <code>null</code> if
+     * no stylesheet is assigned to content type.
+     */
+    private Source getStylesheet(String contentType) {
+        if (contentType == null) {
+            return null;
+        }
+
+        String[] ctp = contentType.trim().toLowerCase().split(";");
+        Source source = null;
+
+        StringBuilder match = new StringBuilder();
+        int i = 0;
+        while (source == null && i < ctp.length) {
+            if (i > 0) {
+                match.append(";");
+            }
+            match.append(ctp[i]);
+            source = fStyleSheets.get(match.toString());
+            i++;
+        }
+
+        return source;
+    }
+
+    /**
+     * Returns the context URL of this servlet.
+     */
+    private String getContextUrl(HttpServletRequest request) {
+        String scheme = request.getScheme();
+        int port = request.getServerPort();
+
+        if ("http".equals(scheme) && (port == 80)) {
+            port = -1;
+        }
+        if ("https".equals(scheme) && (port == 443)) {
+            port = -1;
+        }
+
+        return scheme + "://" + request.getServerName() + (port > 0 ? ":" + port : "") + request.getContextPath();
+    }
+
+    /**
+     * Returns the URL of this servlet.
+     */
+    private String getServletUrl(HttpServletRequest request) {
+        return getContextUrl(request) + request.getServletPath();
+    }
+
+    /**
+     * Returns the root URL of auxiliary files.
+     */
+    private String getAuxRoot(HttpServletRequest request, String auxRoot) {
+        if (auxRoot == null) {
+            return getContextUrl(request);
+        } else if (auxRoot.startsWith(CONTEXT_PREFIX)) {
+            return getContextUrl(request) + auxRoot.substring(CONTEXT_PREFIX.length());
+        } else {
+            return auxRoot;
+        }
+    }
+
+    // --- HTML methods ----
+
+    /**
+     * Prints a HTML header with styles.
+     */
+    private void printHeader(PrintWriter pw, String title) {
+        pw.print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"");
+        pw.println("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
+        pw.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
+        pw.println("<head>");
+        pw.println("<title>" + title + "</title>");
+        pw.println("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />");
+        pw.println("<style type=\"text/css\">");
+        pw.println("body { font-family: arial,sans-serif; font-size: 10pt; }");
+        pw.println("div.box { background-color: #f6f1de; margin-top: 10px;"
+                + " margin-bottom: 10px; margin-left: 0px; margin-right: 0px;"
+                + " padding: 5px; border-style: solid; border-width: 1px; border-color: #888a85; }");
+        pw.println("</style>");
+        pw.println("</head>");
+        pw.println("<body>");
+    }
+
+    /**
+     * Prints a HTML footer.
+     */
+    private void printFooter(PrintWriter pw) {
+        pw.println("</body>");
+        pw.println("</html>");
+    }
+
+    /**
+     * Prints a HTML error message.
+     */
+    private void printError(HttpServletRequest req, HttpServletResponse resp, String message, Exception e)
+            throws ServletException, IOException {
+        resp.setContentType("text/html;charset=utf-8");
+        PrintWriter pw = resp.getWriter();
+
+        printHeader(pw, "Error");
+        pw.println("<div class=\"box\">");
+        pw.println("<h3>" + message + "</h3>");
+
+        if (e != null) {
+            pw.print("<pre>");
+            e.printStackTrace(pw);
+            pw.println("</pre>");
+        }
+
+        pw.println("</div>");
+        printFooter(pw);
+    }
+
+    /**
+     * Prints an HTML input box.
+     */
+    private void printInput(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        resp.setContentType("text/html;charset=utf-8");
+        PrintWriter pw = resp.getWriter();
+
+        printHeader(pw, "OpenCMIS Browser");
+        pw.println("<img src=\"" + getAuxRoot(req, fAuxRoot) + "cmis.png\" " + "style=\"float: right;\" />");
+        pw.println("<h1 style=\"font-family: Georgia;\">OpenCMIS Browser</h1>");
+        pw.println("<div class=\"box\">");
+        pw.println("<form action=\"\" method=\"GET\">");
+        pw.println("CMIS AtomPub URL: ");
+        pw.println("<input name=\"url\" type=\"text\" size=\"100\" value=\"\"/>");
+        pw.println("<input type=\"submit\" value=\" GO \"/>");
+        pw.println("</form>");
+        pw.println("</div>");
+        printFooter(pw);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java Thu Apr 22 16:34:53 2010
@@ -36,115 +36,115 @@ import org.apache.chemistry.opencmis.com
  */
 public class SessionFactory {
 
-	private static final String HOST = "localhost";
-	private static final int PORT = 19080;
+    private static final String HOST = "localhost";
+    private static final int PORT = 19080;
 
-	private static final String REPOSITORY_ID = "test";
-	private static final String USER = "test";
-	private static final String PASSWORD = "test";
-
-	private static final String ATOMPUB_PATH = "/opencmis/atom";
-	private static final String WEBSERVICES_PATH = "/opencmis/services/";
-
-	/**
-	 * Returns the repository id of the test repository.
-	 */
-	public static String getRepositoryId() {
-		return REPOSITORY_ID;
-	}
-
-	/**
-	 * Returns the user that is logged in.
-	 */
-	public static String getUsername() {
-		return USER;
-	}
-
-	/**
-	 * Creates a new Session object that uses the AtomPub binding.
-	 */
-	public static Session createAtomPubSession() {
-		String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
-
-		Map<String, String> parameters = new HashMap<String, String>();
-
-		parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
-
-		parameters.put(SessionParameter.ATOMPUB_URL, url);
-		parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
-
-		parameters.put(SessionParameter.USER, USER);
-		parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
-		return SessionFactoryImpl.newInstance().createSession(parameters);
-	}
-
-	/**
-	 * Creates a new Session object that uses the Web Services binding.
-	 */
-	public static Session createWebServicesSession() {
-		String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
-
-		Map<String, String> parameters = new HashMap<String, String>();
-
-		parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
-
-		parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
-
-		parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
-		parameters.put(SessionParameter.USER, USER);
-		parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
-		return SessionFactoryImpl.newInstance().createSession(parameters);
-	}
-
-	/**
-	 * Creates a new CmisProvider object that uses the AtomPub binding. For
-	 * low-level tests only!
-	 */
-	public static CmisBinding createAtomPubBinding() {
-		String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
-
-		Map<String, String> parameters = new HashMap<String, String>();
-
-		parameters.put(SessionParameter.USER, USER);
-		parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
-		parameters.put(SessionParameter.ATOMPUB_URL, url);
-
-		return CmisBindingFactory.newInstance().createCmisAtomPubBinding(parameters);
-	}
-
-	/**
-	 * Creates a new CmisProvider object that uses the Web Services binding. For
-	 * low-level tests only!
-	 */
-	public static CmisBinding createWebServicesBinding() {
-		String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
-
-		Map<String, String> parameters = new HashMap<String, String>();
-
-		parameters.put(SessionParameter.USER, USER);
-		parameters.put(SessionParameter.PASSWORD, PASSWORD);
-
-		parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
-		parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+    private static final String REPOSITORY_ID = "test";
+    private static final String USER = "test";
+    private static final String PASSWORD = "test";
+
+    private static final String ATOMPUB_PATH = "/opencmis/atom";
+    private static final String WEBSERVICES_PATH = "/opencmis/services/";
+
+    /**
+     * Returns the repository id of the test repository.
+     */
+    public static String getRepositoryId() {
+        return REPOSITORY_ID;
+    }
+
+    /**
+     * Returns the user that is logged in.
+     */
+    public static String getUsername() {
+        return USER;
+    }
+
+    /**
+     * Creates a new Session object that uses the AtomPub binding.
+     */
+    public static Session createAtomPubSession() {
+        String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
+
+        Map<String, String> parameters = new HashMap<String, String>();
+
+        parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+
+        parameters.put(SessionParameter.ATOMPUB_URL, url);
+        parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+
+        parameters.put(SessionParameter.USER, USER);
+        parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+        return SessionFactoryImpl.newInstance().createSession(parameters);
+    }
+
+    /**
+     * Creates a new Session object that uses the Web Services binding.
+     */
+    public static Session createWebServicesSession() {
+        String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+        Map<String, String> parameters = new HashMap<String, String>();
+
+        parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+
+        parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+
+        parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+        parameters.put(SessionParameter.USER, USER);
+        parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+        return SessionFactoryImpl.newInstance().createSession(parameters);
+    }
+
+    /**
+     * Creates a new CmisProvider object that uses the AtomPub binding. For
+     * low-level tests only!
+     */
+    public static CmisBinding createAtomPubBinding() {
+        String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
+
+        Map<String, String> parameters = new HashMap<String, String>();
+
+        parameters.put(SessionParameter.USER, USER);
+        parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+        parameters.put(SessionParameter.ATOMPUB_URL, url);
+
+        return CmisBindingFactory.newInstance().createCmisAtomPubBinding(parameters);
+    }
+
+    /**
+     * Creates a new CmisProvider object that uses the Web Services binding. For
+     * low-level tests only!
+     */
+    public static CmisBinding createWebServicesBinding() {
+        String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+        Map<String, String> parameters = new HashMap<String, String>();
+
+        parameters.put(SessionParameter.USER, USER);
+        parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+        parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
 
-		return CmisBindingFactory.newInstance().createCmisWebServicesBinding(parameters);
-	}
+        return CmisBindingFactory.newInstance().createCmisWebServicesBinding(parameters);
+    }
 }
\ No newline at end of file

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractBindingIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractBindingIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractBindingIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractBindingIT.java Thu Apr 22 16:34:53 2010
@@ -41,97 +41,97 @@ import org.junit.BeforeClass;
  * 
  */
 public abstract class AbstractBindingIT {
-	public static String FOLDER_TYPE = "cmis:folder";
-	public static String DOCUMENT_TYPE = "cmis:document";
+    public static String FOLDER_TYPE = "cmis:folder";
+    public static String DOCUMENT_TYPE = "cmis:document";
 
-	private static CmisBinding binding;
-	private static String fRepositoryId;
-	private static String fTestFolderId;
-
-	/**
-	 * Returns the id of test folder. Tests should only use this folder.
-	 */
-	protected String getTestFolderId() {
-		return fTestFolderId;
-	}
-
-	/**
-	 * Returns the current binding object.
-	 */
-	protected static CmisBinding getBinding() {
-		return binding;
-	}
-
-	/**
-	 * Returns a new binding object.
-	 */
-	protected abstract CmisBinding createBinding();
-
-	/**
-	 * Returns the repository id of the test repository.
-	 */
-	protected abstract String getRepositoryId();
-
-	@BeforeClass
-	public static void setUpClass() {
-		binding = null;
-	}
-
-	@Before
-	public void setUpTest() {
-		// only the first test creates the test environment
-		if (binding == null) {
-			System.out.println("Creating provider...");
-
-			binding = createBinding();
-			fRepositoryId = getRepositoryId();
-			createTestFolder();
-		}
-	}
-
-	@AfterClass
-	public static void tearDownClass() {
-		deleteTestFolder();
-		binding = null;
-	}
-
-	/**
-	 * Creates a folder that will be used by all read-write tests.
-	 */
-	private void createTestFolder() {
-		System.out.println("Creating test folder...");
-
-		// get root folder id
-		RepositoryInfo ri = getBinding().getRepositoryService().getRepositoryInfo(fRepositoryId, null);
-		assertNotNull(ri);
-		assertNotNull(ri.getRootFolderId());
-
-		String rootFolderId = ri.getRootFolderId();
-
-		// set up properties
-		List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
-		propertyList.add(getBinding().getObjectFactory().createPropertyStringData(PropertyIds.NAME,
-				"provider-tests-" + System.currentTimeMillis()));
-		propertyList.add(getBinding().getObjectFactory().createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, FOLDER_TYPE));
-
-		Properties properties = getBinding().getObjectFactory().createPropertiesData(propertyList);
-
-		// create the folder
-		fTestFolderId = getBinding().getObjectService().createFolder(fRepositoryId, properties, rootFolderId, null,
-				null, null, null);
-	}
-
-	/**
-	 * Deletes the test folder.
-	 */
-	private static void deleteTestFolder() {
-		if (fTestFolderId == null) {
-			return;
-		}
-
-		System.out.println("Deleting test folder...");
-
-		// delete the whole tree
-		getBinding().getObjectService().deleteTree(fRepositoryId, fTestFolderId, true, UnfileObject.DELETE, true, null);
-	}
+    private static CmisBinding binding;
+    private static String fRepositoryId;
+    private static String fTestFolderId;
+
+    /**
+     * Returns the id of test folder. Tests should only use this folder.
+     */
+    protected String getTestFolderId() {
+        return fTestFolderId;
+    }
+
+    /**
+     * Returns the current binding object.
+     */
+    protected static CmisBinding getBinding() {
+        return binding;
+    }
+
+    /**
+     * Returns a new binding object.
+     */
+    protected abstract CmisBinding createBinding();
+
+    /**
+     * Returns the repository id of the test repository.
+     */
+    protected abstract String getRepositoryId();
+
+    @BeforeClass
+    public static void setUpClass() {
+        binding = null;
+    }
+
+    @Before
+    public void setUpTest() {
+        // only the first test creates the test environment
+        if (binding == null) {
+            System.out.println("Creating provider...");
+
+            binding = createBinding();
+            fRepositoryId = getRepositoryId();
+            createTestFolder();
+        }
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        deleteTestFolder();
+        binding = null;
+    }
+
+    /**
+     * Creates a folder that will be used by all read-write tests.
+     */
+    private void createTestFolder() {
+        System.out.println("Creating test folder...");
+
+        // get root folder id
+        RepositoryInfo ri = getBinding().getRepositoryService().getRepositoryInfo(fRepositoryId, null);
+        assertNotNull(ri);
+        assertNotNull(ri.getRootFolderId());
+
+        String rootFolderId = ri.getRootFolderId();
+
+        // set up properties
+        List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
+        propertyList.add(getBinding().getObjectFactory().createPropertyStringData(PropertyIds.NAME,
+                "provider-tests-" + System.currentTimeMillis()));
+        propertyList.add(getBinding().getObjectFactory().createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, FOLDER_TYPE));
+
+        Properties properties = getBinding().getObjectFactory().createPropertiesData(propertyList);
+
+        // create the folder
+        fTestFolderId = getBinding().getObjectService().createFolder(fRepositoryId, properties, rootFolderId, null,
+                null, null, null);
+    }
+
+    /**
+     * Deletes the test folder.
+     */
+    private static void deleteTestFolder() {
+        if (fTestFolderId == null) {
+            return;
+        }
+
+        System.out.println("Deleting test folder...");
+
+        // delete the whole tree
+        getBinding().getObjectService().deleteTree(fRepositoryId, fTestFolderId, true, UnfileObject.DELETE, true, null);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractSimpleBindingIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractSimpleBindingIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractSimpleBindingIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AbstractSimpleBindingIT.java Thu Apr 22 16:34:53 2010
@@ -46,45 +46,45 @@ import org.junit.Test;
  */
 public abstract class AbstractSimpleBindingIT extends AbstractBindingIT {
 
-	@Test
-	public void testRepositoryInfo() {
-		RepositoryInfo ri = getBinding().getRepositoryService().getRepositoryInfo(getRepositoryId(), null);
-		assertNotNull(ri);
-
-		assertEquals(getRepositoryId(), ri.getId());
-		assertNotNull(ri.getProductName());
-		assertNotNull(ri.getRootFolderId());
-		assertNotNull(ri.getCapabilities());
-	}
-
-	@Test
-	public void testCreateDocument() {
-		// set up properties
-		List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
-		propertyList.add(getBinding().getObjectFactory().createPropertyStringData(PropertyIds.NAME, "testdoc.txt"));
-		propertyList.add(getBinding().getObjectFactory()
-				.createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, DOCUMENT_TYPE));
-
-		Properties properties = getBinding().getObjectFactory().createPropertiesData(propertyList);
-
-		// set up content
-		byte[] content = "This is a test file!".getBytes();
-
-		ContentStream contentStream = getBinding().getObjectFactory().createContentStream("test",
-				BigInteger.valueOf(content.length), "text/plain", new ByteArrayInputStream(content));
-
-		// create document
-		String docId = getBinding().getObjectService().createDocument(getRepositoryId(), properties, getTestFolderId(),
-				contentStream, VersioningState.NONE, null, null, null, null);
-		assertNotNull(docId);
-
-		// get the document
-		ObjectData object = getBinding().getObjectService().getObject(getRepositoryId(), docId, null, false,
-				IncludeRelationships.NONE, null, false, false, null);
-		assertNotNull(object);
-		assertEquals(docId, object.getId());
-
-		// delete the document
-		getBinding().getObjectService().deleteObject(getRepositoryId(), docId, true, null);
-	}
+    @Test
+    public void testRepositoryInfo() {
+        RepositoryInfo ri = getBinding().getRepositoryService().getRepositoryInfo(getRepositoryId(), null);
+        assertNotNull(ri);
+
+        assertEquals(getRepositoryId(), ri.getId());
+        assertNotNull(ri.getProductName());
+        assertNotNull(ri.getRootFolderId());
+        assertNotNull(ri.getCapabilities());
+    }
+
+    @Test
+    public void testCreateDocument() {
+        // set up properties
+        List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
+        propertyList.add(getBinding().getObjectFactory().createPropertyStringData(PropertyIds.NAME, "testdoc.txt"));
+        propertyList.add(getBinding().getObjectFactory()
+                .createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, DOCUMENT_TYPE));
+
+        Properties properties = getBinding().getObjectFactory().createPropertiesData(propertyList);
+
+        // set up content
+        byte[] content = "This is a test file!".getBytes();
+
+        ContentStream contentStream = getBinding().getObjectFactory().createContentStream("test",
+                BigInteger.valueOf(content.length), "text/plain", new ByteArrayInputStream(content));
+
+        // create document
+        String docId = getBinding().getObjectService().createDocument(getRepositoryId(), properties, getTestFolderId(),
+                contentStream, VersioningState.NONE, null, null, null, null);
+        assertNotNull(docId);
+
+        // get the document
+        ObjectData object = getBinding().getObjectService().getObject(getRepositoryId(), docId, null, false,
+                IncludeRelationships.NONE, null, false, false, null);
+        assertNotNull(object);
+        assertEquals(docId, object.getId());
+
+        // delete the document
+        getBinding().getObjectService().deleteObject(getRepositoryId(), docId, true, null);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AtomPubSimpleBindingIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AtomPubSimpleBindingIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AtomPubSimpleBindingIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/AtomPubSimpleBindingIT.java Thu Apr 22 16:34:53 2010
@@ -29,14 +29,14 @@ import org.apache.chemistry.opencmis.fit
  */
 public class AtomPubSimpleBindingIT extends AbstractSimpleBindingIT {
 
-	@Override
-	protected CmisBinding createBinding() {
-		return SessionFactory.createAtomPubBinding();
-	}
+    @Override
+    protected CmisBinding createBinding() {
+        return SessionFactory.createAtomPubBinding();
+    }
 
-	@Override
-	protected String getRepositoryId() {
-		return SessionFactory.getRepositoryId();
-	}
+    @Override
+    protected String getRepositoryId() {
+        return SessionFactory.getRepositoryId();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/WebServicesSimpleBindingIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/WebServicesSimpleBindingIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/WebServicesSimpleBindingIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/WebServicesSimpleBindingIT.java Thu Apr 22 16:34:53 2010
@@ -29,14 +29,14 @@ import org.apache.chemistry.opencmis.fit
  */
 public class WebServicesSimpleBindingIT extends AbstractSimpleBindingIT {
 
-	@Override
-	protected CmisBinding createBinding() {
-		return SessionFactory.createWebServicesBinding();
-	}
+    @Override
+    protected CmisBinding createBinding() {
+        return SessionFactory.createWebServicesBinding();
+    }
 
-	@Override
-	protected String getRepositoryId() {
-		return SessionFactory.getRepositoryId();
-	}
+    @Override
+    protected String getRepositoryId() {
+        return SessionFactory.getRepositoryId();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/AbstractSessionTest.java Thu Apr 22 16:34:53 2010
@@ -39,54 +39,54 @@ import org.junit.runners.model.Framework
  */
 public abstract class AbstractSessionTest {
 
-	protected Log log = LogFactory.getLog(this.getClass());
+    protected Log log = LogFactory.getLog(this.getClass());
 
-	/**
-	 * trace each junit error
-	 */
-	@Rule
-	public MethodRule watch = new TestWatchman() {
-		@Override
-		public void failed(Throwable e, FrameworkMethod method) {
-			super.failed(e, method);
-			AbstractSessionTest.this.log.error(method.getName(), e);
-		}
-	};
-
-	@BeforeClass
-	public static void classSetup() {
-		AbstractSessionTest.initializeLogging();
-		Fixture.logHeader();
-	}
-
-	/**
-	 * Initialize logging support.
-	 */
-	private static void initializeLogging() {
-		Properties p = new Properties();
-		try {
-			p.load(AbstractSessionTest.class.getResourceAsStream("/log4j.properties"));
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-		PropertyConfigurator.configure(p);
-	}
-
-	/**
-	 * test session
-	 */
-	protected Session session = null;
-
-	@Before
-	public void setUp() throws Exception {
-		SessionFactory factory = Fixture.getSessionFactory();
-		this.session = factory.createSession(Fixture.getParamter());
-		Fixture.setUpTestData(this.session);
-	}
-
-	@After
-	public void tearDown() throws Exception {
-		Fixture.teardownTestData(this.session);
-	}
+    /**
+     * trace each junit error
+     */
+    @Rule
+    public MethodRule watch = new TestWatchman() {
+        @Override
+        public void failed(Throwable e, FrameworkMethod method) {
+            super.failed(e, method);
+            AbstractSessionTest.this.log.error(method.getName(), e);
+        }
+    };
+
+    @BeforeClass
+    public static void classSetup() {
+        AbstractSessionTest.initializeLogging();
+        Fixture.logHeader();
+    }
+
+    /**
+     * Initialize logging support.
+     */
+    private static void initializeLogging() {
+        Properties p = new Properties();
+        try {
+            p.load(AbstractSessionTest.class.getResourceAsStream("/log4j.properties"));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        PropertyConfigurator.configure(p);
+    }
+
+    /**
+     * test session
+     */
+    protected Session session = null;
+
+    @Before
+    public void setUp() throws Exception {
+        SessionFactory factory = Fixture.getSessionFactory();
+        this.session = factory.createSession(Fixture.getParamter());
+        Fixture.setUpTestData(this.session);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        Fixture.teardownTestData(this.session);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/Fixture.java Thu Apr 22 16:34:53 2010
@@ -43,159 +43,159 @@ import org.apache.commons.logging.LogFac
  */
 public class Fixture {
 
-	private static String CONNECTION_PATH = Fixture.CONNECTION_ATOM_PATH;
-	private static final String CONNECTION_ATOM_PATH = "/inmemory.atom.properties";
-	private static final String CONNECTION_WS_PATH = "/inmemory.ws.properties";
-
-	private static Log log = LogFactory.getLog(Fixture.class);
-
-	/*
-	 * general
-	 */
-	public static String TEST_ROOT_FOLDER_NAME = "fit_" + UUID.randomUUID().toString();
-
-	/*
-	 * test data setup
-	 */
-	private static FixtureSetup testData = new FixtureSetup();
-
-	/**
-	 * @return session parameter
-	 */
-	public static Map<String, String> getParamter() {
-		return parameter;
-	}
-
-	/**
-	 * Overwriting default session parameter.
-	 * 
-	 * @param paramter
-	 */
-	public static void setParamter(Map<String, String> paramter) {
-		FixtureData.changeValues(paramter);
-		Fixture.parameter = paramter;
-	}
-
-	/**
-	 * session parameter.
-	 */
-	private static Map<String, String> parameter = null;
-
-	/**
-	 * Overwriting default session factory.
-	 * 
-	 * @param factory
-	 */
-	public static void setSessionFactory(SessionFactory factory) {
-		Fixture.factory = factory;
-	}
-
-	/**
-	 * @return factory
-	 */
-	public static SessionFactory getSessionFactory() {
-		return Fixture.factory;
-	}
-
-	/**
-	 * factory
-	 */
-	private static SessionFactory factory = null;
-
-	static {
-		// Mock as default
-		Fixture.init();
-	}
-
-	public static void init() {
-		/* get optional path from system properties */
-		String pathname = System.getProperty(FixtureSessionParameter.CONFIG_PATH);
-		pathname = (pathname != null) ? pathname.trim() : null;
-		Properties properties = null;
-		Map<String, String> sessionParameter = null;
-		SessionFactory factory = null;
-		String factoryClassName = null;
-		try {
-			if (pathname != null && !"".equalsIgnoreCase(pathname)) {
-				// read from file
-				properties = new Properties();
-				FileInputStream in = new FileInputStream(new File(pathname));
-				properties.load(in);
-			} else {
-				// get default settings
-				InputStream in = Fixture.class.getResourceAsStream(Fixture.CONNECTION_PATH);
-				properties = new Properties();
-				properties.load(in);
-			}
-
-			/* convert to map, filter empty values */
-			sessionParameter = new Hashtable<String, String>();
-			for (Entry<Object, Object> se : properties.entrySet()) {
-				String key = (String) se.getKey();
-				String value = ((String) se.getValue()).trim();
-				if (value != null && !"".equalsIgnoreCase(value)) {
-					sessionParameter.put(key, value);
-				}
-			}
-			Fixture.setParamter(sessionParameter);
-
-			/* load factory class */
-			factoryClassName = sessionParameter.get(FixtureSessionParameter.SESSION_FACTORY);
-			if (factoryClassName != null && !"".equalsIgnoreCase(factoryClassName)) {
-				Class<?> clazz = Class.forName(factoryClassName);
-				factory = (SessionFactory) clazz.newInstance();
-			} else {
-				/* default */
-				factory = SessionFactoryImpl.newInstance();
-			}
-			Fixture.setSessionFactory(factory);
-		} catch (IOException e) {
-			Fixture.log.error(pathname, e);
-			throw new CmisRuntimeException(pathname, e);
-		} catch (Exception e) {
-			Fixture.log.error(factoryClassName, e);
-			throw new CmisRuntimeException(factoryClassName, e);
-		}
-	}
-
-	public static void setUpTestData(Session session) {
-		Fixture.testData.setup();
-	}
-
-	public static void teardownTestData(Session session) {
-		Fixture.testData.teardown();
-	}
-
-	private static boolean isLogged = false;
-
-	public static void logHeader() {
-		if (!Fixture.isLogged) {
-			/*
-			 * log header only once
-			 */
-			Fixture.log.info("---------------------------------------------------------------");
-			Fixture.log.info("--- OpenCMIS FIT Test Suite (1) --------------------------------");
-			Fixture.log.info("---------------------------------------------------------------");
-			Fixture.log.info("config path (prop): " + System.getProperty(FixtureSessionParameter.CONFIG_PATH));
-			Fixture.log.info("session factory:    " + Fixture.getSessionFactory().getClass());
-			Fixture.log.info("session parameter:  " + Fixture.getParamter());
-
-			Fixture.log.info("---------------------------------------------------------------");
-
-			Fixture.isLogged = true;
-		}
-	}
-
-	public static void enableAtomPub() {
-		Fixture.CONNECTION_PATH = Fixture.CONNECTION_ATOM_PATH;
-	}
-
-	public static void enableWebServices() {
-		Fixture.CONNECTION_PATH = Fixture.CONNECTION_WS_PATH;
-	}
-
-	public static String getTestRootId() {
-		return Fixture.testData.getTestRootId();
-	}
+    private static String CONNECTION_PATH = Fixture.CONNECTION_ATOM_PATH;
+    private static final String CONNECTION_ATOM_PATH = "/inmemory.atom.properties";
+    private static final String CONNECTION_WS_PATH = "/inmemory.ws.properties";
+
+    private static Log log = LogFactory.getLog(Fixture.class);
+
+    /*
+     * general
+     */
+    public static String TEST_ROOT_FOLDER_NAME = "fit_" + UUID.randomUUID().toString();
+
+    /*
+     * test data setup
+     */
+    private static FixtureSetup testData = new FixtureSetup();
+
+    /**
+     * @return session parameter
+     */
+    public static Map<String, String> getParamter() {
+        return parameter;
+    }
+
+    /**
+     * Overwriting default session parameter.
+     * 
+     * @param paramter
+     */
+    public static void setParamter(Map<String, String> paramter) {
+        FixtureData.changeValues(paramter);
+        Fixture.parameter = paramter;
+    }
+
+    /**
+     * session parameter.
+     */
+    private static Map<String, String> parameter = null;
+
+    /**
+     * Overwriting default session factory.
+     * 
+     * @param factory
+     */
+    public static void setSessionFactory(SessionFactory factory) {
+        Fixture.factory = factory;
+    }
+
+    /**
+     * @return factory
+     */
+    public static SessionFactory getSessionFactory() {
+        return Fixture.factory;
+    }
+
+    /**
+     * factory
+     */
+    private static SessionFactory factory = null;
+
+    static {
+        // Mock as default
+        Fixture.init();
+    }
+
+    public static void init() {
+        /* get optional path from system properties */
+        String pathname = System.getProperty(FixtureSessionParameter.CONFIG_PATH);
+        pathname = (pathname != null) ? pathname.trim() : null;
+        Properties properties = null;
+        Map<String, String> sessionParameter = null;
+        SessionFactory factory = null;
+        String factoryClassName = null;
+        try {
+            if (pathname != null && !"".equalsIgnoreCase(pathname)) {
+                // read from file
+                properties = new Properties();
+                FileInputStream in = new FileInputStream(new File(pathname));
+                properties.load(in);
+            } else {
+                // get default settings
+                InputStream in = Fixture.class.getResourceAsStream(Fixture.CONNECTION_PATH);
+                properties = new Properties();
+                properties.load(in);
+            }
+
+            /* convert to map, filter empty values */
+            sessionParameter = new Hashtable<String, String>();
+            for (Entry<Object, Object> se : properties.entrySet()) {
+                String key = (String) se.getKey();
+                String value = ((String) se.getValue()).trim();
+                if (value != null && !"".equalsIgnoreCase(value)) {
+                    sessionParameter.put(key, value);
+                }
+            }
+            Fixture.setParamter(sessionParameter);
+
+            /* load factory class */
+            factoryClassName = sessionParameter.get(FixtureSessionParameter.SESSION_FACTORY);
+            if (factoryClassName != null && !"".equalsIgnoreCase(factoryClassName)) {
+                Class<?> clazz = Class.forName(factoryClassName);
+                factory = (SessionFactory) clazz.newInstance();
+            } else {
+                /* default */
+                factory = SessionFactoryImpl.newInstance();
+            }
+            Fixture.setSessionFactory(factory);
+        } catch (IOException e) {
+            Fixture.log.error(pathname, e);
+            throw new CmisRuntimeException(pathname, e);
+        } catch (Exception e) {
+            Fixture.log.error(factoryClassName, e);
+            throw new CmisRuntimeException(factoryClassName, e);
+        }
+    }
+
+    public static void setUpTestData(Session session) {
+        Fixture.testData.setup();
+    }
+
+    public static void teardownTestData(Session session) {
+        Fixture.testData.teardown();
+    }
+
+    private static boolean isLogged = false;
+
+    public static void logHeader() {
+        if (!Fixture.isLogged) {
+            /*
+             * log header only once
+             */
+            Fixture.log.info("---------------------------------------------------------------");
+            Fixture.log.info("--- OpenCMIS FIT Test Suite (1) --------------------------------");
+            Fixture.log.info("---------------------------------------------------------------");
+            Fixture.log.info("config path (prop): " + System.getProperty(FixtureSessionParameter.CONFIG_PATH));
+            Fixture.log.info("session factory:    " + Fixture.getSessionFactory().getClass());
+            Fixture.log.info("session parameter:  " + Fixture.getParamter());
+
+            Fixture.log.info("---------------------------------------------------------------");
+
+            Fixture.isLogged = true;
+        }
+    }
+
+    public static void enableAtomPub() {
+        Fixture.CONNECTION_PATH = Fixture.CONNECTION_ATOM_PATH;
+    }
+
+    public static void enableWebServices() {
+        Fixture.CONNECTION_PATH = Fixture.CONNECTION_WS_PATH;
+    }
+
+    public static String getTestRootId() {
+        return Fixture.testData.getTestRootId();
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSessionParameter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSessionParameter.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSessionParameter.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSessionParameter.java Thu Apr 22 16:34:53 2010
@@ -20,16 +20,16 @@ package org.apache.chemistry.opencmis.fi
 
 public interface FixtureSessionParameter {
 
-	/*
-	 * session parameter
-	 */
+    /*
+     * session parameter
+     */
 
-	/**
-	 * CONFIG_PATH is referenced in pom.xml! If you change here then change pom.
-	 */
-	static final String CONFIG_PATH = "org.apache.chemistry.opencmis.fit.runtime.config.path";
+    /**
+     * CONFIG_PATH is referenced in pom.xml! If you change here then change pom.
+     */
+    static final String CONFIG_PATH = "org.apache.chemistry.opencmis.fit.runtime.config.path";
 
-	static final String SESSION_FACTORY = "org.apache.chemistry.opencmis.fit.runtime.session.factory";
-	static final String TEST_ROOT_FOLDER_ID = "org.apache.chemistry.opencmis.fit.runtime.root.folder.id";
+    static final String SESSION_FACTORY = "org.apache.chemistry.opencmis.fit.runtime.session.factory";
+    static final String TEST_ROOT_FOLDER_ID = "org.apache.chemistry.opencmis.fit.runtime.root.folder.id";
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/FixtureSetup.java Thu Apr 22 16:34:53 2010
@@ -34,71 +34,71 @@ import org.junit.Assert;
 
 public class FixtureSetup {
 
-	private CmisBinding binding = null;
-	private String rootFolderId = null; // root
-	private String testRootFolderId = null; // test root
-	private String repositoryId = null;
-
-	public void teardown() {
-		this.binding.getObjectService().deleteTree(this.repositoryId, this.testRootFolderId, true, UnfileObject.DELETE,
-				true, null);
-	}
-
-	public void setup() {
-		this.repositoryId = Fixture.getParamter().get(SessionParameter.REPOSITORY_ID);
-		Assert.assertNotNull(this.repositoryId);
-
-		this.binding = CmisBindingFactory.newInstance().createCmisBinding(Fixture.getParamter());
-		Assert.assertNotNull(this.binding);
-
-		// root folder
-		if (Fixture.getParamter().containsKey(FixtureSessionParameter.TEST_ROOT_FOLDER_ID)) {
-			// test root folder
-			this.rootFolderId = Fixture.getParamter().get(FixtureSessionParameter.TEST_ROOT_FOLDER_ID);
-			Assert.assertNotNull(this.rootFolderId);
-		} else {
-			RepositoryInfo rid = this.binding.getRepositoryService().getRepositoryInfo(this.repositoryId, null);
-			Assert.assertNotNull(rid);
-			this.rootFolderId = rid.getRootFolderId();
-			Assert.assertNotNull(this.rootFolderId);
-		}
-
-		// object types
-		String documentTypeId = FixtureData.DOCUMENT_TYPE_ID.value();
-		Assert.assertNotNull(documentTypeId);
-		String folderTypeId = FixtureData.FOLDER_TYPE_ID.value();
-		Assert.assertNotNull(folderTypeId);
-
-		// create test root folder
-		List<PropertyData<?>> propList = new ArrayList<PropertyData<?>>();
-		propList.add(this.binding.getObjectFactory().createPropertyStringData(PropertyIds.NAME,
-				Fixture.TEST_ROOT_FOLDER_NAME));
-		propList.add(this.binding.getObjectFactory().createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, folderTypeId));
-
-		Properties properties = this.binding.getObjectFactory().createPropertiesData(propList);
-
-		this.testRootFolderId = this.binding.getObjectService().createFolder(this.repositoryId, properties,
-				this.rootFolderId, null, null, null, null);
-		Assert.assertNotNull(this.testRootFolderId);
-
-		ObjectGenerator og = new ObjectGenerator(binding.getObjectFactory(), binding.getNavigationService(), binding
-				.getObjectService(), this.repositoryId);
-
-		og.setContentSizeInKB(10);
-		og.setDocumentTypeId(documentTypeId);
-		og.setFolderTypeId(folderTypeId);
-		og.setNumberOfDocumentsToCreatePerFolder(2);
-		og.setDocumentPropertiesToGenerate(new ArrayList<String>());
-		og.setFolderPropertiesToGenerate(new ArrayList<String>());
-
-		og.createFolderHierachy(2, 2, this.testRootFolderId);
-	}
-
-	public String getTestRootId() {
-		if (this.testRootFolderId == null) {
-			this.testRootFolderId = Fixture.TEST_ROOT_FOLDER_NAME;
-		}
-		return this.testRootFolderId;
-	}
+    private CmisBinding binding = null;
+    private String rootFolderId = null; // root
+    private String testRootFolderId = null; // test root
+    private String repositoryId = null;
+
+    public void teardown() {
+        this.binding.getObjectService().deleteTree(this.repositoryId, this.testRootFolderId, true, UnfileObject.DELETE,
+                true, null);
+    }
+
+    public void setup() {
+        this.repositoryId = Fixture.getParamter().get(SessionParameter.REPOSITORY_ID);
+        Assert.assertNotNull(this.repositoryId);
+
+        this.binding = CmisBindingFactory.newInstance().createCmisBinding(Fixture.getParamter());
+        Assert.assertNotNull(this.binding);
+
+        // root folder
+        if (Fixture.getParamter().containsKey(FixtureSessionParameter.TEST_ROOT_FOLDER_ID)) {
+            // test root folder
+            this.rootFolderId = Fixture.getParamter().get(FixtureSessionParameter.TEST_ROOT_FOLDER_ID);
+            Assert.assertNotNull(this.rootFolderId);
+        } else {
+            RepositoryInfo rid = this.binding.getRepositoryService().getRepositoryInfo(this.repositoryId, null);
+            Assert.assertNotNull(rid);
+            this.rootFolderId = rid.getRootFolderId();
+            Assert.assertNotNull(this.rootFolderId);
+        }
+
+        // object types
+        String documentTypeId = FixtureData.DOCUMENT_TYPE_ID.value();
+        Assert.assertNotNull(documentTypeId);
+        String folderTypeId = FixtureData.FOLDER_TYPE_ID.value();
+        Assert.assertNotNull(folderTypeId);
+
+        // create test root folder
+        List<PropertyData<?>> propList = new ArrayList<PropertyData<?>>();
+        propList.add(this.binding.getObjectFactory().createPropertyStringData(PropertyIds.NAME,
+                Fixture.TEST_ROOT_FOLDER_NAME));
+        propList.add(this.binding.getObjectFactory().createPropertyIdData(PropertyIds.OBJECT_TYPE_ID, folderTypeId));
+
+        Properties properties = this.binding.getObjectFactory().createPropertiesData(propList);
+
+        this.testRootFolderId = this.binding.getObjectService().createFolder(this.repositoryId, properties,
+                this.rootFolderId, null, null, null, null);
+        Assert.assertNotNull(this.testRootFolderId);
+
+        ObjectGenerator og = new ObjectGenerator(binding.getObjectFactory(), binding.getNavigationService(), binding
+                .getObjectService(), this.repositoryId);
+
+        og.setContentSizeInKB(10);
+        og.setDocumentTypeId(documentTypeId);
+        og.setFolderTypeId(folderTypeId);
+        og.setNumberOfDocumentsToCreatePerFolder(2);
+        og.setDocumentPropertiesToGenerate(new ArrayList<String>());
+        og.setFolderPropertiesToGenerate(new ArrayList<String>());
+
+        og.createFolderHierachy(2, 2, this.testRootFolderId);
+    }
+
+    public String getTestRootId() {
+        if (this.testRootFolderId == null) {
+            this.testRootFolderId = Fixture.TEST_ROOT_FOLDER_NAME;
+        }
+        return this.testRootFolderId;
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyAclCapabilityIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyAclCapabilityIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyAclCapabilityIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyAclCapabilityIT.java Thu Apr 22 16:34:53 2010
@@ -33,43 +33,43 @@ import org.junit.Test;
 
 public class ReadOnlyAclCapabilityIT extends AbstractSessionTest {
 
-	private AclCapabilities aclCapabilities = null;
+    private AclCapabilities aclCapabilities = null;
 
-	@Before
-	public void setup() throws Exception {
-		RepositoryInfo r = this.session.getRepositoryInfo();
-		// capabilities
-		RepositoryCapabilities repcap = r.getCapabilities();
-		CapabilityAcl capacl = repcap.getAclCapability();
-
-		if (capacl != CapabilityAcl.NONE) {
-			// acl capabilities
-			this.aclCapabilities = r.getAclCapabilities();
-		}
-
-		Assume.assumeNotNull(this.aclCapabilities);
-	}
-
-	@Test
-	public void repositoryCapabilitiesAclPropagation() {
-		AclPropagation aclprop = this.aclCapabilities.getAclPropagation();
-		switch (aclprop) {
-		case OBJECTONLY:
-			break;
-		case PROPAGATE:
-			break;
-		case REPOSITORYDETERMINED:
-			break;
-		default:
-			Assert.fail("enumeration not supported");
-		}
-	}
-
-	@Test
-	public void repositoryCapabilitiesAclPermissionMapping() {
-		PermissionMapping apm = this.aclCapabilities.getPermissionMapping()
-				.get(PermissionMapping.CAN_ADD_POLICY_OBJECT);
-		List<String> aclps = apm.getPermissions();
-		Assert.assertNotNull(aclps);
-	}
+    @Before
+    public void setup() throws Exception {
+        RepositoryInfo r = this.session.getRepositoryInfo();
+        // capabilities
+        RepositoryCapabilities repcap = r.getCapabilities();
+        CapabilityAcl capacl = repcap.getAclCapability();
+
+        if (capacl != CapabilityAcl.NONE) {
+            // acl capabilities
+            this.aclCapabilities = r.getAclCapabilities();
+        }
+
+        Assume.assumeNotNull(this.aclCapabilities);
+    }
+
+    @Test
+    public void repositoryCapabilitiesAclPropagation() {
+        AclPropagation aclprop = this.aclCapabilities.getAclPropagation();
+        switch (aclprop) {
+        case OBJECTONLY:
+            break;
+        case PROPAGATE:
+            break;
+        case REPOSITORYDETERMINED:
+            break;
+        default:
+            Assert.fail("enumeration not supported");
+        }
+    }
+
+    @Test
+    public void repositoryCapabilitiesAclPermissionMapping() {
+        PermissionMapping apm = this.aclCapabilities.getPermissionMapping()
+                .get(PermissionMapping.CAN_ADD_POLICY_OBJECT);
+        List<String> aclps = apm.getPermissions();
+        Assert.assertNotNull(aclps);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyContentStreamIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyContentStreamIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyContentStreamIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyContentStreamIT.java Thu Apr 22 16:34:53 2010
@@ -30,27 +30,27 @@ import org.junit.Test;
 
 public class ReadOnlyContentStreamIT extends AbstractSessionTest {
 
-	@Test
-	public void readContentStream() throws IOException {
-		String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME.toString();
-		Document document = (Document) this.session.getObjectByPath(path);
-		Assert.assertNotNull("document not found: " + path, document);
-
-		ContentStream s = document.getContentStream();
-
-		Assert.assertNotNull(s.getMimeType());
-		s.getLength();
-		s.getFileName();
-
-		InputStream is = s.getStream();
-		Assert.assertNotNull(is);
-
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		baos.write(is.read());
-		byte[] b = baos.toByteArray();
-
-		Assert.assertNotNull(b);
-		Assert.assertTrue(b.length > 0);
-	}
+    @Test
+    public void readContentStream() throws IOException {
+        String path = "/" + Fixture.TEST_ROOT_FOLDER_NAME + "/" + FixtureData.DOCUMENT1_NAME.toString();
+        Document document = (Document) this.session.getObjectByPath(path);
+        Assert.assertNotNull("document not found: " + path, document);
+
+        ContentStream s = document.getContentStream();
+
+        Assert.assertNotNull(s.getMimeType());
+        s.getLength();
+        s.getFileName();
+
+        InputStream is = s.getStream();
+        Assert.assertNotNull(is);
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        baos.write(is.read());
+        byte[] b = baos.toByteArray();
+
+        Assert.assertNotNull(b);
+        Assert.assertTrue(b.length > 0);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyCreateSessionIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyCreateSessionIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyCreateSessionIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyCreateSessionIT.java Thu Apr 22 16:34:53 2010
@@ -36,47 +36,47 @@ import org.junit.Test;
  */
 public class ReadOnlyCreateSessionIT {
 
-	protected Log log = LogFactory.getLog(this.getClass());
+    protected Log log = LogFactory.getLog(this.getClass());
 
-	@Before
-	public void setup() {
-	}
+    @Before
+    public void setup() {
+    }
 
-	@Test
-	public void createDefaultSession() {
-		SessionFactory factory = Fixture.getSessionFactory();
+    @Test
+    public void createDefaultSession() {
+        SessionFactory factory = Fixture.getSessionFactory();
 
-		Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
-		parameter.remove(SessionParameter.SESSION_TYPE);
+        Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
+        parameter.remove(SessionParameter.SESSION_TYPE);
 
-		Session s = factory.createSession(parameter);
-		Assert.assertNotNull(s);
-	}
+        Session s = factory.createSession(parameter);
+        Assert.assertNotNull(s);
+    }
 
-	@Test
-	public void createPersistentSession() {
-		SessionFactory factory = Fixture.getSessionFactory();
+    @Test
+    public void createPersistentSession() {
+        SessionFactory factory = Fixture.getSessionFactory();
 
-		Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
-		parameter.put(SessionParameter.SESSION_TYPE, SessionType.PERSISTENT.value());
+        Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
+        parameter.put(SessionParameter.SESSION_TYPE, SessionType.PERSISTENT.value());
 
-		Session s = factory.createSession(parameter);
-		Assert.assertNotNull(s);
-	}
+        Session s = factory.createSession(parameter);
+        Assert.assertNotNull(s);
+    }
 
-	@Test
-	public void createTransientSession() {
-		SessionFactory factory = Fixture.getSessionFactory();
+    @Test
+    public void createTransientSession() {
+        SessionFactory factory = Fixture.getSessionFactory();
 
-		Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
-		parameter.put(SessionParameter.SESSION_TYPE, SessionType.TRANSIENT.value());
+        Hashtable<String, String> parameter = new Hashtable<String, String>(Fixture.getParamter());
+        parameter.put(SessionParameter.SESSION_TYPE, SessionType.TRANSIENT.value());
 
-		try {
-			@SuppressWarnings("unused")
-			Session s = factory.createSession(parameter);
-			Assert.fail("CmisNotSupportedException expected, because Transient Session is not supported yet.");
-		} catch (CmisNotSupportedException e) {
+        try {
+            @SuppressWarnings("unused")
+            Session s = factory.createSession(parameter);
+            Assert.fail("CmisNotSupportedException expected, because Transient Session is not supported yet.");
+        } catch (CmisNotSupportedException e) {
 
-		}
-	}
+        }
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyDiscoverIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyDiscoverIT.java?rev=936943&r1=936942&r2=936943&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyDiscoverIT.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/ReadOnlyDiscoverIT.java Thu Apr 22 16:34:53 2010
@@ -29,42 +29,39 @@ import org.junit.Test;
 
 public class ReadOnlyDiscoverIT extends AbstractSessionTest {
 
-	private static Log log = LogFactory.getLog(ReadOnlyDiscoverIT.class);
+    private static Log log = LogFactory.getLog(ReadOnlyDiscoverIT.class);
 
-	@Test
-	public void query() {
-		CapabilityQuery query = this.session.getRepositoryInfo()
-				.getCapabilities().getQueryCapability();
-
-		switch (query) {
-		case NONE:
-			ReadOnlyDiscoverIT.log.info("queries not supported");
-			break;
-		default:
-			PagingIterable<QueryResult> resultSet = this.session.query(
-					FixtureData.QUERY.toString(), false, 2);
-			Assert.assertNotNull(resultSet);
-			// Assert.assertFalse(resultSet.isEmpty());
-			for (QueryResult o : resultSet) {
-				Assert.assertNotNull(o);
-			}
-
-			break;
-		}
-
-	}
-
-	@Test
-	public void changes() {
-		CapabilityChanges changes = this.session.getRepositoryInfo()
-				.getCapabilities().getChangesCapability();
-
-		switch (changes) {
-		case NONE:
-			ReadOnlyDiscoverIT.log.info("changes not supported");
-			break;
-		default:
-			break;
-		}
-	}
+    @Test
+    public void query() {
+        CapabilityQuery query = this.session.getRepositoryInfo().getCapabilities().getQueryCapability();
+
+        switch (query) {
+        case NONE:
+            ReadOnlyDiscoverIT.log.info("queries not supported");
+            break;
+        default:
+            PagingIterable<QueryResult> resultSet = this.session.query(FixtureData.QUERY.toString(), false, 2);
+            Assert.assertNotNull(resultSet);
+            // Assert.assertFalse(resultSet.isEmpty());
+            for (QueryResult o : resultSet) {
+                Assert.assertNotNull(o);
+            }
+
+            break;
+        }
+
+    }
+
+    @Test
+    public void changes() {
+        CapabilityChanges changes = this.session.getRepositoryInfo().getCapabilities().getChangesCapability();
+
+        switch (changes) {
+        case NONE:
+            ReadOnlyDiscoverIT.log.info("changes not supported");
+            break;
+        default:
+            break;
+        }
+    }
 }



Mime
View raw message