atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [07/50] [abbrv] incubator-atlas git commit: IDE java code reformat
Date Fri, 12 Jun 2015 20:38:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fef50cee/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
b/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
index e7ad547..a9e8eba 100755
--- a/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/resources/TypesJerseyResourceIT.java
@@ -70,12 +70,9 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
             String typesAsJSON = TypesSerialization.toJson(typeDefinition);
             System.out.println("typesAsJSON = " + typesAsJSON);
 
-            WebResource resource = service
-                    .path("api/atlas/types");
+            WebResource resource = service.path("api/atlas/types");
 
-            ClientResponse clientResponse = resource
-                    .accept(Servlets.JSON_MEDIA_TYPE)
-                    .type(Servlets.JSON_MEDIA_TYPE)
+            ClientResponse clientResponse = resource.accept(Servlets.JSON_MEDIA_TYPE).type(Servlets.JSON_MEDIA_TYPE)
                     .method(HttpMethod.POST, ClientResponse.class, typesAsJSON);
             Assert.assertEquals(clientResponse.getStatus(), Response.Status.CREATED.getStatusCode());
 
@@ -95,13 +92,9 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
         for (HierarchicalTypeDefinition typeDefinition : typeDefinitions) {
             System.out.println("typeName = " + typeDefinition.typeName);
 
-            WebResource resource = service
-                    .path("api/atlas/types")
-                    .path(typeDefinition.typeName);
+            WebResource resource = service.path("api/atlas/types").path(typeDefinition.typeName);
 
-            ClientResponse clientResponse = resource
-                    .accept(Servlets.JSON_MEDIA_TYPE)
-                    .type(Servlets.JSON_MEDIA_TYPE)
+            ClientResponse clientResponse = resource.accept(Servlets.JSON_MEDIA_TYPE).type(Servlets.JSON_MEDIA_TYPE)
                     .method(HttpMethod.GET, ClientResponse.class);
             Assert.assertEquals(clientResponse.getStatus(), Response.Status.OK.getStatusCode());
 
@@ -114,9 +107,9 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
             String typesJson = response.getString(AtlasClient.DEFINITION);
             final TypesDef typesDef = TypesSerialization.fromJson(typesJson);
             List<HierarchicalTypeDefinition<ClassType>> hierarchicalTypeDefinitions
= typesDef.classTypesAsJavaList();
-            for(HierarchicalTypeDefinition<ClassType> classType : hierarchicalTypeDefinitions)
{
-                for(AttributeDefinition attrDef : classType.attributeDefinitions) {
-                    if("name".equals(attrDef.name)) {
+            for (HierarchicalTypeDefinition<ClassType> classType : hierarchicalTypeDefinitions)
{
+                for (AttributeDefinition attrDef : classType.attributeDefinitions) {
+                    if ("name".equals(attrDef.name)) {
                         Assert.assertEquals(attrDef.isIndexable, true);
                         Assert.assertEquals(attrDef.isUnique, true);
                     }
@@ -127,25 +120,18 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
 
     @Test
     public void testGetDefinitionForNonexistentType() throws Exception {
-        WebResource resource = service
-                .path("api/atlas/types")
-                .path("blah");
+        WebResource resource = service.path("api/atlas/types").path("blah");
 
-        ClientResponse clientResponse = resource
-                .accept(Servlets.JSON_MEDIA_TYPE)
-                .type(Servlets.JSON_MEDIA_TYPE)
+        ClientResponse clientResponse = resource.accept(Servlets.JSON_MEDIA_TYPE).type(Servlets.JSON_MEDIA_TYPE)
                 .method(HttpMethod.GET, ClientResponse.class);
         Assert.assertEquals(clientResponse.getStatus(), Response.Status.NOT_FOUND.getStatusCode());
     }
 
     @Test(dependsOnMethods = "testSubmit")
     public void testGetTypeNames() throws Exception {
-        WebResource resource = service
-                .path("api/atlas/types");
+        WebResource resource = service.path("api/atlas/types");
 
-        ClientResponse clientResponse = resource
-                .accept(Servlets.JSON_MEDIA_TYPE)
-                .type(Servlets.JSON_MEDIA_TYPE)
+        ClientResponse clientResponse = resource.accept(Servlets.JSON_MEDIA_TYPE).type(Servlets.JSON_MEDIA_TYPE)
                 .method(HttpMethod.GET, ClientResponse.class);
         Assert.assertEquals(clientResponse.getStatus(), Response.Status.OK.getStatusCode());
 
@@ -168,14 +154,11 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
     public void testGetTraitNames() throws Exception {
         String[] traitsAdded = addTraits();
 
-        WebResource resource = service
-                .path("api/atlas/types");
+        WebResource resource = service.path("api/atlas/types");
 
-        ClientResponse clientResponse = resource
-                .queryParam("type", DataTypes.TypeCategory.TRAIT.name())
-                .accept(Servlets.JSON_MEDIA_TYPE)
-                .type(Servlets.JSON_MEDIA_TYPE)
-                .method(HttpMethod.GET, ClientResponse.class);
+        ClientResponse clientResponse =
+                resource.queryParam("type", DataTypes.TypeCategory.TRAIT.name()).accept(Servlets.JSON_MEDIA_TYPE)
+                        .type(Servlets.JSON_MEDIA_TYPE).method(HttpMethod.GET, ClientResponse.class);
         Assert.assertEquals(clientResponse.getStatus(), Response.Status.OK.getStatusCode());
 
         String responseAsString = clientResponse.getEntity(String.class);
@@ -190,14 +173,7 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
     }
 
     private String[] addTraits() throws Exception {
-        String[] traitNames = {
-                "class_trait",
-                "secure_trait",
-                "pii_trait",
-                "ssn_trait",
-                "salary_trait",
-                "sox_trait",
-        };
+        String[] traitNames = {"class_trait", "secure_trait", "pii_trait", "ssn_trait", "salary_trait",
"sox_trait",};
 
         for (String traitName : traitNames) {
             HierarchicalTypeDefinition<TraitType> traitTypeDef =
@@ -212,30 +188,27 @@ public class TypesJerseyResourceIT extends BaseResourceIT {
     private List<HierarchicalTypeDefinition> createHiveTypes() throws Exception {
         ArrayList<HierarchicalTypeDefinition> typeDefinitions = new ArrayList<>();
 
-        HierarchicalTypeDefinition<ClassType> databaseTypeDefinition =
-                TypesUtil.createClassTypeDef("database",
-                        ImmutableList.<String>of(),
+        HierarchicalTypeDefinition<ClassType> databaseTypeDefinition = TypesUtil
+                .createClassTypeDef("database", ImmutableList.<String>of(),
                         TypesUtil.createUniqueRequiredAttrDef("name", DataTypes.STRING_TYPE),
                         TypesUtil.createRequiredAttrDef("description", DataTypes.STRING_TYPE));
         typeDefinitions.add(databaseTypeDefinition);
 
-        HierarchicalTypeDefinition<ClassType> tableTypeDefinition = TypesUtil.createClassTypeDef(
-                "table",
-                ImmutableList.<String>of(),
-                TypesUtil.createUniqueRequiredAttrDef("name", DataTypes.STRING_TYPE),
-                TypesUtil.createRequiredAttrDef("description", DataTypes.STRING_TYPE),
-                TypesUtil.createOptionalAttrDef("columnNames", DataTypes.arrayTypeName(DataTypes.STRING_TYPE)),
-                TypesUtil.createOptionalAttrDef("created", DataTypes.DATE_TYPE),
-                TypesUtil.createOptionalAttrDef("parameters", DataTypes.mapTypeName(DataTypes.STRING_TYPE,
DataTypes.STRING_TYPE)),
-                TypesUtil.createRequiredAttrDef("type", DataTypes.STRING_TYPE),
-                new AttributeDefinition("database",
-                        "database", Multiplicity.REQUIRED, false, "database"));
+        HierarchicalTypeDefinition<ClassType> tableTypeDefinition = TypesUtil
+                .createClassTypeDef("table", ImmutableList.<String>of(),
+                        TypesUtil.createUniqueRequiredAttrDef("name", DataTypes.STRING_TYPE),
+                        TypesUtil.createRequiredAttrDef("description", DataTypes.STRING_TYPE),
+                        TypesUtil.createOptionalAttrDef("columnNames", DataTypes.arrayTypeName(DataTypes.STRING_TYPE)),
+                        TypesUtil.createOptionalAttrDef("created", DataTypes.DATE_TYPE),
TypesUtil
+                                .createOptionalAttrDef("parameters",
+                                        DataTypes.mapTypeName(DataTypes.STRING_TYPE, DataTypes.STRING_TYPE)),
+                        TypesUtil.createRequiredAttrDef("type", DataTypes.STRING_TYPE),
+                        new AttributeDefinition("database", "database", Multiplicity.REQUIRED,
false, "database"));
         typeDefinitions.add(tableTypeDefinition);
 
-        HierarchicalTypeDefinition<TraitType> fetlTypeDefinition = TypesUtil.createTraitTypeDef(
-                "fetl",
-                ImmutableList.<String>of(),
-                TypesUtil.createRequiredAttrDef("level", DataTypes.INT_TYPE));
+        HierarchicalTypeDefinition<TraitType> fetlTypeDefinition = TypesUtil
+                .createTraitTypeDef("fetl", ImmutableList.<String>of(),
+                        TypesUtil.createRequiredAttrDef("level", DataTypes.INT_TYPE));
         typeDefinitions.add(fetlTypeDefinition);
 
         return typeDefinitions;

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fef50cee/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerIT.java
b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerIT.java
index ee06cdc..3e27532 100644
--- a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerIT.java
@@ -26,7 +26,7 @@ import java.net.URL;
 
 import static org.apache.atlas.security.SecurityProperties.CERT_STORES_CREDENTIAL_PROVIDER_PATH;
 
-public class SecureEmbeddedServerIT extends SecureEmbeddedServerITBase{
+public class SecureEmbeddedServerIT extends SecureEmbeddedServerITBase {
     @Test
     public void testServerConfiguredUsingCredentialProvider() throws Exception {
         // setup the configuration
@@ -47,7 +47,7 @@ public class SecureEmbeddedServerIT extends SecureEmbeddedServerITBase{
             secureEmbeddedServer.server.start();
 
             URL url = new URL("https://localhost:21443/");
-            HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
             connection.setRequestMethod("GET");
             connection.connect();
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fef50cee/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerITBase.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerITBase.java
b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerITBase.java
index 0f3286f..4bfc320 100755
--- a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerITBase.java
+++ b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerITBase.java
@@ -64,11 +64,9 @@ public class SecureEmbeddedServerITBase {
 
     static {
         //for localhost testing only
-        javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(
-                new javax.net.ssl.HostnameVerifier(){
+        javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier()
{
 
-                    public boolean verify(String hostname,
-                                          javax.net.ssl.SSLSession sslSession) {
+                    public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession)
{
                         if (hostname.equals("localhost")) {
                             return true;
                         }
@@ -81,7 +79,7 @@ public class SecureEmbeddedServerITBase {
     }
 
     @BeforeClass
-    public void setupServerURI () throws Exception {
+    public void setupServerURI() throws Exception {
         BaseResourceIT.baseUrl = "https://localhost:21443";
     }
 
@@ -118,7 +116,8 @@ public class SecureEmbeddedServerITBase {
 
             Assert.fail("Should have thrown an exception");
         } catch (IOException e) {
-            Assert.assertEquals("No credential provider path configured for storage of certificate
store passwords", e.getMessage());
+            Assert.assertEquals("No credential provider path configured for storage of certificate
store passwords",
+                    e.getMessage());
         } finally {
             secureEmbeddedServer.server.stop();
         }
@@ -173,8 +172,9 @@ public class SecureEmbeddedServerITBase {
 
             TestListenerAdapter tla = new TestListenerAdapter();
             TestNG testng = new TestNG();
-            testng.setTestClasses(new Class[] { AdminJerseyResourceIT.class, EntityJerseyResourceIT.class,
-                    MetadataDiscoveryJerseyResourceIT.class, RexsterGraphJerseyResourceIT.class,
TypesJerseyResourceIT.class});
+            testng.setTestClasses(new Class[]{AdminJerseyResourceIT.class, EntityJerseyResourceIT.class,
+                    MetadataDiscoveryJerseyResourceIT.class, RexsterGraphJerseyResourceIT.class,
+                    TypesJerseyResourceIT.class});
             testng.addListener(tla);
             testng.run();
 
@@ -185,8 +185,8 @@ public class SecureEmbeddedServerITBase {
     }
 
     protected String getWarPath() {
-        return String.format("/target/atlas-webapp-%s",
-                System.getProperty("project.version", "0.1-incubating-SNAPSHOT"));
+        return String
+                .format("/target/atlas-webapp-%s", System.getProperty("project.version",
"0.1-incubating-SNAPSHOT"));
     }
 
     protected void setupCredentials() throws Exception {
@@ -196,23 +196,19 @@ public class SecureEmbeddedServerITBase {
         file.delete();
         conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, providerUrl);
 
-        CredentialProvider provider =
-                CredentialProviderFactory.getProviders(conf).get(0);
+        CredentialProvider provider = CredentialProviderFactory.getProviders(conf).get(0);
 
         // create new aliases
         try {
 
             char[] storepass = {'k', 'e', 'y', 'p', 'a', 's', 's'};
-            provider.createCredentialEntry(
-                    KEYSTORE_PASSWORD_KEY, storepass);
+            provider.createCredentialEntry(KEYSTORE_PASSWORD_KEY, storepass);
 
             char[] trustpass = {'k', 'e', 'y', 'p', 'a', 's', 's'};
-            provider.createCredentialEntry(
-                    TRUSTSTORE_PASSWORD_KEY, trustpass);
+            provider.createCredentialEntry(TRUSTSTORE_PASSWORD_KEY, trustpass);
 
             char[] certpass = {'k', 'e', 'y', 'p', 'a', 's', 's'};
-            provider.createCredentialEntry(
-                    SERVER_CERT_PASSWORD_KEY, certpass);
+            provider.createCredentialEntry(SERVER_CERT_PASSWORD_KEY, certpass);
 
             // write out so that it can be found in checks
             provider.flush();


Mime
View raw message