blob: 48adc2a6fcca0cb6ab7c18d9796ffdad8787627d [file] [log] [blame]
/**
* 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.openejb.junit;
import org.apache.openejb.jee.EjbJar;
import org.apache.openejb.testing.Descriptor;
import org.apache.openejb.testing.Descriptors;
import org.apache.openejb.testing.Module;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@RunWith(ApplicationComposer.class)
public class DescriptorTest {
@Module
@Descriptors(@Descriptor(name = "resources.xml", path = "descriptor-resources.xml"))
public EjbJar classes() {
return new EjbJar();
}
@Resource
private DataSource ds;
@Test
public void checkDDWasHere() throws SQLException {
assertNotNull(ds);
final Connection connection = ds.getConnection();
final String url = connection.getMetaData().getURL();
assertEquals("jdbc:hsqldb:mem:descriptors", url);
connection.close();
}
}