Index: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/URLPackageScannerTestCase.java =================================================================== --- impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/URLPackageScannerTestCase.java (revision 0) +++ impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/URLPackageScannerTestCase.java (revision 0) @@ -0,0 +1,35 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2010, Red Hat Middleware LLC, and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed 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.jboss.shrinkwrap.impl.base; + +import org.junit.Test; + +/** + * URLPackageScannerTestCase + * + * @author Jason Porter + * @version $Revision$ + */ +public class URLPackageScannerTestCase +{ + @Test(expected = IllegalArgumentException.class) + public void shouldThrowExceptionNullPackage() + { + URLPackageScanner test = new URLPackageScanner((Package)null, true, + URLPackageScannerTestCase.class.getClassLoader()); + } +} Property changes on: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/URLPackageScannerTestCase.java ___________________________________________________________________ Added: svn:mime-type + text/x-java-source Added: svn:keywords + Author Date Id Revision URL Added: svn:eol-style + native Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java =================================================================== --- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java (revision 3934) +++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java (working copy) @@ -58,7 +58,15 @@ public URLPackageScanner(Package pkg, boolean addRecursively, ClassLoader classLoader) { - this(pkg.getName(), addRecursively, classLoader); + Validate.notNull(pkg, "Pkg must be specified"); + Validate.notNull(pkg.getName(), "Pkg must have a name"); + Validate.notNull(addRecursively, "AddRecursively must be specified"); + Validate.notNull(classLoader, "ClassLoader must be specified"); + + this.packageName = pkg.getName(); + this.packageNamePath = packageName.replace(".", "/"); + this.addRecursively = addRecursively; + this.classLoader = classLoader; } public URLPackageScanner(String packageName, boolean addRecursively, ClassLoader classLoader)