oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
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 GMT
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$
  * 
- * <p>
- * Describe your class here
- * </p>.
+ *          <p>
+ *          Describe your class here
+ *          </p>
+ *          .
  */
 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;
+  }
 
 }
-
-



Mime
View raw message