/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5072004
* @summary Test new rules for isValue
* @author Eamonn McManus
*/
public class IsValueTest {
// Check that adding fields doesn't make isValue return false
// Check that removing fields does make isValue return false
// Check that we can add a contained CompositeData with extra fields
// inside another CompositeData
new String[] {"wrapped"},
new String[] {"wrapped"},
try {
new String[] {"wrapped"},
check(true, "CompositeDataSupport containing CompositeDataSupport");
} catch (Exception e) {
check(false, "CompositeDataSupport containing CompositeDataSupport: " + e);
}
// ...but not the contrary
new String[] {"wrapped"},
new String[] {"wrapped"},
try {
new String[] {"wrapped"},
check(false, "CompositeDataSupport containing old did not get exception");
} catch (OpenDataException e) {
check(true, "CompositeDataSupport containing old got expected exception: " + e);
}
// Check that a TabularData can get an extended CompositeData row
new TabularDataSupport(ttOld);
try {
check(true, "TabularDataSupport adding extended CompositeData");
} catch (Exception e) {
check(false, "TabularDataSupport adding extended CompositeData: " + e);
}
// Check that an extended TabularData can be put into a CompositeData
new TabularDataSupport(ttNew);
new String[] {"wrapped"},
new String[] {"wrapped"},
try {
new String[] {"wrapped"},
check(true, "CompositeDataSupport adding extended TabularData");
} catch (Exception e) {
check(false, "CompositeDataSupport adding extended TabularData: " + e);
}
}
if (value)
else {
}
}
}