@@ -0,0 +1,2196 @@
+/*******************************************************************************%0A * * Copyright 2013 Impetus Infotech.%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 ******************************************************************************/%0Apackage com.impetus.kundera.metadata.model;%0A%0Aimport javax.persistence.Persistence;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.impetus.kundera.metadata.KunderaMetadataManager;%0Aimport com.impetus.kundera.metadata.entities.Article;%0A%0A/**%0A * @author amresh.singh%0A *%0A */%0Apublic class ApplicationMetadataTest%0A%7B%0A%0A    private String persistenceUnit = %22patest%22;%0A    %0A    /**%0A     * @throws java.lang.Exception%0A     */%0A    @Before%0A    public void setUp() throws Exception%0A    %7B%0A        Persistence.createEntityManagerFactory(persistenceUnit);%0A    %7D%0A%0A    /**%0A     * @throws java.lang.Exception%0A     */%0A    @After%0A    public void tearDown() throws Exception%0A    %7B%0A        KunderaMetadata.INSTANCE.getApplicationMetadata().unloadApplicationMatadata(persistenceUnit);%0A        KunderaMetadata.INSTANCE.setApplicationMetadata(null);%0A    %7D%0A%0A    /**%0A     * Test method for %7B@link com.impetus.kundera.metadata.model.ApplicationMetadata#addEntityMetadata(java.lang.String, java.lang.Class, com.impetus.kundera.metadata.model.EntityMetadata)%7D.%0A     */%0A    @Test%0A    public void testAddEntityMetadata()%0A    %7B%0A        KunderaMetadata.INSTANCE.getApplicationMetadata().addEntityMetadata(persistenceUnit, Article.class, new EntityMetadata(Article.class));%0A        Assert.assertNotNull(KunderaMetadataManager.getEntityMetadata(Article.class));%0A    %7D %0A%0A%7D%0A

Fix for issue#342, added new test cases