Skip to content

Commit

Permalink
Add an implementation of the new method to the mock
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Mar 11, 2013
1 parent 3152f81 commit b258a69
Showing 1 changed file with 64 additions and 74 deletions.
Expand Up @@ -9,7 +9,7 @@
* 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,
* 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.
Expand Down Expand Up @@ -37,78 +37,68 @@
* @author pmuir
*
*/
public class MockDeployment implements Deployment
{

static class MockBeanDeploymentArchive implements BeanDeploymentArchive
{

private final ServiceRegistry services;

public MockBeanDeploymentArchive(ServiceRegistry services)
{
this.services = services;
}

public Collection<String> getBeanClasses()
{
return emptySet();
}

public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
{
return emptySet();
}

public BeansXml getBeansXml()
{
return EMPTY_BEANS_XML;
}

public Collection<EjbDescriptor<?>> getEjbs()
{
return emptySet();
}

public ServiceRegistry getServices()
{
return services;
}

public String getId()
{
return "test";
}

}

private final ServiceRegistry services;
private final BeanDeploymentArchive beanDeploymentArchive;

public MockDeployment(ServiceRegistry services, MockBeanDeploymentArchive beanDeploymentArchive)
{
this.services = services;
this.beanDeploymentArchive = beanDeploymentArchive;
}

public List<BeanDeploymentArchive> getBeanDeploymentArchives()
{
return Collections.singletonList(beanDeploymentArchive);
}

public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
{
return null;
}

public ServiceRegistry getServices()
{
return services;
}

public Iterable<Metadata<Extension>> getExtensions()
{
return emptyList();
}
public class MockDeployment implements Deployment {

static class MockBeanDeploymentArchive implements BeanDeploymentArchive {

private final ServiceRegistry services;

public MockBeanDeploymentArchive(ServiceRegistry services) {
this.services = services;
}

public Collection<String> getBeanClasses() {
return emptySet();
}

public Collection<BeanDeploymentArchive> getBeanDeploymentArchives() {
return emptySet();
}

public BeansXml getBeansXml() {
return EMPTY_BEANS_XML;
}

public Collection<EjbDescriptor<?>> getEjbs() {
return emptySet();
}

public ServiceRegistry getServices() {
return services;
}

public String getId() {
return "test";
}

@Override
public Collection<String> getAdditionalTypes() {
return emptySet();
}
}

private final ServiceRegistry services;
private final BeanDeploymentArchive beanDeploymentArchive;

public MockDeployment(ServiceRegistry services, MockBeanDeploymentArchive beanDeploymentArchive) {
this.services = services;
this.beanDeploymentArchive = beanDeploymentArchive;
}

public List<BeanDeploymentArchive> getBeanDeploymentArchives() {
return Collections.singletonList(beanDeploymentArchive);
}

public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
return null;
}

public ServiceRegistry getServices() {
return services;
}

public Iterable<Metadata<Extension>> getExtensions() {
return emptyList();
}

}

0 comments on commit b258a69

Please sign in to comment.