@@ -0,0 +1,3496 @@
+/**%0A * Copyright 2010 JBoss Inc%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.drools.guvnor.server.files;%0A/*%0A * Copyright 2005 JBoss Inc%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class DeploymentURIHelperTest %7B%0A%0A    @Test%0A    public void testGetPackageToExport() throws Exception %7B%0A        String uri = %22/org.drools.guvnor.Guvnor/package/boo/ya+man%22;%0A%0A        PackageDeploymentURIHelper helper = new PackageDeploymentURIHelper(uri);%0A%0A        assertEquals( %22ya man%22, helper.getVersion() );%0A        assertEquals( %22boo%22, helper.getPackageName() );%0A        assertFalse(helper.isLatest());%0A%0A        helper = new PackageDeploymentURIHelper(%22/asset/bar/LATEST%22);%0A        assertTrue(helper.isLatest());%0A        assertEquals(%22bar%22, helper.getPackageName());%0A        assertFalse(helper.isAsset());%0A    %7D%0A%0A    @Test%0A    public void testGetPackageWithDRL() throws Exception %7B%0A    %09String uri = %22/org.drools.guvnor.Guvnor/package/boo/ya+man.drl%22;%0A        PackageDeploymentURIHelper helper = new PackageDeploymentURIHelper(uri);%0A%0A        assertTrue(helper.isSource());%0A        assertFalse(helper.isDocumentation());%0A        assertEquals( %22ya man%22, helper.getVersion() );%0A        assertEquals( %22boo%22, helper.getPackageName() );%0A        assertFalse(helper.isLatest());%0A        assertFalse(helper.isAsset());%0A    %7D%0A%0A    @Test%0A    public void testGetAssetDRL() throws Exception %7B%0A    %09String uri = %22/org.drools.guvnor.Guvnor/package/packName/LATEST/assetName.drl%22;%0A        PackageDeploymentURIHelper helper = new PackageDeploymentURIHelper(uri);%0A        assertTrue(helper.isSource());%0A        assertFalse(helper.isDocumentation());%0A        assertEquals(%22LATEST%22, helper.getVersion());%0A        assertEquals(%22packName%22, helper.getPackageName());%0A        assertEquals(%22assetName%22, helper.getAssetName());%0A        assertTrue(helper.isAsset());%0A    %7D%0A%0A    @Test%0A    public void testGetDocumentation() throws Exception %7B%0A        String uri = %22/org.drools.guvnor.Guvnor/package/packName/LATEST/documentation.pdf%22;%0A        PackageDeploymentURIHelper helper = new PackageDeploymentURIHelper(uri);%0A        assertFalse(helper.isSource());%0A        assertTrue(helper.isDocumentation());%0A        assertEquals(%22LATEST%22, helper.getVersion());%0A        assertEquals(%22packName%22, helper.getPackageName());%0A        assertEquals(%22documentation%22, helper.getAssetName());%0A        assertTrue(helper.isAsset());%0A    %7D%0A%0A%7D%0A

rename DeploymentURIHelperTest.java