incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1500678 - in /sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api: ./ InstallableResourceTest.java
Date Mon, 08 Jul 2013 11:56:54 GMT
Author: cziegeler
Date: Mon Jul  8 11:56:54 2013
New Revision: 1500678

URL: http://svn.apache.org/r1500678
Log:
SLING-2947 :  Merge installer api back into core

Added:
    sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/
    sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
  (with props)

Added: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java?rev=1500678&view=auto
==============================================================================
--- sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
(added)
+++ sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
Mon Jul  8 11:56:54 2013
@@ -0,0 +1,62 @@
+/*
+ * 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.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.installer.api;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.util.Hashtable;
+
+import org.junit.Test;
+
+/**
+ * Test for the installable resource.
+ */
+public class InstallableResourceTest {
+
+    @Test public void testConstructor() {
+        // no id
+        try {
+            new InstallableResource(null, null, new Hashtable<String, Object>(), null,
null, null);
+            fail("IAE expected : no id");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+        // no input stream, no dict
+        try {
+            new InstallableResource("1", null, null, null, null, null);
+            fail("IAE expected : no is no dict");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+        new InstallableResource("1", new ByteArrayInputStream("a".getBytes()), null, null,
null, null);
+        new InstallableResource("1", null, new Hashtable<String, Object>(), null, null,
null);
+        new InstallableResource("1",  new ByteArrayInputStream("a".getBytes()), new Hashtable<String,
Object>(), null, null, null);
+    }
+
+    @Test public void testPriority() {
+        final InstallableResource defaultPrio =
+            new InstallableResource("1", null, new Hashtable<String, Object>(), null,
null, null);
+        assertEquals(InstallableResource.DEFAULT_PRIORITY, defaultPrio.getPriority());
+        final InstallableResource ownPrio =
+            new InstallableResource("1", null, new Hashtable<String, Object>(), null,
null, 47);
+        assertEquals(47, ownPrio.getPriority());
+    }
+}

Propchange: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: sling/trunk/installer/core/src/test/java/org/apache/sling/installer/api/InstallableResourceTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message