Return-Path: X-Original-To: apmail-oodt-commits-archive@www.apache.org Delivered-To: apmail-oodt-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEDBFEC0E for ; Sun, 3 Feb 2013 18:06:48 +0000 (UTC) Received: (qmail 17758 invoked by uid 500); 3 Feb 2013 18:06:48 -0000 Delivered-To: apmail-oodt-commits-archive@oodt.apache.org Received: (qmail 17725 invoked by uid 500); 3 Feb 2013 18:06:48 -0000 Mailing-List: contact commits-help@oodt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oodt.apache.org Delivered-To: mailing list commits@oodt.apache.org Received: (qmail 17717 invoked by uid 99); 3 Feb 2013 18:06:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2013 18:06:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2013 18:06:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B11F023889ED; Sun, 3 Feb 2013 18:06:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1441940 - /oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java Date: Sun, 03 Feb 2013 18:06:25 -0000 To: commits@oodt.apache.org From: mattmann@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130203180625.B11F023889ED@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mattmann Date: Sun Feb 3 18:06:25 2013 New Revision: 1441940 URL: http://svn.apache.org/viewvc?rev=1441940&view=rev Log: - formatting Modified: oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java Modified: oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java URL: http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java?rev=1441940&r1=1441939&r2=1441940&view=diff ============================================================================== --- oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java (original) +++ oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/catalog/TestOrderedDataSourceCatalog.java Sun Feb 3 18:06:25 2013 @@ -1,4 +1,4 @@ -/* +/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -15,7 +15,6 @@ * limitations under the License. */ - package org.apache.oodt.cas.filemgr.catalog; import org.apache.oodt.cas.filemgr.structs.Product; @@ -25,87 +24,84 @@ import org.apache.oodt.cas.metadata.Meta * @author mattmann * @version $Revision$ * - *

- * Describe your class here - *

. + *

+ * Describe your class here + *

+ * . */ public class TestOrderedDataSourceCatalog extends TestDataSourceCatalog { - /** + /** * */ - public TestOrderedDataSourceCatalog() { - super(); - System.setProperty("org.apache.oodt.cas.filemgr.catalog.datasource.orderedValues", "true"); - setCatalog(getCatalog()); - - } - - protected Catalog getCatalog() { - try { - return new DataSourceCatalogFactory().createCatalog(); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.oodt.cas.filemgr.catalog.TestDataSourceCatalog#getSchemaPath() - */ - @Override - protected String getSchemaPath() { - return "./src/testdata/testcat.ordered.sql"; - } - - public void testOrdering(){ - Product testProduct = getTestProduct(); - Metadata testMet = getTestMetadata("test"); - - try { - myCat.addProduct(testProduct); - myCat.addMetadata(testMet, testProduct); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - } - - - - Product retProduct; - try { - Metadata retMet = myCat.getMetadata(testProduct); - assertNotNull(retMet); - assertNotNull(retMet.getAllMetadata("CAS.ProductName")); - assertEquals(3, retMet.getAllMetadata("CAS.ProductName").size()); - assertEquals("test", retMet.getAllMetadata("CAS.ProductName").get(0)); - assertEquals("test2", retMet.getAllMetadata("CAS.ProductName").get(1)); - assertEquals("test3", retMet.getAllMetadata("CAS.ProductName").get(2)); - } catch (Exception e) { - fail(e.getMessage()); - } - - - } - - - private static Product getTestProduct() { - Product testProduct = Product.getDefaultFlatProduct("test", - "urn:oodt:GenericFile"); - testProduct.getProductType().setName("GenericFile"); - return testProduct; - } - - private static Metadata getTestMetadata(String prodName) { - Metadata met = new Metadata(); - met.addMetadata("CAS.ProductName", prodName); - met.addMetadata("CAS.ProductName", prodName+"2"); - met.addMetadata("CAS.ProductName", prodName+"3"); - return met; - } + public TestOrderedDataSourceCatalog() { + super(); + System.setProperty( + "org.apache.oodt.cas.filemgr.catalog.datasource.orderedValues", "true"); + setCatalog(getCatalog()); + + } + + protected Catalog getCatalog() { + try { + return new DataSourceCatalogFactory().createCatalog(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.oodt.cas.filemgr.catalog.TestDataSourceCatalog#getSchemaPath() + */ + @Override + protected String getSchemaPath() { + return "./src/testdata/testcat.ordered.sql"; + } + + public void testOrdering() { + Product testProduct = getTestProduct(); + Metadata testMet = getTestMetadata("test"); + + try { + myCat.addProduct(testProduct); + myCat.addMetadata(testMet, testProduct); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } + + Product retProduct; + try { + Metadata retMet = myCat.getMetadata(testProduct); + assertNotNull(retMet); + assertNotNull(retMet.getAllMetadata("CAS.ProductName")); + assertEquals(3, retMet.getAllMetadata("CAS.ProductName").size()); + assertEquals("test", retMet.getAllMetadata("CAS.ProductName").get(0)); + assertEquals("test2", retMet.getAllMetadata("CAS.ProductName").get(1)); + assertEquals("test3", retMet.getAllMetadata("CAS.ProductName").get(2)); + } catch (Exception e) { + fail(e.getMessage()); + } + + } + + private static Product getTestProduct() { + Product testProduct = Product.getDefaultFlatProduct("test", + "urn:oodt:GenericFile"); + testProduct.getProductType().setName("GenericFile"); + return testProduct; + } + + private static Metadata getTestMetadata(String prodName) { + Metadata met = new Metadata(); + met.addMetadata("CAS.ProductName", prodName); + met.addMetadata("CAS.ProductName", prodName + "2"); + met.addMetadata("CAS.ProductName", prodName + "3"); + return met; + } } - -